KNN predictions
With the data in the correct shape from the last exercise, you can now use it to infer how user_001
feels about Apollo 13 (1995)
As a reminder, the data you prepared in the last exercise (and have been loaded into this one) are:
target_user_x
- Centered ratings thatuser_001
has given to the movies they have seen.other_users_x
- Centered ratings for all other users and the movies they have rated excluding the movie Apollo 13.other_users_y
- Raw ratings that all other users have given the movie Apollo 13.
You will use other_users_x
and other_users_y
to fit a KNeighborsRegressor
from scikit-learn and use it to predict what user_001
might have rated Apollo 13 (1995)
.
Diese Übung ist Teil des Kurses
Building Recommendation Engines in Python
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Import the regressor
from sklearn.neighbors import ____
# Instantiate the user KNN model
user_knn = KNeighborsRegressor(____=____, ____=____)