Get startedGet started for free

Comparing individual movies with Jaccard similarity

In the last lesson, you built a DataFrame of movies, where each column represents a different genre. You can now use this DataFrame to compare movies by measuring the Jaccard similarity between rows. The higher the Jaccard similarity score, the more similar the two items are.

In this exercise, you will compare the movie GoldenEye with the movie Toy Story, and GoldenEye with SkyFall and compare the results.

The DataFrame movie_cross_table containing all the movies as rows and the genres as Boolean columns that you created in the last lesson has been loaded.

This exercise is part of the course

Building Recommendation Engines in Python

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Import numpy and the Jaccard similarity function
import numpy as np
from sklearn.metrics import ____
Edit and Run Code