Skip to content

Latest commit

ย 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฌ Movie Recommendation Systems

๐Ÿ“ Description

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.

โœจ Features:

  • ๐Ÿ”— 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.

Planned Features

Here are the planned features to expand the functionality of this project:

  1. ๐Ÿงฎ Advanced Matrix Factorization:

    • Incorporate methods such as Bayesian Matrix Factorization and Probabilistic Matrix Factorization for better handling of sparse datasets.
  2. ๐Ÿš€ Neural Network Models:

    • Implement deep learning approaches like Autoencoders and Residual Learning for enhanced recommendation quality.
  3. ๐Ÿ”— Restricted Boltzmann Machines (RBMs):

    • Include RBM-based collaborative filtering for better latent representation of user-item interactions.
  4. โšก Scalable Implementations with Spark:

    • Optimize matrix factorization algorithms for distributed environments using Apache Spark.
  5. ๐Ÿ“Š Bayesian Approaches:

    • Extend the system with Bayesian sampling and ranking techniques to improve ranking accuracy for recommendations.
  6. ๐Ÿ“š Hybrid Recommendation System:

    • Combine collaborative filtering with content-based methods to create a robust hybrid recommendation model.
  7. ๐ŸŒ Cloud-Based Deployment:

    • Set up recommendation pipelines in AWS or other cloud environments for real-world scalability.
  8. ๐Ÿ“ˆ Real-World Applications:

    • Expand the project to make predictions for real-world datasets and evaluate system performance on unseen, live data.

Let me know if youโ€™d like further elaboration on any of these planned features! ๐Ÿš€

๐Ÿ“Š Results

Performance Metrics:

  • User-Based Collaborative Filtering:

    • ๐ŸŸข Train MSE: 0.5571904374226911
    • ๐ŸŸข Test MSE: 0.6216365099123221
  • Item-Based Collaborative Filtering:

    • ๐ŸŸข Train MSE: 0.4709482615323109
    • ๐ŸŸข Test MSE: 0.5650172300648622

๐Ÿ› ๏ธ Installation

Dependencies

The project uses Python 3.7+ and the following libraries:

  • numpy
  • pandas
  • sortedcontainers
  • pickle

Install them using:

pip install -r requirements.txt

๐Ÿš€ Usage

0. Dataset

The project uses the MovieLens 32M dataset. Download the dataset and place it in the big_data directory.

1. Preprocess the Dataset

Prepare the MovieLens dataset or your own data:

python run_preprocessing.py

This script runs three scripts:

Script 1:

  • Cleans the dataset.
  • Remaps userId and movieId to 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.

2. Train Collaborative Filtering Models

  • User-Based Collaborative Filtering:
    python user_user.py
  • Item-Based Collaborative Filtering:
    python item_item.py

3. Generate Recommendations

This is under development. Currently, the recommend.py script can be modified to generate recommendations for users.


๐Ÿ“‚ Project Structure

โ”œโ”€โ”€ 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

About

This project implements various movie recommendation systems!๐ŸŽฌ

Resources

Stars

0 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages