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 ...

Get Scala Machine Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.