This project implements a content-based recommendation system that suggests movies based on user preferences and movie genres using IMDB dataset.
A content-based recommender system suggests items to users based on the features of the items and the preferences shown by the user. Unlike collaborative filtering (which relies on user interactions and similarity between users), content-based systems use only item features and the user’s own history to make recommendations.
- Does not require data from other users
- Works well with sparse data
- More interpretable, as recommendations are based on specific item attributes
The goal of this project is to build a recommendation engine that suggests movies based solely on their genres and the movies a user has rated. We use the IMDB dataset, including movies.csv
and ratings.csv
.
-
Data Loading
- Load
movies.csv
andratings.csv
into pandas DataFrames
- Load
-
Data Preprocessing
- Extract the year from movie titles
- Drop the
timestamp
column - Split genres into lists and apply one-hot encoding
-
User Input
- Simulate user ratings by creating a list of favorite movies and scores
-
User Profile Generation
- Build a genre-based profile of the user using their ratings
-
Recommendation Scoring
- Score all movies by comparing their genres to the user's profile
-
Output Recommendations
- Display the top 20 recommended movies
movies.csv
— containsmovieId
,title
,genres
ratings.csv
— containsuserId
,movieId
,rating
,timestamp
This project uses the following Python libraries:
pandas
numpy
matplotlib
- Open the
.ipynb
notebook in Google Colab or Jupyter Notebook - Run the cells in order
- Provide user input (movie titles and ratings) when prompted
- View the recommended movie list at the end
If a user rates these movies:
- "Toy Story" ⭐⭐⭐⭐⭐
- "Jumanji" ⭐⭐⭐⭐
- "Pulp Fiction" ⭐⭐⭐⭐
The system might recommend:
- "Aladdin" (Similarity: 92%)
- "The Lion King" (Similarity: 89%)
- "Reservoir Dogs" (Similarity: 85%)
Recommendations are based on genre similarity to rated movies
Have an idea to improve the system? Want to add features like:
- 🎭 Actor/Director analysis
- 📝 Plot summaries (NLP processing)
- 💬 User reviews integration
- 🎞️ Movie poster visualization