Predictor.GetPredictions Method
The GetPredictions method examines a list of orders (usually the customer's order form) and suggests a specified number of products in which the customer may be interested, based on the knowledge base created by the Predictor.
GetPredictions returns a list of products, sorted by Weight, in the form of a SimpleList object that contains Dictionary objects. Each Dictionary object in the returned list corresponds to one suggested item, and contains three properties. The following properties are returned for each suggested item.
Property |
Description |
|
SKU |
Product SKU for suggested item. |
Weight |
Predicted quantity for this item, returned as a positive floating point number. Higher values of weight indicate higher predicted preference for that item. |
MatchSupport |
Number of merged baskets from other customers on which this suggestion is based, expressed as a floating value. Used in combination with the number of baskets evaluated (returned by the InitPredictor method), this number can be used to indicate the validity of this recommendation. In this release, all suggestions returned by a single call to GetPredictions return the same value for MatchSupport. |
Syntax
Predictor.GetPredictions(Items, MaxPredictions, PopularItemFilter, RequiredMatches)
Parameters
-
Items
-
The customer interest list, usually a list of items the customer has ordered or expressed interest in. The list must be implemented as a SimpleList object that contains Dictionary objects, where each Dictionary object represents a single item and contains properties called
SKU
and Quantity
. The GetPredictions method evaluates these items to suggest other items.
-
MaxPredictions
-
The maximum number of items to be returned by the GetPredictions method.
-
PopularItemFilter
-
A factor, expressed as a floating-point number between zero (0) and one (1), representing the degree that popular (frequently purchased) items are filtered from the suggestion list. In certain markets, some items are already so well-known (as indicated by their frequency of purchase) that they do not need to be suggested. For example, suppose that the most popular items at the Microsoft Press site were mouse pads. The store manager may prefer to suppress these items from the suggestion list. A value of one (1) indicates that popular products will be filtered, producing suggestions more specialized to the particular customer. A value of zero (0) indicates that suggestions are based solely on the purchases of similar customers. For applications where most of the users are familiar with many of the popular products, a value of about 0.9 is appropriate. To maximize sales of the most popular items, a value of zero (0) is recommended.
-
RequiredMatches
-
The minimum number of similar customers that were matched in the database in generating the suggestions. If there are fewer than RequiredMatches number of matching customers in the knowledge base, then GetPredictions will return no suggestions. Generally, a value of 4 to 6 is recommended for deployed applications where adequate data exists, to ensure higher quality suggestions. Making suggestions based on fewer than two matching customers is not advisable and may lead to issues of privacy intrusions and potentially revealing the contents of a single customer’s basket.
Example
The following example, from Microsoft Press Basket.asp, gets suggestions from the Predictor, returning the results in a SimpleList object, called products
, that contains Dictionary objects:
set products = predictor.GetPredictions(orderItems, 6, 0.3, 2)
For a complete example, see Predictor Example: Microsoft Press Product.asp.
Remarks
Calling the GetPredictions method does not update the knowledge base.
© 1997-1998 Microsoft Corporation. All rights reserved.