A sophisticated content-based movie recommendation system that helps you discover your next favorite film based on your viewing preferences.
Features • Demo • Installation • Usage • Tech Stack
This Movie Recommender System leverages machine learning algorithms to provide personalized movie recommendations. By analyzing movie similarities based on various features, the system suggests five movies that closely match your selected film's characteristics.
- 🎯 Intelligent Recommendations: Get 5 highly relevant movie suggestions based on content similarity
- 🖼️ Visual Interface: Browse recommendations with movie posters fetched from TMDB API
- ⚡ Fast Performance: Pre-computed similarity matrix ensures instant recommendations
- 🎨 User-Friendly UI: Built with Streamlit for an intuitive and responsive experience
- 📊 Large Movie Database: Access to thousands of movies for diverse recommendations
The application presents a clean interface where users can:
- Select a movie they recently watched from the dropdown
- Click the "Recommend" button
- Instantly view 5 similar movies with their posters
- Python 3.8 or higher
- pip package manager
-
Clone the repository
git clone <repository-url> cd "Movie Recommender"
-
Install required dependencies
pip install -r requirements.txt
-
Ensure data files are present
Make sure the following pickle files are in the project directory:
movies.pkl- Contains movie datasetsimilarity.pkl- Pre-computed similarity matrix
-
Run the application
streamlit run app.py
-
Access the application
Open your browser and navigate to
http://localhost:8501
- Launch the application using the command above
- Select a movie from the dropdown menu that you've recently watched
- Click the "Recommend" button
- Browse through the 5 recommended movies displayed with their posters
- Explore new recommendations by selecting different movies
| Technology | Purpose |
|---|---|
| Python | Core programming language |
| Streamlit | Web framework for the UI |
| Pandas | Data manipulation and analysis |
| Scikit-learn | Machine learning algorithms (similarity computation) |
| Pickle | Model and data serialization |
| TMDB API | Fetching movie posters and metadata |
| Requests | HTTP library for API calls |
Movie Recommender/
│
├── app.py # Main application file
├── movies.pkl # Serialized movie dataset
├── similarity.pkl # Pre-computed similarity matrix
├── requirements.txt # Python dependencies
├── Procfile # Deployment configuration
├── setup.sh # Setup script for deployment
└── README.md # Project documentation
The recommendation system uses content-based filtering approach:
- Feature Extraction: Movies are represented by their features (genre, cast, director, keywords, etc.)
- Similarity Computation: Cosine similarity is calculated between all movies
- Recommendation Generation: When a user selects a movie, the system finds the 5 most similar movies based on pre-computed similarity scores
- Visual Presentation: Movie posters are fetched from TMDB API for enhanced user experience
User Selection → Find Movie Index → Retrieve Similarity Scores
→ Sort by Similarity → Select Top 5 → Fetch Posters → Display Results
This application is deployment-ready with included configuration files:
- Procfile: For Heroku deployment
- setup.sh: Environment setup script
heroku login
heroku create your-app-name
git push heroku mainThe application uses TMDB (The Movie Database) API for fetching movie posters. The API key is currently hardcoded in the application. For production use:
- Register at TMDB
- Get your API key
- Replace the API key in
app.pyor use environment variables
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a new branch (
git checkout -b feature/improvement) - Make your changes
- Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/improvement) - Create a Pull Request
- Add user ratings and collaborative filtering
- Implement advanced filtering (by genre, year, rating)
- Add movie trailers and detailed information
- Create user accounts and watchlists
- Implement hybrid recommendation approach
- Add movie search functionality
- Mobile-responsive design improvements
This project is licensed under the MIT License - see the LICENSE file for details.
- TMDB for providing the movie database API
- Streamlit for the amazing web framework
- The open-source community for inspiration and tools
For questions, suggestions, or collaboration opportunities, feel free to reach out!
⭐ Star this repository if you find it helpful!
Made with ❤️ and Python