Pivoting your data
In this chapter, you will go one step further in generating personalized recommendations — you will find items that users, similar to the one you are making recommendations for, have liked.
The first step you will need to start with is formatting your data. You begin with a dataset containing users and their ratings as individual rows with the following columns:
user: User IDtitle: Title of the movierating: Rating the user gave the movie
You will need to transform the DataFrame into a user rating matrix where each row represents a user, and each column represents the movies on the platform. This will allow you to easily compare users and their preferences.
Deze oefening maakt deel uit van de cursus
Building Recommendation Engines in Python
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Inspect the first 5 rows of user_ratings
print(user_ratings.____)