diff --git a/examples/predict_ratings.py b/examples/predict_ratings.py index 8e6aabac..e29d27d3 100644 --- a/examples/predict_ratings.py +++ b/examples/predict_ratings.py @@ -17,8 +17,8 @@ algo.fit(trainset) # we can now query for specific predicions -uid = str(196) # raw user id (as in the ratings file). They are **strings**! -iid = str(302) # raw item id (as in the ratings file). They are **strings**! +uid = trainset.to_raw_uid(196) # raw user id (as in the ratings file). They are **strings**! Do not use str() causing issues of having the same estimation for different ids. +iid = trainset.to_raw_iid(302) # raw item id (as in the ratings file). They are **strings**! # get a prediction for specific users and items. pred = algo.predict(uid, iid, r_ui=4, verbose=True)