<jupyter_start><jupyter_text>Choosing a model<jupyter_code># Predict the rating a user would give an item

f_model = tc.factorization_recommender.create(train, user_id='userId', item_id='title', target='rating')
f_results = f_model.recommend(users=[1, 30, 138491], k=3)
f_results
# Predict how likely it is that a user would rate the movie highly
# Absolute values of predicted scores may not match actual ratings 

s_model = tc.item_similarity_recommender.create(train, 'userId', 'title', target='rating')
s_results = s_model.recommend(users=[1, 30, 138491], k=3)
s_results
# Predict how likely it is that a user would rate the movie highly
# Ranking factorization recommends based on items that are similar AND are highly rated

rf_model = tc.ranking_factorization_recommender.create(train, 'userId', 'title', target='rating')
rf_results = rf_model.recommend(users=[1, 30, 138491], k=3)
rf_results<jupyter_output><empty_output><jupyter_text>Compare Models<jupyter_code>models = [f_model, s_model, rf_model]
model_names = ['Factorization', 'Item similarity', 'Ranking factorization']
tc.recommender.util.compare_models(test, models, model_names=model_names, metric='rmse', target='rating')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11065573770491803, 'fraction_numerical': 0.02459016393442623, 'mean_word_length': 7.912408759124087, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '468410', 'license': 'MIT', 'n_tokens_mistral': 427, 'n_tokens_neox': 395, 'n_words': 109, 'path': 'turicreate_recs.ipynb', 'repo_name': 'ngachago/movie_recs', 'size': '1220'}