An educational project that compares several recommendation methods using the MovieLens latest-small dataset.
| Model | What it does | Status |
|---|---|---|
| Content-based | Finds movies with similar titles, genres, and tags | Complete |
| Item-item kNN | Recommends from similarities in user ratings | Complete |
| Matrix factorization | Learns user and movie embeddings to predict ratings | Experimental |
| BPR | Learns to rank watched movies above unseen movies | Complete |
| SASRec | Uses a user's ordered history to predict the next movie | Implemented |
These results come from the saved notebook runs. The models use different objectives, so their scores should not be compared directly.
| Model | Metric | Result |
|---|---|---|
| Global-mean baseline | Test RMSE | 1.044 |
| Item-item kNN | Test RMSE | 0.860 |
| Matrix factorization experiment | Test RMSE | 0.872 |
| BPR | Hit Rate@10 | 0.113 |
| BPR | NDCG@10 | 0.066 |
| BPR | MRR | 0.062 |
| SASRec | Best validation Hit@10 | 0.8185 |
| SASRec | Best validation NDCG@10 | 0.6065 |
The matrix-factorization notebook includes an SVD++-style implicit-history term, but its saved evaluation does not use that term. Treat its RMSE as an experimental result rather than a valid SVD++ benchmark.
content_based_rec.ipynb- content-based recommendationsknn_rec.ipynb- item-item collaborative filteringsimple_rec.ipynb- matrix factorization experimentBPR.ipynb- Bayesian Personalized Rankingsequential_recommendation/SASRec.ipynb- sequential recommendationsmovies.csv,ratings.csv,tags.csv,links.csv- MovieLens data
Create a virtual environment and install the main dependencies:
py -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install numpy pandas matplotlib scikit-learn jupyterlab ipykernelFor SASRec, also install PyTorch and RecBole:
python -m pip install torch recboleStart JupyterLab from the repository root:
python -m jupyter labThis repository uses MovieLens ml-latest-small:
- 100,836 ratings
- 9,742 movies
- 610 users
The dataset was created by the GroupLens Research Group. Review the MovieLens usage terms before redistributing the data or using it commercially.