IPredictorClient::get_fpPopularityPenalty, put_fpPopularityPenalty Property [C++]

The fpPopularityPenalty property is a read/write property that influences the likelihood that the Predict method recommends popular items.

Definition

[C++]

Get method:

HRESULT IPredictorClient::get_fpPopularityPenalty(float*pbVal);

Put method:

HRESULT IPredictorClient::put_fpPopularityPenalty(floatpbVal);

[Visual Basic]

Property fpPopularityPenalty As Single

Parameters

  • pbVal[C++]
    [in] When putting the property, a float that contains the popularity penalty value to be applied to subsequent predictions. Valid range is 0.0 to less than 1. Default is zero (0).
    [out, retval] When getting the property, a pointer to a float used to return the popularity penalty value used in predictions.

[Visual Basic] None.

[C++]

Return Values

These methods return an HRESULT indicating whether they completed successfully. See the following Error Values section for more details.

Error Values

[C++] These methods return 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 property 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.

The following standard COM error value has a particular meaning in the context of this property.

E_INVALIDARG

The parameter pbVal = 1. The valid range is 0 to less than 1.

Remarks

Popular items are frequently purchased items that are so well known that they do not need to be recommended to a user. A higher penalty value reduces the probability that a popular item is included as a recommended product in the prediction results. The value ranges from 0.0 to less than 1.0. To maximize sales of the most popular items, the default popularity penalty of zero (0) is recommended. For applications where most of the users are familiar with many of the popular products, a value of 0.9 is appropriate.

Set a default value for this property in the Application_OnStart method in the global.asa file to avoid setting the value for each Predict method call.

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

[C++]

The pbVal parameter contains valid data only if the property is accessed successfully.

See Also

[C++]

PredictorClient Object

IPredictorClient::Predict

[Visual Basic]

PredictorClient Object

PredictorClient.Predict

Copyright © 2005 Microsoft Corporation.
All rights reserved.