Practical example – creating a recommendation engine
Let’s build a recommendation engine that can recommend movies to a bunch of users. We will use data put together by the GroupLens Research group at the University of Minnesota.
1. Setting up the framework
Our first task is to ensure we have the right tools for the job. In the world of Python, this means importing necessary libraries:
import pandas as pd
import numpy as np
2. Data loading: ingesting reviews and titles
Now, let’s import the df_reviews
and df_movie_titles
datasets:
df_reviews = pd.read_csv('https://storage.googleapis.com/neurals/data/data/reviews.csv')
df_reviews.head()
The reviews.csv
dataset encompasses a rich collection of user reviews. Each entry features a user’s ID, a movie ID they’ve reviewed, their rating, and a timestamp of when the review was made.
Figure 12.6: Contents of the reviews.csv dataset
The movies.csv
dataset...