Share via


IPredictorClient::get_fpPopularityPenalty, put_fpPopularityPenalty

Ee825899.c++_off(en-US,CS.10).gifEe825899.vb_on(en-US,CS.10).gif

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

Definition

Get method:

HRESULT IPredictorClient::get_fpPopularityPenalty(float*pbVal);

Put method:

HRESULT IPredictorClient::put_fpPopularityPenalty(floatpbVal);

Parameters

pbVal

[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.

Return Values

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

Error Values

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.

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.

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

See Also

PredictorClient Object

IPredictorClient::Predict


All rights reserved.