O'Reilly logo

Building Recommendation Engines by Suresh Kumar Gorakala

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Data exploration

In this section, we will explore the MovieLens dataset and also prepare the data required for building collaborative filtering recommendation engines using python.

Let's see the distribution of ratings using the following code snippet:

import matplotlib.pyplot as plt 
plt.hist(df['Rating']) 

From the following image we see that we have more movies with 4 star ratings:

Data exploration

Using the following code snippet, we shall see the counts of ratings by applying the groupby() function and the count() function on DataFrame:

Data exploration

The following code snippet shows ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required