IPredictorClient::PredictMostLikelySegment Method [C++]

Use this method to predict the most likely segment of a population to which a user, the current case, belongs.

Definition

[C++]

HRESULT IPredictorClient::PredictMostLikelySegment(IDictionary*dCurrentCase,
  VARIANT*pvarProbability,
  BSTR*pbstrSegment);

[Visual Basic]

Function PredictMostLikelySegment(dCurrentCase As Object,
  Optional pvarProbability As Variant) As String

Parameters

  • dCurrentCase[C++]
    [in] A pointer to the IDictionary interface that contains the current case.
  • dCurrentCase[Visual Basic]
    A Dictionary object that contains the current case.
  • pvarProbability[C++]
    [out, optional] A pointer to a VARIANT used to return the membership probability associated with the segment name.
  • pvarProbability[Visual Basic]
    A Variant used to return the membership probability associated with the segment name.
  • pbstrSegment[C++]
    [out, retval] A pointer to a BSTR used to return the name of the segment most likely to contain the given case.

Return Values

[C++] This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

[Visual Basic] If successful, this method returns a String containing the segment name.

Error Values

[C++] 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.

[Visual Basic] 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

The Microsoft Research Cluster Engine Data Modeler groups similar users into segments. Similar segments are further grouped into higher order collections of segments, creating a hierarchy from which to analyze trends and discover hidden correlations.

This method returns the name of the segment most likely to contain the given case, and optionally, the probability that the user belongs to this segment.

Load the segment 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.

[C++]

The pvarProbability and pbstrSegment parameters contain valid data only if the method completes successfully.

[Visual Basic]

Example

' sSegment is a String, vProbabilty is a Variant
' dCase is a Commerce.Dictionary object
sSegment = oPredictorClient.PredictMostLikelySegment(dCase, vProbability)

See Also

[C++]PredictorClient Object

[Visual Basic]PredictorClient Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.