This project is a Python-based movie recommender system that allows users to:
- Search for movies by title
- Rate movies by ID or name
- Get personalized movie recommendations based on:
- Genre (top-rated movies in a specific genre)
- User similarity (movies liked by users with similar taste)
It uses the MovieLens dataset (movies.csv and ratings.csv) and supports interaction through a simple text-based menu.
- Search any movie by title.
- Displays matching results with their average rating.
- Enter a movie ID or part of a movie title to find and rate it.
- If multiple matches exist, the program lists them so you can pick the correct one.
- Your rating updates the movie’s average rating.
Choose between:
genre→ Lists all available genres and recommends the top-rated movies in that genre.user→ Finds the most similar user and recommends movies they liked that you haven’t rated yet.
Each recommendation includes the movie title and average rating.
- Cleanly exits the program.
MovieDatabaseloads data frommovies.csvandratings.csv.- Builds dictionaries for:
movies→{movieId: Movie object}users→{userId: set of movieIds rated}genres→{genre_name: set of movieIds}
Each movie is stored as a Movie object with:
id,title,genres, and a list ofratings- Method
average_rating()to calculate its mean rating.
- GenreRecommender:
Suggests top 5 movies in a given genre based on average ratings. - UserSimilarityRecommender:
Finds the most similar user (based on overlapping rated movies) and recommends the top 5 new movies they’ve rated highly.
- Python 3.8 or later
- Pandas library
pip install pandas