This Movie Recommendation System is a web application that suggests movies based on user input. The system uses a content-based recommendation algorithm to recommend movies similar to those the user likes. The frontend is built using Streamlit, and the backend processes are powered by machine learning.
- Users can search for a movie and get a list of similar movies.
- Movie recommendations are based on features such as genre, plot, and user ratings.
- The system uses a content-based filtering approach.
- Built with a user-friendly interface using Streamlit.
- Data is processed with Pandas and Scikit-learn.
- Frontend: Streamlit for the user interface.
- Backend: Python-based Machine Learning model using
sklearn
. - Database: MongoDB (optional for storing user ratings or movie metadata).
- Model: Content-based recommendation using cosine similarity.
To run this project locally, ensure you have the following installed:
- Python 3.x
- Streamlit
- Pandas
- Scikit-learn
- MongoDB (Optional, if you are integrating with a database)
You can install the required libraries using the following command:
pip install -r requirements.txt
Example requirements.txt
file:
streamlit
scikit-learn
pandas
numpy
- Data Preprocessing: The movie dataset is preprocessed to extract relevant features such as title, genre, and plot.
- Model Training: The system uses cosine similarity to compute similarity between movies based on their features.
- Recommendation Engine: When a user inputs a movie, the system finds movies similar to the selected one by computing their cosine similarity score.
- Web Interface: The Streamlit interface allows the user to interact with the system easily.
First, clone this repository:
git clone https://github.com/yourusername/movie-recommendation-system.git
cd movie-recommendation-system
Once you have cloned the repository and installed the necessary dependencies, run the application using Streamlit:
streamlit run app.py
This will launch the web app locally, and you can access it at http://localhost:8501
.
├── app.py # Main Streamlit application
├── model.py # Contains the recommendation model logic
├── similarity.pkl # Precomputed similarity matrix
├── movies.csv # Dataset containing movie information
├── requirements.txt # Dependencies
└── README.md # Project Documentation
The dataset used in this project contains metadata of movies such as:
- Movie title
- Genre
- Plot description
- Ratings
This data can be fetched from popular datasets such as IMDb, TMDB, or MovieLens.
- Launch the Streamlit application.
- Enter the name of a movie you like in the search bar.
- The app will suggest a list of movies similar to the one you searched for.
- Collaborative Filtering: Integrating collaborative filtering to recommend movies based on user preferences and ratings.
- User Authentication: Adding login functionality for users to save their favorite movie recommendations.
- Improved UI: Enhance the UI/UX of the web application with more styling and interactive features.
Feel free to fork this repository and submit pull requests. For major changes, please open an issue to discuss the changes you wish to make.
This project is licensed under the MIT License.
+----------------------------------+
| User Selected Movie |
+----------------------------------+
|
v
+----------------------------+
| Feature Extraction |
| (Genres, Rating, Director, |
| Cast, Release Year) |
+----------------------------+
|
v
+--------------------------------------+
| Feature Representation |
| (Vectorization, TF-IDF, Embeddings) |
+--------------------------------------+
|
v
+-----------------------------+
| Similarity Calculation |
| (Cosine, Euclidean) |
+-----------------------------+
|
v
+--------------------------------------+
| Recommendation Engine |
| (Content-Based Filtering) |
+--------------------------------------+
|
v
+------------------------------+
| MongoDB Database |
| (Movie Data with Feature |
| Vectors) |
+------------------------------+
|
v
+--------------------------------------+
| Rank and Recommend |
+--------------------------------------+
|
v
+--------------------------------------+
| Recommended Movies Display |
+--------------------------------------+