This project implements various Movie Recommendation Systems. Currently, it supports user-based collaborative filtering and item-based collaborative filtering to recommend movies based on user preferences and historical data.
- ๐ User-Based Collaborative Filtering: Recommends movies based on similarities between users.
- ๐ฅ Item-Based Collaborative Filtering: Recommends movies based on similarities between movies.
- ๐ ๏ธ Customizable Dataset: Easily add your own ratings to test the system.
- ๐ Scalable: Works seamlessly with large datasets like MovieLens 32M.
Here are the planned features to expand the functionality of this project:
-
๐งฎ Advanced Matrix Factorization:
- Incorporate methods such as Bayesian Matrix Factorization and Probabilistic Matrix Factorization for better handling of sparse datasets.
-
๐ Neural Network Models:
- Implement deep learning approaches like Autoencoders and Residual Learning for enhanced recommendation quality.
-
๐ Restricted Boltzmann Machines (RBMs):
- Include RBM-based collaborative filtering for better latent representation of user-item interactions.
-
โก Scalable Implementations with Spark:
- Optimize matrix factorization algorithms for distributed environments using Apache Spark.
-
๐ Bayesian Approaches:
- Extend the system with Bayesian sampling and ranking techniques to improve ranking accuracy for recommendations.
-
๐ Hybrid Recommendation System:
- Combine collaborative filtering with content-based methods to create a robust hybrid recommendation model.
-
๐ Cloud-Based Deployment:
- Set up recommendation pipelines in AWS or other cloud environments for real-world scalability.
-
๐ Real-World Applications:
- Expand the project to make predictions for real-world datasets and evaluate system performance on unseen, live data.
-
User-Based Collaborative Filtering:
- ๐ข Train MSE:
0.5571904374226911 - ๐ข Test MSE:
0.6216365099123221
- ๐ข Train MSE:
-
Item-Based Collaborative Filtering:
- ๐ข Train MSE:
0.4709482615323109 - ๐ข Test MSE:
0.5650172300648622
- ๐ข Train MSE:
The project uses Python 3.7+ and the following libraries:
numpypandassortedcontainerspickle
Install them using:
pip install -r requirements.txtThe project uses the MovieLens 32M dataset. Download the dataset and place it in the big_data directory.
Prepare the MovieLens dataset or your own data:
python run_preprocessing.pyThis script runs three scripts:
Script 1:
- Cleans the dataset.
- Remaps
userIdandmovieIdto contiguous indices. - Saves the processed dataset as
ratings_preprocessed.csv.
Script 2:
- Shrinks the dataset to focus on the most active users and movies.
Script 3:
- Creates dictionaries for user-to-movie, movie-to-user, and user-movie ratings.
- User-Based Collaborative Filtering:
python user_user.py
- Item-Based Collaborative Filtering:
python item_item.py
This is under development. Currently, the recommend.py script can be modified to generate recommendations for users.
โโโ big_data/ # Directory for storing data
โ โโโ ratings.csv # Original dataset
โ โโโ ratings_preprocessed.csv # Preprocessed dataset
โ โโโ ratings_shrunk.csv # Reduced dataset
โ โโโ user2movie.pkl # User-to-movie mapping
โ โโโ movie2user.pkl # Movie-to-user mapping
โ โโโ usermovie2rating.pkl # Train ratings dictionary
โ โโโ usermovie2rating_test.pkl # Test ratings dictionary
โ โโโ [model results]
โโโ preprocess.py # Data preprocessing
โโโ shrink.py # Dataset shrinking
โโโ user_based_cf.py # User-based collaborative filtering
โโโ item_based_cf.py # Item-based collaborative filtering
โโโ predictor.py # Functions for recommendations
โโโ requirements.txt # Dependency list
โโโ README.md # Documentation