By using MovieLens Datasets we build a recommender system based on KNN Item-Based Collaborative Filtering.
Use poetry to set up the Python environment (Python >= 3.9)
Get the full data set from MovieLens Datasets and put the movies.csv
and ratings.csv
in this repo.
Using the Django admin custom management CLI commands:
- python manage.py load_movies --path <path_to_movies.csv>
- python manage.py load_ratings --path <path_to_ratings.csv>
Using the Django admin custom management CLI commands:
- python manage.py prep_data --path <path_to_static_folder>
Train and produce the hashmap.p
, movie_user_mat_sparse.p
for deployment. Put in the path you want them to be stored. (e.g. recommender/static/model/)
Start the server:
- python manage.py runserver
App runs in url: http://127.0.0.1:8000/recommender/
Credit to Kevin Laio (KevinLiao159) for original code and blog post