# NOT RUN {
# get a recommender endpoint and previously-trained model
rec_endp <- rec_endpoint$new("myrecusacvjwpk4raost", admin_key="key1", rec_key="key2")
rec_model <- rec_endp$get_model("model1")
data(ms_usage)
# item recommendations for a set of user IDs
users <- unique(ms_usage$user)[1:5]
rec_model$user_predict(users)
# item recommendations for a set of user IDs and transactions (assumed to be new)
user_df <- subset(ms_usage, user %in% users)
rec_model$user_predict(user_df)
# item recomendations for a set of item IDs
items <- unique(ms_usage$item)[1:5]
rec_model$item_predict(items)
# }
Run the code above in your browser using DataLab