O'Reilly logo

Scala Machine Learning Projects by Md. Rezaul Karim

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

Step 3 - Computing similarity

Using item-based collaborative filtering, we can compute how similar two movies are to each other. We follow these steps:

  1. For every pair of movies (A, B), we find all the users who rated both A and B
  2. Now, using the preceding ratings, we compute a Movie A vector, say X, and a Movie B vector, say Y
  3. Then we calculate the correlation between X and Y
  4. If a user watches movie C, we can then recommend the most correlated movies with it

We then compute the various vector metrics for each ratings vector X and Y, such as size, dot product, norm, and so on. We will use these metrics to compute the various similarity metrics between pairs of movies, that is, (A, B). For each movie pair (A, B), we then compute several measures ...

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