Share via


IPredictorClient::Explain

Ee811323.c++_off(en-US,CS.10).gifEe811323.vb_on(en-US,CS.10).gif

Use this method to return the properties and values from the current case that are relevant to a prediction of the specified unknown property. A score corresponding to each returned property/value pair explains the importance of each property/value pair to the prediction.

Definition

HRESULT IPredictorClient::Explain(IDictionary*dCurrentCase,BSTRsPropToExplain,VARIANT*pvsavRelevantProps,VARIANT*pvsavRelevantValues,VARIANT*pvsavRelevantScores,longlMaxExplanations);

Parameters

dCurrentCase

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

sPropToExplain

[in, string] A BSTR that contains the name of the property to explain.

pvsavRelevantProps

[out] A pointer to a VARIANT used to return a SAFEARRAY containing the list of properties from the current case that are relevant to the prediction.

pvsavRelevantValues

[out] A pointer to a VARIANT used to return a SAFEARRAY containing the list of values corresponding to the relevant properties.

pvsavRelevantScores

[out] A pointer to a VARIANT used to return a SAFEARRAY containing the list of scores corresponding to the importance of each property towards the prediction.

lMaxExplanations

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

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

This method returns property/value/score triplets sorted in descending order by score. The higher the score, the greater the probability the unknown property is correctly predicted by the corresponding property/value pair.

Load the prediction model using the LoadModelFromDB or LoadModelFromFile methods prior to using this method.

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

The pvsavReleventProps, pvsavRelevantValues, and pvsavRelevantScores parameters contain valid data only if the method completes successfully.

See Also

PredictorClient Object


All rights reserved.