Once you train and load a recommendation model, you can start generating predictions (rows or tables) and scores for the model.
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 theusers
oritems
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.
The options
for
ML_PREDICT_ROW
and
ML_PREDICT_TABLE
include the
following:
topk
: The number of recommendations to provide. The default is3
.-
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 asitems
.items_to_users
: This is the same asusers
.items_to_items
: Recommends similar items for items.users_to_users
: Recommends similar users for users.
remove_seen
: Iftrue
, the model will not repeat existing interactions from the training table. It only applies to the recommendationsitems
,users
,users_to_items
, anditems_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
: Iftrue
, the model will not repeat existing interactions from the training table.