Let's build a recommendation engine that can recommend movies to a bunch of users. We will be using data put together by the GroupLens Research research group at the University of Minnesota.
Follow these steps:
First, we will import the relevant packages:
import pandas as pd
import numpy as np
Now, let's import the user_id and item_id datasets:
df_reviews = pd.read_csv('reviews.csv')
df_movie_titles = pd.read_csv('movies.csv',index_col=False)
We merge the two DataFrames by the movie ID:
df = pd.merge(df_users, df_movie_titles, on='movieId')
The header of the df DataFrame, after running the preceding code, looks like the following:
The details of the columns are as follows:
-
userid: The unique ID of each of the users
movieid: The unique ID of each of the...