https://github.com/thatsabhishek/movie_recommendation_system_using_machine_learning_with_python
https://github.com/thatsabhishek/movie_recommendation_system_using_machine_learning_with_python
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/thatsabhishek/movie_recommendation_system_using_machine_learning_with_python
- Owner: thatsabhishek
- Created: 2023-07-25T16:33:24.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-10T03:10:58.000Z (over 1 year ago)
- Last Synced: 2025-01-14T15:28:51.735Z (5 months ago)
- Language: Jupyter Notebook
- Size: 6.07 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Movie Recommendation System using Machine Learning with Python
## Overview
This project implements a movie recommendation system using machine learning techniques in Python. The system recommends movies based on their similarity to a user's favorite movie. The code utilizes the scikit-learn library for text vectorization and cosine similarity calculations.## Code Structure
The code is organized into the following sections:1. **Data Loading:**
- The movie data is loaded from a CSV file (`movies.csv`) using pandas.
- The first 5 rows of the dataset and its dimensions are printed for initial exploration.2. **Feature Selection:**
- Relevant features for recommendation, including 'genres', 'keywords', 'tagline', 'cast', and 'director', are selected.
- Null values in these features are replaced with empty strings.3. **Text Vectorization:**
- The selected features are combined into a single text feature.
- TF-IDF vectorization is applied to convert the text data into feature vectors.4. **Cosine Similarity:**
- Cosine similarity scores between movies are calculated based on their feature vectors.5. **User Input:**
- The user is prompted to input their favorite movie.6. **Movie Recommendation:**
- A list of movie titles from the dataset is created.
- Using difflib, the closest match to the user's input is found.
- The index of the matched movie is used to retrieve similarity scores with other movies.
- The movies are sorted based on their similarity scores, and the top suggestions are presented to the user.## How to Use
1. **Clone the Repository:**
```
git clone https://github.com/your-username/Movie_Recommendation_System_using_Machine_Learning_with_Python.git
cd Movie_Recommendation_System_using_Machine_Learning_with_Python
```2. **Install Dependencies:**
```
pip install pandas numpy scikit-learn
```3. **Run the Code:**
- Ensure that the `movies.csv` file is present in the same directory.
```
python movie_recommendation_system.py
```4. **Enter Favorite Movie:**
- Follow the prompts to enter the name of your favorite movie.5. **Review Recommendations:**
- The code will display a list of movie recommendations based on the input.