Movie-Recommender

Nishant Dahal

Data Scientist
ML Engineer
AI Model Developer
Jupyter
PyTorch
scikit-learn

Movie-Recommender

This project implements a movie recommender system using TMDB movie data and includes an exploratory data analysis (EDA) of the dataset.

Dataset

The movie data used for this project was downloaded from the TMDB Movie Metadata dataset on Kaggle.

Deployed Model

This project also includes a deployed model on Hugging Face: Movie Recommender

Getting Started

This recommender system uses Python libraries. To run the application locally, you'll need to set up a virtual environment. Here are the instructions for creating a virtual environment:

Using pip

Open your terminal or command prompt.
Install venv if you haven't already: python -m ensurepip install venv
Create a virtual environment named movie_rec_env: python -m venv movie_rec_env
Activate the virtual environment:

Using conda

Open your terminal or command prompt.
Create a virtual environment named movie_rec_env: conda create -n movie_rec_env python=3.x (Replace 3.x with your desired Python version)
Activate the virtual environment: conda activate movie_rec_env

Installing Dependencies

Once your virtual environment is activated, navigate to the project directory in your terminal.
Install the required libraries listed in requirements.txt: pip install -r requirements.txt

Running the Application

After installing the dependencies, run the application using: streamlit run app.py
This will start the movie recommender system. You'll be able to interact with the application to receive movie recommendations based on your preferences.

Project Structure

app.py: The main application file containing the Streamlit code for the movie recommender system.
train.ipynb: Jupyter notebook containing the code for training the recommendation model.
mini-projecteda.ipynb: Jupyter notebook containing the exploratory data analysis (EDA) of the TMDB movie dataset.
movies.pkl: Pickle file containing the movies data.
similarity.pkl: Pickle file containing the similarity matrix.
requirements.txt: A file listing the required Python libraries.

How It Works

Loading Data: The application loads movie data and a similarity matrix from precomputed pickle files.
User Input: Users can select a movie from a dropdown menu.
Recommendations: Upon clicking the 'Recommend' button, the system fetches and displays the top 5 movie recommendations along with their posters using the TMDB API.

Training the Model

The training process is detailed in the train.ipynb Jupyter notebook. Below is a summary of the steps involved:
Data Loading: The TMDB movie and credits data are loaded and merged on the 'title' column.
Data Cleaning:
Data Preparation:
Feature Engineering:
Vectorization: Using CountVectorizer to convert text data into numerical data (vectors) with a maximum of 5000 features and removing English stop words.
Similarity Calculation: Computing cosine similarity between movie vectors to measure similarity.
Recommendation Function: Creating a function to recommend movies based on cosine similarity.
Model Saving: Saving the processed movie data and similarity matrix using pickle.

Running the Training Notebook

Ensure you have Jupyter Notebook installed and your virtual environment activated.
Open the train.ipynb file in Jupyter Notebook.
Run the notebook cells to train the model and save the outputs.

Exploratory Data Analysis (EDA)

The EDA process is detailed in the mini-projecteda.ipynb Jupyter notebook. Below is a summary of the steps involved:
Data Loading: The TMDB movie and credits data are loaded into Pandas DataFrames.
Data Examination:
Data Cleaning:
Feature Engineering:
Data Visualization:
Insights:

Running the EDA Notebook

Ensure you have Jupyter Notebook installed and your virtual environment activated.
Open the mini-projecteda.ipynb file in Jupyter Notebook.
Run the notebook cells to perform the exploratory data analysis and visualize the insights.

API Key

Make sure to replace the placeholder api_key in app.py with your actual TMDB API key.
Enjoy your movie recommendations and data exploration!

Conversation

Contributor
Updated ReadMe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Partner With Nishant
View Services

More Projects by Nishant