# StellarGraph demos¶

StellarGraph provides numerous algorithms for graph machine learning. This folder contains demos of all of them to explain how they work and how to use them as part of a TensorFlow Keras data science workflow.

The demo notebooks can be run without any installation of Python by using Binder or Google Colab - these both provide a cloud-based notebook environment. The whole set of demos can be opened in Binder or you can click the Binder and Colab badges within each notebook.

## Find algorithms for a task¶

- Introduction to StellarGraph and its graph machine learning workflow (with TensorFlow and Keras): GCN on Cora
- Predicting attributes, such as classifying as a class or label, or regressing to calculate a continuous number:
- For nodes/vertices/entities: node classification
- For edges/links/connections: link prediction (includes knowledge graph completion)
- For graphs/networks: graph classification
- Adjusting predictions scores to be probabilities (for any model): calibration
- Interpreting/introspecting models, for node classification: interpretability

- Representation learning or computing embedding vectors (including unsupervised tasks):
- For nodes/vertices/entities and edges/links/connections: embeddings

- Time series or sequence prediction for nodes within a graph (including spatio-temporal data): time series
- Ensembling models to reduce prediction variance: ensembles
- Loading data into a
`StellarGraph`

object, with Pandas, Neo4j or NetworkX: basics - Experimental: running GraphSAGE on data stored in Neo4j: neo4j connector

## Find a demo for an algorithm¶

Algorithm | Heterogeneous | Directed | Edge weights | Time-varying, temporal | Node features | Node classification | Link prediction | Unsupervised | Inductive | Graph classification |
---|---|---|---|---|---|---|---|---|---|---|

Graph Convolutional Network (GCN) | see RGCN | see T-GCN | yes | demo | demo | UnsupervisedSampler, DeepGraphInfomax | see Cluster-GCN | demo | ||

Cluster-GCN | yes | demo | yes | yes | ||||||

Relational GCN (RGCN) | multiple edges types | yes | demo | yes | ||||||

Temporal GCN (T-GCN), implemented as GCN-LSTM | node features | time series, sequence | demo | |||||||

Graph ATtention Network (GAT) | yes | demo | yes | UnsupervisedSampler, DeepGraphInfomax | ||||||

Simplified Graph Convolution (SGC) | yes | demo | yes | |||||||

Personalized Propagation of Neural Predictions (PPNP) | yes | demo | yes | UnsupervisedSampler, DeepGraphInfomax | ||||||

Approximate PPNP (APPNP) | yes | demo | yes | UnsupervisedSampler, DeepGraphInfomax | ||||||

GraphWave | via embedding vectors | via embedding vectors | demo | |||||||

Attri2Vec | yes | demo | demo | demo | ||||||

GraphSAGE | see HinSAGE | demo | yes | demo | demo | UnsupervisedSampler, DeepGraphInfomax | demo | |||

HinSAGE | yes | yes | yes | demo | DeepGraphInfomax | yes | ||||

Node2Vec | demo | via embedding vectors | via embedding vectors | demo | ||||||

Metapath2Vec | yes | via embedding vectors | via embedding vectors | demo | ||||||

Continuous-Time Dynamic Network Embeddings | yes | via embedding vectors | via embedding vectors | yes | ||||||

Watch Your Step | via embedding vectors | via embedding vectors | demo | |||||||

ComplEx | multiple edges types | yes | via embedding vectors | demo | yes | |||||

DistMult | multiple edges types | yes | via embedding vectors | demo | yes | |||||

Deep Graph CNN | yes | demo |

See the root README or each algorithm’s documentation for the relevant citation(s).

## Download the demos¶

You can run download a local copy of the demos using the `curl`

command below:

```
curl -L https://github.com/stellargraph/stellargraph/archive/master.zip | tar -xz --strip=1 stellargraph-master/demos
```

The dependencies required to run most of our demo notebooks locally can be installed using one of the following:

- Using pip:
`pip install stellargraph[demos]`

- Using conda:
`conda install -c stellargraph stellargraph`

## Table of contents¶

- StellarGraph basics
- Model calibration
- Connector
- Unsupervised representation learning
- Node representation learning with attri2vec
- Node representation learning with Deep Graph Infomax
- Node representation learning with GraphSAGE and UnsupervisedSampler
- Node representations with GraphWave
- Node representation learning with Metapath2Vec
- Node representation learning with Node2Vec
- Node representation learning with Watch Your Step

- Ensemble learning
- Graph classification
- Interpretability of node classification results
- Link prediction
- Link prediction via inductive node representations with attri2vec
- Knowledge graph link prediction with ComplEx
- Link prediction with Continuous-Time Dynamic Network Embeddings (CTDNE)
- Knowledge graph link prediction with DistMult
- Link prediction with GCN
- Link prediction with GraphSAGE
- Link prediction with Heterogeneous GraphSAGE (HinSAGE)
- Link prediction with Node2Vec

- Node classification
- Node classification via node representations with attri2vec
- Node classification with Cluster-GCN
- Node classification with directed GraphSAGE
- Node classification with Graph ATtention Network (GAT)
- Node classification with Graph Convolutional Network (GCN)
- Inductive node classification and representation learning using GraphSAGE
- Node classification with GraphSAGE
- Node classification with Node2Vec
- Node classification with weighted Node2Vec
- Node classification with Personalised Propagation of Neural Predictions (PPNP) and Approximate PPNP (APPNP)
- Node classification with Relational Graph Convolutional Network (RGCN)
- Node classification with Simplified Graph Convolutions (SGC)

- Graphs with time series and sequence data