March 2019
Beginner to intermediate
464 pages
10h 57m
English
In this section, we are going to explore two approaches to building a product recommender engine—user-based versus item-based. In the user-based approach, we compute similarities between users based on their item purchase history. In the item-based approach, on the other hand, we compute similarities between items based on which items are often bought together with which other items.
To measure the similarity between users or between items, we are going to use the cosine_similarity method in the scikit-learn package. You can import this function using the following code:
from sklearn.metrics.pairwise import cosine_similarity
This cosine_similarity function in the sklearn package computes the pair-wise cosine similarities ...
Read now
Unlock full access