Collaborative filtering is a method used by recommender systems based on the idea that your preferences / ratings / behaviour can be predicted from actions of people similar to you.
( 1, 4 ) ( 2, 3 )
This demo intends to demonstrate the basic principle of Collaborative-Based Recommender Systems.
The movieLens data is in the format:
user_id movie_id rating unix_timestamp
0 196 242 3 881250949
1 186 302 3 891717742
2 22 377 1 878887116
...
- Transform the data into user-item utility matrix
- Compute sparcity of the user-item matrix
- Compute similarity matrix for every user pair
- Cross-validation: Split the data into training and test data
- Compute similarity for every user pair (we use cosine similarity algorithm)
- Compute missing entries in the user-item utility matrix using all user's ratings
- Compute missing entries in the user-item utility matrix using all the most similar users' ratings
pandas, numpy, sklearn
RECOMMENDATION SYSTEMS: SIMPLE THEORY OF COLLABORATIVE FILTERING