Share via


PredictorClient.Explain

Ee784341.c++_on(en-US,CS.10).gifEe784341.vb_off(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

Sub Explain(dCurrentCase As Object,sPropToExplain As String,pvsavRelevantProps As Variant,pvsavRelevantValues As Variant,pvsavRelevantScores As Variant,OptionallMaxExplanations As Long)

Parameters

dCurrentCase

A Dictionary object that contains the current case.

sPropToExplain

A String that contains the name of the property to explain.

pvsavRelevantProps

A Variant used to return a SafeArray containing the list of properties from the current case that are relevant to the prediction.

pvsavRelevantValues

A Variant used to return a SafeArray containing the list of values corresponding to the relevant properties.

pvsavRelevantScores

A Variant used to return a SafeArray containing the list of scores corresponding to the importance of each property towards the prediction.

lMaxExplanations

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

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

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.

Example

' dCase is a Dictionary object
' vsavRelevantProps, vsavRelevantValues, vsavRelevantScores
'  are Variant SafeArrays
oPredictorClient.Explain dCase, """Age""", vsavRelevantProps, _
 vsavRelevantValues, vsavRelevantScores, 10

See Also

PredictorClient Object


All rights reserved.