This project implements a Graph Neural Network (GNN) for the task of recommendations, specifically focusing on the MAGNN (Metapath Aggregated Graph Neural Network) architecture. The model is applied to the LastFM dataset for music recommendations using a link prediction task. Use it as a tutorial for understanding how to use GNNs for RecSys problems.
You would need Python 3.6 or later and some libraries to work with this repo:
- PyTorch
- Torch Geometric
- Matplotlib
- NetworkX
- NumPy
- Pandas
- Requests
- tqdm
- scikit-learn
Install the required packages using:
pip install -r requirements.txt
Clone the repository:
git clone https://github.com/Zener085/music-recommendation-system-tutorial.git
cd music-recommendation-system-tutorial
Run the Jupyter notebook containing the code. You also can use online version of the notebook using colab.
The LastFM dataset is used for training and evaluation. It can be obtained from the LastFM PyTorch Geometric dataset. Additionally, features extracted from the dataset are utilized to enhance model accuracy.
The MAGNN architecture is employed for this recommendation task. The model comprises three major components: node content transformation, intra-metapath aggregation, and inter-metapath aggregation. The workflow involves metapath-based attention mechanisms to capture structural and semantic information from the heterogeneous graph.
Contributions are welcome! If you find any issues or have suggestions, please open an issue or create a pull request.