A content-based movie recommender system that uses TF-IDF vectorization with custom weighting for numeric and text features (IMDB Rating, Meta Score, Genre, and Director). This project also includes a Streamlit-based frontend for a simple web interface.
- Project Overview
- Features and Weights
- Setup and Installation
- Dataset
- Running the Recommender (CLI)
- Running the Streamlit App
- Customization
This project demonstrates a content-based recommender system that reads a dataset of top 1000 IMDB movies, creates “weighted” textual features, and uses TF-IDF plus cosine similarity to find and recommend similar movies.
Core steps:
- Data Loading: Reads the CSV containing movie metadata (titles, genres, directors, ratings, metascores, etc.).
- Feature Weighting: Important numeric attributes (e.g., IMDB Rating, Meta Score) are converted to repeated tokens to give them heavier weight. Genre and Director are also repeated a certain number of times to reflect their relative importance.
- TF-IDF Vectorization: Transforms the weighted text into a numerical vector.
- Similarity: A cosine similarity matrix is computed for all movies.
- Recommendation: Given a movie title, the system retrieves the top 10 similar movies.
- IMDB Rating (0–10) → repeated token counts equal to the rating (e.g., rating=8 → “rating” repeated 8 times).
- Meta Score (0–100) → repeated token counts equal to (meta_score ÷ 10).
- Genre → repeated 3× to give moderate-high weight.
- Director → repeated 1× to give minimal weight.
These multipliers can be freely adjusted in code to emphasize or de-emphasize features.
- Clone or Download: Copy this repo to your local machine.
- Install Dependencies (ideally in a virtual environment):
pip install pandas scikit-learn streamlit kagglehub