Building the Recommendation Engine

Learn how to build a recommendation engine using the correlation between the datasets.

Using correlation to rate movies

Say we have movie A and movie B. We’ve given a rating of 4.0 to movie A and the correlation between A and B is 1.0. Since 1.0 is the highest value, the movies are perfectly correlated, and the person who likes A should also like the B.

So our estimated score for B would be:

4.01.0=4.04.0 * 1.0 = 4.0

What if the correlation between movie A and movie B was -0.5? Our anticipated rating would be -2.0, which is very low. This means that those who enjoyed movie A probably wouldn’t like movie B.

To refresh, the steps are:

  1. Look at the scores of the movies we’ve rated.

  2. Check the rate movie’s correlation to the movies we haven’t rated.

  3. Find our anticipated score.

  4. Repeat steps 1–3 for all the three movies that we’ve rated.

Before we start on that, we’ve cleaned up corr_dict.py for users.

Get hands-on with 1200+ tech skills courses.