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.
Cet exercice fait partie du cours
Building Recommendation Engines in Python
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Import numpy and the Jaccard similarity function
import numpy as np
from sklearn.metrics import ____