Non-Deep Learning Collaborative Filtering Techniques for Implicit Feedback Data in Music Recommender Systems
Note: this work and theory have been extended in the work / repository: Application of Graph Neural Networks to Music Recommender Systems
This repository contains code and resources for the research seminar titled "Non-Deep Learning Collaborative Filtering Techniques for Implicit Feedback Data in Music Recommender Systems." The focus of this seminar is on applying user-based and item-based neighborhood techniques, as well as matrix factorization using alternating least squares (ALS) optimization, to a real-life dataset with binary feedback. By implementing and evaluating these classical collaborative filtering methods, this work aims to establish a baseline for future research in music recommender systems, facilitating the development and comparison of more advanced techniques.
- # of customers: 58.747
- # of records: 37.370
| # | file name | # rows, (users, items) | sparsity | features |
|---|---|---|---|---|
| 1 | user_item_interaction_RAW_ANONYMIZED.txt |
23.545.542, (70.309, 37.408) | 0.68 % | userID, itemID |
| 2 | user_item_interaction_FILTERED_ANONYMIZED.txt |
17.665.904, ( 58.747, 37.370 ) | 0.8 % | userID, itemID |
After the hyperparameter search, the best 3 settings for each algorithm were applied to the entire filtered dataset. A Top-10 recommendation was made for a random set of 100 users. This process was repeated 5 times for each algorithm and each parameter setting, and the mean of the best 5 runs is reported in the following table in descending order by the NDCG. The best values are printed in bold and the second largest are underlined:
| Algorithm | Pre | MRR | nDCG | MAP | IC | ARP | APLT |
|---|---|---|---|---|---|---|---|
| ALS-MF | 0.116 | 0.3587 | 0.4040 | 0.2643 | 0.01663 | 5179 | 0.00 |
| UserkNN | 0.111 | 0.3288 | 0.3934 | 0.2544 | 0.01540 | 5831 | 0.002 |
| UserAsymkNN | 0.0980 | 0.2849 | 0.3295 | 0.2105 | 0.01616 | 5300 | 0.016 |
| ItemAsymkNN | 0.0642 | 0.2374 | 0.2838 | 0.2035 | 0.005823 | 9836 | 0.0104 |
| MostPop | 0,0118 | 0.04305 | 0.05797 | 0.04223 | 0.001054 | 12478 | 0.00 |
data: contains the data used for the recommendation algorithmsevaluation: contains the evaluation files and parameter settingsprocessed: contains the filtered datasetraw: contains the raw un-filtered dataset
notebooks:DataObservation.ipynb: initial observation of the raw datasetEvaluation.ipynb: evaluates the best parameter settingsEvaluationParameterSearch.ipynb: evaluates the parameter searchParameterSearchItem.ipynb: the parameter search logic for the item-based algorithmsParameterSearchMF.ipynb: the parameter search logic for the alternativ least squares algorithmParameterSearchUser.ipynb: the parameter search logic for the user-based algorithms
src: Enthält Entwicklungscode zum Backend inkl. separaterREADME.mdmit ErläuterungenHelper.py: contains often used functionsMetrics.py: contains the entire metric and evluation logicMfAlgorithms.py: contains the matrix factorization recommenderNeighborhoodAlgorithms.py: contains the neighborhood-based recommenderNonPersonalizedAlgorithms.py: contains the non-personalized recommender
CONDA_Requirements.txt: contains all installed libraries generated viaconda list -e CONDA_Requirements.txtPIP_Requirements.txt: contains all installed libraries generated viapip3 freeze > PIP_Requirements.txtSeminar_Paper.pdf: the corresponding paper "Non-Deep Learning Collaborative Filtering Techniques for Implicit Feedback Data in Music Recommender Systems"
The dataset can be found in the Google Drive. Store the containing files as follows:
user_item_interaction_RAW_ANONYMIZED.txt->data/rawuser_item_interaction_FILTERED_ANONYMIZED.txt->data/processed
Create virtual environment with predefined libraries:
conda create --name <env> --file requirements.txt
-
Use python version between 3.8 and 3.9 (3.9.19 used and recommended)
-
Create virtual environment in project directory (
ResearchSeminarMusicRecommender2024):python3 -m venv .venv -
Activate virtual environment:
-
on Mac / Linux:
source .venv/bin/activate -
on Windows:
.venv\Scripts\activate
-
Upgrade pip
pip3 install --upgrade pip -
Install Packages
pip install -r PIP_Requirements.txt
Open the terminal, activate the environment, and run:
pip list --format=freeze > requirements.txt