GitHub repo for recommender system using DGL

Our code for building a recommender system using DGL was published on GitHub: GNN-RecSys. It might be useful for others that are tackling the recommendation task.

Some specificities that might be interesting:

  • Our graph was heterogeneous, with 3 node types and 5 edge types
  • Our nodes had initial features
  • We used a message passing paradigm similar to GraphSAGE
  • We used pytorch as backend, with custom hyperparameter tuning
  • We used max-margin loss with negative sampling, predicting future interactions with previous interactions

Thanks to DGL for the library, hoping this repository can help other users!


This is awesome!

I took a look in the repository. From what I understand, it offers a recommender systems model with GraphSAGE-like encoder with various aggregation choices. Correct?

Also, how should the data look like in order to use it?

Thanks :slight_smile:

Correct! There are various aggregation choices, as well as numerous other hyperparameters that can be tried out, e.g. data sampling, negative sampling, number of layers, embedding dimensions, max-margin delta.

I added information about the data needed directly in the repo, thanks for the question. Simply put, the data should be adjacency lists between nodes (e.g. between users & items) and, if wished, node features (e.g. item characteristics).

I added your repository link in [Example] Add a list of third party examples by BarclayII · Pull Request #2896 · dmlc/dgl · GitHub. Thanks for sharing your effort!

1 Like

Awesome, my pleasure!


We are currently working on a music recommendation project using the million song dataset where the data is of the format:

Along with this we have user and song embedding with appropriate information. We tried to use your code for our case but however a lot of the code seems to be hard coded for the columns in your data set. Am I missing something? Can you help us out please? Thanks