Documentation Home
HeatWave User Guide
Related Documentation Download this Manual
PDF (US Ltr) - 2.1Mb
PDF (A4) - 2.1Mb


HeatWave User Guide  /  ...  /  Using a Recommendation Model

3.11.3 Using a Recommendation Model

Once you train and load a recommendation model, you can start generating predictions (rows or tables) and scores for the model.

Generating Predictions and Scores

To generate predictions on the trained model, run the ML_PREDICT_ROW or ML_PREDICT_TABLE routine. Run the routines on the data with the same columns as the training model.

When generating predictions:

  • A table with the same name as the output table for ML_PREDICT_TABLE must not already exist.

  • NULL values for any row in the users or items columns will cause an error.

When generating scores for a recommendation model, run the ML_SCORE routine. You can use any of the recommendation metrics to score a recommendation model. You can use the metric parameter to specify a ratings metric or ranking metric. See: Recommendation Model Metrics.

For instructions on generating predictions and scores, see Section 3.7, “Predictions”, and Section 3.14.6, “Scoring Models”. For the complete list of option descriptions for predictions and scores, see ML_PREDICT_ROW, ML_PREDICT_TABLE, and ML_SCORE.

ML_EXPLAIN, ML_EXPLAIN_ROW and ML_EXPLAIN_TABLE do not support recommendation models. A call to any of these routines with a recommendation model will produce an error.

Options for Generating Predictions and Scores

The options for ML_PREDICT_ROW and ML_PREDICT_TABLE include the following:

  • topk: The number of recommendations to provide. The default is 3.

  • recommend: Specifies what to recommend. Permitted values are:

    • ratings: Predicts ratings that users will give. This is the default value.

    • items: Recommends items for users.

    • users: Recommends users for items.

    • users_to_items: This is the same as items.

    • items_to_users: This is the same as users.

    • items_to_items: Recommends similar items for items.

    • users_to_users: Recommends similar users for users.

  • remove_seen: If true, the model will not repeat existing interactions from the training table. It only applies to the recommendations items, users, users_to_items, and items_to_users.

The options for ML_SCORE include the following:

  • threshold: The optional threshold that defines positive feedback, and a relevant sample. Only use with ranking metrics. It can be used for either explicit or implicit feedback.

  • topk: The optional top K rows to recommend. Only use with ranking metrics.

  • remove_seen: If true, the model will not repeat existing interactions from the training table.