Machine learning
Memgraph has been a popular choice in the AI world for a while now, especially for the use cases around machine learning (ML). The MAGE library aims to provide the most commonly used graph algorithms, and that includes graph ML algorithms as well.
Node embeddings
Supervised machine learning is a subset of ML where algorithms try to learn from data. Modeling the interactions between entities as graphs has enabled researchers to understand the various networks systematically. For the computer to understand these networks, embedding a large graph in low dimensional space is necessary, creating node embeddings. It has been demonstrated that graph embedding is superior to alternatives in many supervised learning tasks, such as node classification and link prediction, which are usually used for friendship or content recommendations and advertisement.
Algorithms
Here are the MAGE algorithms which create node embeddings:
- node2vec: An algorithm for calculating node embeddings on a static graph.
- node2vec_online: An algorithm for calculating node embeddings on a dynamic graph.
Resources
In case you'd like to learn more about the topic and see practical examples, check out the following resources:
- Introduction to Node Embedding (opens in a new tab): A blog post covering the basics of node embeddings.
- How Node2Vec Works – A Random Walk-Based Node Embedding Method (opens in a new tab): A blog post from which you can learn all about the node2vec algorithm.
- Understanding How Dynamic node2vec Works on Streaming Data (opens in a new tab): A blog post from which you can learn all about the dynamic node2vec algorithm.
- Link Prediction With node2vec in Physics Collaboration Network (opens in a new tab): A demo on building a recommendation system using link predictions calculated with the node2vec algorithm.
- Recommendation System Using Online Node2Vec With Memgraph MAGE (opens in a new tab): A demo on building an online recommendation system using k-means clustering and node2vec algorithm.
Graph neural networks
Using the node2vec algorithm to determine node embeddings works well, but graph neural networks (GNNs) are more precise. GNNs aim to get the node representations automatically and efficiently by iteratively aggregating the representations of node neighbors and combining them with their representation from the previous iteration. GNNs can inductively learn about your dataset, which means that after training is complete, you can apply their knowledge to a similar use case, meaning you don't have to retrain the whole algorithm.
Algorithms
Here are the MAGE algorithms that are using GNNs:
- Link prediction with GNN: Module for predicting links in the graph by using GNNs.
- Node classification with GNN: GNN-based node classification module.
Resources
In case you'd like to learn more about the topic and see practical examples, check out the following resources:
- Building a Recommendation System for Telecommunication Packages Using Graph Neural Networks (opens in a new tab): A demo on how to build a recommendation system using Memgraph's link prediction with GNN.
- Become an Inspector for a Day and Detect Fraudsters With Graph ML on Memgraph (opens in a new tab): A demo on how to build a fraud detection system using node classification with GNN.
Temporal graph networks
Temporal graph networks (TGNs) are GNNs which work on temporal graph networks, meaning they deal with continuous-time dynamic graphs.
Algorithms
Here is the MAGE algorithm that uses TGNs:
- Link prediction and node classification with TGN: A TGN-based module for link prediction and node classification.
Resources
In case you'd like to learn more about the topic, check out the following resource:
- Temporal Graph Neural Networks With Pytorch - How to Create a Simple Recommendation Engine on an Amazon Dataset (opens in a new tab): An under-the-hood blog post explaining TGN in Memgraph and showcasing recommendation system demo using link prediction with TGN.
Want to learn more?
To learn more, check out Enhancing AI with graph databases and LLMs bootcamp (opens in a new tab) and on-demand resources (opens in a new tab). Stay up to date with Memgraph events (opens in a new tab) and watch videos from the AI, LLMs and GraphRAG YouTube playlist (opens in a new tab).