This project is a content-based movie recommendation system that intelligently suggests movies based on:
- 🎭 Genre similarity
- ⭐ Movie ratings
- ⚖️ Weighted ranking (similarity + quality)
Unlike naive keyword-based recommenders, this system:
- Ignores misleading title similarity
- Scales safely without building massive similarity matrices
It offers two powerful recommendation modes through a modern web UI.
- Input any movie from the dataset
- Finds genre-similar movies
- Ranks them using a weighted score
- Handles typos with fuzzy matching suggestions
- Select one or multiple genres
- Uses AND-logic (all selected genres must match)
- Returns top-rated movies
- Random sampling ensures non-repetitive results
- Single TF-IDF model trained on genres
- On-demand similarity computation (memory-safe)
- Weighted ranking:
- weighted_score = (α × similarity) + (β × normalized_rating)
- ✨ Glassmorphic design
- 🎞️ IMDb quick-links
- 📝 Hoverable movie overviews
- 🔄 Smooth animations & transitions
- 📱 Fully responsive layout
┌────────────┐ │ Frontend │ ← Glassmorphic HTML UI └─────┬──────┘ │ HTTP (JSON) ┌─────▼──────┐ │ Flask API │ ← app.py └─────┬──────┘ │ Python Import ┌─────▼──────┐ │ ML Model │ ← model.py (TF-IDF + Logic) └─────┬──────┘ │ | ┌─────▼──────┐ │ Dataset │ ← CSV └────────────┘
✔ Clean separation of concerns
✔ One model, multiple recommendation paths
- Genres are normalized:
Science Fiction → Sci-Fi
- Converted to vectors using TF-IDF
- Computed using cosine similarity
- Implemented via
linear_kernel(efficient on sparse matrices)
Instead of ranking only by similarity:
- weighted_score = (0.7 × genre_similarity) + (0.3 × normalized_rating)
This ensures:
- Highly similar movies are preferred
- Poorly rated movies don’t dominate results
The notebook includes meaningful, explainable plots:
- ⭐ Rating distribution (justifies mean imputation)
- 🎭 Genre frequency analysis
- 📊 Recommendation ranking (weighted score)
- ⚖️ Similarity vs Rating trade-off plots
These plots prove the model works — not just that it runs.
- POST /recommend/movie
{
"movie_name": "The Avengers"
}- Recommend by Genre
{
"genres": ["Sci-Fi", "Thriller"]
}| Layer | Technology |
|---|---|
| ML Model | TF-IDF, Cosine Similarity |
| Backend | Flask |
| Frontend | HTML, CSS, JavaScript |
| Utilities | Pandas, NumPy, RapidFuzz |
git clone https://github.com/SACHIN-S-2004/Movie-Recommendation-System.gitcd Movie-Recommendation-Systempip install -r requirements.txtpython app.pyOpen in browser:
http://127.0.0.1:5000



