Section 3. Chapter 3
single
Challenge: Building a User-Based Collaborative Filtering Component
Swipe to show menu
Task
Swipe to start coding
Build a function that recommends products to a user by finding similar users using cosine similarity. This challenge builds on your understanding of user-item matrices and behavioral similarity.
- Compute the cosine similarity between the target user and all other users in the
user_item_matrix. - Identify the user with the highest similarity to the target user.
- Recommend up to
top_nproducts that the most similar user has interacted with, but the target user has not.
Solution
Everything was clear?
Thanks for your feedback!
Section 3. Chapter 3
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat