Skip to content

Latest commit

 

History

History
36 lines (19 loc) · 1.65 KB

README.md

File metadata and controls

36 lines (19 loc) · 1.65 KB

KNN Recommender

By using MovieLens Datasets we build a recommender system based on KNN Item-Based Collaborative Filtering.

Enviroment Setup

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.

Migrate data into database

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>

Training data

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/)

Run the app

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