PredictorClient.Predict

Ee784414.c++_on(en-US,CS.10).gifEe784414.vb_off(en-US,CS.10).gif

Use this method to generate predictions that are used to recommend relevant products to a user, the current case, or to fill in missing profile data associated with the user.

Definition

Sub Predict(dCurrentCase As Object,slPropsToPredict As Object,pvsavPredictedPropsAs VariantpvsavPredictedValsAs VariantOptional lMaxPredictions As LongOptional pvsavDetailsAs Variant)

Parameters

dCurrentCase

A Dictionary object that contains the current case.

slPropsToPredict

A SimpleList object that contains the names of the properties to predict.

pvsavPredictedProps

A Variant used to return a SafeArray containing the predicted property names.

pvsavPredictedVals

A Variant used to return a SafeArray containing the predicted property values.

lMaxPredictions

A Long that specifies the maximum number of predictions to return. The default value of -1 indicates to return all predictions.

pvsavDetails

Reserved for future use.

Return Values

None.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

Predictions are made using the currently loaded prediction model based on user profile and selection information contained in the current case. The predicted property/value pairs are returned sorted in descending order of likelihood.

Set the fpDefaultConfidence and fpPopularityPenalty properties and load the prediction model using the LoadModelFromDB or LoadModelFromFile methods before using the Predict method.

Default values for the fpDefaultConfidence and fpPopularityPenalty properties may be set in the Application_OnStart method in the global.asa file to avoid having to explicitly set the values for every Predict method call.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

Example

' dCase is a Dictionary object, slPropsToPredict is a SimpleList
' vsavPredictedProps, vsavPredictedValues are Variant SafeArrays
oPredictorClient.Predict dCase, slPropsToPredict, vsavPredictedProps, _
 vsavPredictedVals, 10

See Also

PredictorClient Object

PredictorClient.LoadModelFromFile

PredictorClient.LoadModelFromDB

PredictorClient.fpDefaultConfidence


All rights reserved.