IPredictorClient::Predict

Ee811456.c++_off(en-US,CS.10).gifEe811456.vb_on(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

HRESULT IPredictorClient::Predict(IDictionary*dCurrentCase,ISimpleList*slPropsToPredict,VARIANT*pvsavPredictedPropsVARIANT*pvsavPredictedValslonglMaxPredictions,VARIANT*pvsavDetails);

Parameters

dCurrentCase

[in] A pointer to the IDictionary interface of a Dictionary object that contains the current case.

slPropsToPredict

[in] A pointer to the ISimpleList interface of a SimpleList object that contains the names of the properties to predict.

pvsavPredictedProps

[out] A pointer to a VARIANT used to return a SAFEARRAY containing the predicted property names.

pvsavPredictedVals

[out] A pointer to a VARIANT used to return a SAFEARRAY containing the predicted property values.

lMaxPredictions

[in, optional, defaultvalue (-1)] A long that specifies the maximum number of predictions to return. The default value indicates to return all predictions.

pvsavDetails

[out, optional] Reserved for future use.

Return Values

This method returns an HRESULT indicating whether or not it completed successfully. See the Error Values section for more details.

Error Values

This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT 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, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return 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.

See Also

PredictorClient Object

IPredictorClient::LoadModelFromFile

IPredictorClient::LoadModelFromDB

IPredictorClient::get_fpDefaultConfidence, put_fpDefaultConfidence


All rights reserved.