Code to Predict User Attributes
Create a SimpleList object and populate it with the properties to predict.
Dim slPropertiesToPredict Set slPropertiesToPredict = Server.CreateObject("Commerce.SimpleList") slPropertiesToPredict.Add("Age") slPropertiesToPredict.Add("Education")
Create Variant Safearrays to store the predicted properties and values.
Dim vsavPredictedProps Dim vsavPredictedValues
Make the predictions, using the dictionary, dCurrentCase, created and populated with information on the current user in Code to Predict Products, the PredictorClient object, oPredictorClient, created in Code to Load a Model and Set Default Properties, and the Purchase1 model loaded in the same section.
oPredictorClient.Predict dCurrentCase, slPropertiesToPredict _ vsavPredictedProps, vsavPredictedValues
Iterate through the returned predictions.
Dim i For i = LBound(vsavPredictedProps) To UBound(vsavPredictedProps) Response.Write vsavPredictedProps(i) & " = " _ & vsavPredictedValues(i) & "<BR>" Next
Release the objects.
Set dCurrentCase = Nothing Set slPropertiesToPredict = Nothing