A small project built to practice pandas, SQL, and git by putting together a movie recommendation system on top of the MovieLens dataset.
- Load & explore —
checking_data.pyloads the raw MovieLens CSVs with pandas, checks for nulls/duplicates, and explores the data: highest-rated movies, most active users, genre distribution, and the correlation between release year and rating. - Build the database —
schema.pycreates a SQLite database withmovies,ratings,users, andtagstables, then loads the cleaned CSVs into it (extracting release year out of the movie title along the way, and pre-computing each user's rating count/average). - Recommend —
Main.pyis the actual recommender: it asks for a movie you liked, then queries the database for the recommendation logic below.
- You type in a movie title (partial matches work — typing "Toy Story" will catch all the sequels too).
- The script finds every user who rated that movie 4 stars or higher.
- It looks at what else those users rated 4+ stars.
- It returns the top 10 of those movies, ranked by average rating, as your recommendations.
In short: people who liked this also liked these.
Built on the MovieLens 100K dataset from GroupLens Research — about 100,000 ratings across thousands of movies. The raw CSVs and the generated SQLite database aren't included in this repo (see .gitignore); download the dataset yourself to run it.
- Download the MovieLens 100K dataset and place
movies.csv,ratings.csv, andtags.csvsomewhere accessible. - Update the file paths in
schema.py(andchecking_data.py, if you want the EDA too) to point to your dataset and where you want the SQLite database created — they're currently hardcoded to a local path. - Run the schema script once to build the database:
python scripts/schema.py
- Get recommendations:
python scripts/Main.py
What movie did you enjoy recently: Toy Story Movies matching your search: Toy Story (1995) Toy Story 2 (1999) ... Because you enjoyed these, you might also like: ...
- Parameterize file paths (config file or CLI args) instead of hardcoded paths
- Move the recommendation query into a proper
.sqlfile rather than an f-string - Weight recommendations by number of ratings, not just average rating, to avoid niche movies with one 5-star rating outranking genuinely popular ones