Skip to content

Repository files navigation

🎬 Movie Recommendation System

A machine learning project that recommends movies using two approaches — content-based filtering and collaborative filtering — built on the MovieLens dataset.


📁 Project Structure

movie-recommendation-system/

├── data/ # MovieLens dataset (not pushed to GitHub)

├── src/

│ ├── content_model.py # TF-IDF + cosine similarity

│ ├── collab_model.py # SVD collaborative filtering │ └── evaluate.py # RMSE, MAE metrics

├── notebooks/

│ └── exploration.ipynb # EDA and model exploration

├── app.py # Streamlit web app

├── requirements.txt # Dependencies

└── README.md


📊 Dataset

  • Source: MovieLens Small
  • 610 users · 9,724 movies · 100,836 ratings
  • Rating scale: 0.5 – 5.0
  • Matrix density: 1.70% (highly sparse)
  • Movies with sufficient ratings (≥10): 2,269

⚠️ Data Setup

Download MovieLens Small from https://grouplens.org/datasets/movielens/latest/ and place the CSVs in data/ml-latest-small/


🔧 Setup

git clone https://github.com/dearnitya/Movie-recommendation-System
cd Movie-recommendation-System
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
streamlit run app.py

🤖 Models

Content-Based Filtering

  • TF-IDF vectorisation on genres + user tags
  • Cosine similarity matrix across 9,724 movies
  • Example: "Toy Story" → A Bug's Life (0.86), Toy Story 2 (0.64), Monsters Inc (0.36)

Collaborative Filtering (SVD)

  • User-item matrix: 610 users × 2,269 movies
  • SVD matrix factorisation (k=50 latent factors)
  • Predicts ratings for unseen movies per user
  • Example: User 1 → Stand by Me (3.22), Die Hard (3.18), Shawshank Redemption (2.94)

📈 Results

Metric Score Notes
RMSE 2.9045 On 20% held-out test set (16,224 ratings)
MAE 2.7054 On 20% held-out test set

High RMSE is expected with basic SVD on a sparse matrix (1.7% density). Production systems improve this with hyperparameter tuning, implicit feedback, and hybrid approaches. This project demonstrates the full pipeline rather than optimising a single metric.


📊 Exploratory Analysis

EDA Overview

Key findings:

  • Ratings skew positive (avg 3.50) due to selection bias
  • Most users rate fewer than 100 movies (power user effect)
  • Most movies have very few ratings — filtered to 2,269 with ≥10
  • Drama and Comedy are the dominant genres

🛠 Tech Stack

Python · pandas · NumPy · scikit-learn · SciPy · matplotlib · Streamlit


👩‍💻 Author

Nityasree Iyer · B.Tech CSE (Data Science) · JAIN University

About

Movie recommendation system using content-based and collaborative filtering on the MovieLens dataset. Built with Python, scikit-learn, and pandas.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages