Skip to content

Datasets

Base classes and built-in datasets of mlx_graphs.datasets. The datasets guide lists their sizes.

Base classes

Class Description
BaseDataset Abstract base class for datasets.
Dataset A dataset class for graph data. download and process methods must be implemented by children classes.
HeteroDataset A dataset class for handling heterogeneous graph data.

Built-in datasets

Class Description
KarateClubDataset Zachary's Karate Club netowork dataset from An Information Flow Model for Conflict and Fission in Small Groups.
PlanetoidDataset The citation network datasets "Cora", "CiteSeer" and "PubMed" from the "Revisiting Semi-Supervised Learning with Graph Embeddings" paper.
AmazonDataset The Amazon Computers and Amazon Photo co-purchase graphs from the "Pitfalls of Graph Neural Network Evaluation" paper.
CoauthorDataset The Coauthor CS and Coauthor Physics co-authorship graphs from the "Pitfalls of Graph Neural Network Evaluation" paper, built from the Microsoft Academic Graph.
QM7bDataset QM7b dataset from the "MoleculeNet: A Benchmark for Molecular Machine Learning" paper, consisting of 7,211 molecules with 14 regression targets.
TUDataset A collection of over 120 benchmark datasets for graph classification and regression, made available by TU Dortmund University.
SuperPixelDataset MNIST and CIFAR10 superpixel datasets for graph classification tasks converted fromt the original MINST and CIFAR10 images.
OGBDataset Datasets from the Open Graph Benchmark (OGB) collection of realistic, large-scale, and diverse benchmark datasets for machine learning on graphs.
OGBMAG The ogbn-mag dataset from the "Open Graph Benchmark: Datasets for Machine Learning on Graphs" paper, a heterogeneous subset of the Microsoft Academic Graph, as PyG's OGB_MAG.
EllipticBitcoinDataset The Elliptic Bitcoin dataset of Bitcoin transactions from the "Anti-Money Laundering in Bitcoin: Experimenting with Graph Convolutional Networks for Financial Forensics" paper.
MovieLens100K The MovieLens 100K heterogeneous rating dataset, assembled by GroupLens Research from the MovieLens web site, consisting of movies (1,682 nodes) and users (943 nodes) with 100K ratings between them.
IMDB A subset of the Internet Movie Database (IMDB), as collected in the "MAGNN: Metapath Aggregated Graph Neural Network for Heterogeneous Graph Embedding" paper.
DBLP A subset of the DBLP computer science bibliography website, as collected in the "MAGNN: Metapath Aggregated Graph Neural Network for Heterogeneous Graph Embedding" paper.
CitationFull The full citation network datasets from the "Deep Gaussian Embedding of Graphs: Unsupervised Inductive Learning via Ranking" paper.
CoraFull Alias for CitationFull with name="cora": the full Cora citation graph with 19,793 nodes, 126,842 edges, 8,710 features and 70 classes.
HeterophilousGraphDataset The heterophilous graphs "Roman-empire", "Amazon-ratings", "Minesweeper", "Tolokers" and "Questions" from the "A Critical Look at the Evaluation of GNNs under Heterophily: Are We Really Making Progress?" paper.
WebKB The WebKB datasets used in the "Geom-GCN: Geometric Graph Convolutional Networks" paper.
WikipediaNetwork The Wikipedia networks introduced in the "Multi-scale Attributed Node Embedding" paper, as pre-processed in the "Geom-GCN: Geometric Graph Convolutional Networks" paper.
Actor The actor-only induced subgraph of the film-director-actor-writer network used in the "Geom-GCN: Geometric Graph Convolutional Networks" paper.
WikiCS The semi-supervised Wikipedia-based dataset from the "Wiki-CS: A Wikipedia-Based Benchmark for Graph Neural Networks" paper.
FB15k_237 The FB15K237 dataset from the "Translating Embeddings for Modeling Multi-Relational Data" paper, containing 14,541 entities, 237 relations and 310,116 fact triples.
WordNet18 The WordNet18 dataset from the "Translating Embeddings for Modeling Multi-Relational Data" paper, containing 40,943 entities, 18 relations and 151,442 fact triplets, e.g., furniture includes bed.
WordNet18RR The WordNet18RR dataset from the "Convolutional 2D Knowledge Graph Embeddings" paper, containing 40,943 entities, 11 relations and 93,003 fact triplets.
FakeDataset A fake dataset that returns randomly generated GraphData objects, useful to test models and pipelines without downloading anything.
FakeHeteroDataset A fake dataset that returns randomly generated HeteroGraphData objects, useful to test heterogeneous models and pipelines without downloading anything.
JODIEDataset The temporal interaction graphs of the "JODIE: Predicting Dynamic Embedding Trajectory in Temporal Interaction Networks" paper, as PyG's torch_geometric.datasets.JODIEDataset.
TGBLinkPropPredDataset The dynamic link property prediction datasets of the Temporal Graph Benchmark (TGB), as py-tgb's tgb.linkproppred.dataset_pyg.PyGLinkPropPredDataset.
TGBNodePropPredDataset The dynamic node property prediction datasets of the Temporal Graph Benchmark (TGB), as py-tgb's tgb.nodeproppred.dataset_pyg.PyGNodePropPredDataset.
LRGBDataset The Peptides datasets of the "Long Range Graph Benchmark" (LRGB).
GNNBenchmarkDataset Datasets of the "Benchmarking Graph Neural Networks" paper.
ModelNet The ModelNet10/40 datasets from the "3D ShapeNets: A Deep Representation for Volumetric Shapes" paper, containing CAD models of 10 and 40 categories, respectively.
ShapeNet The ShapeNet part level segmentation dataset from the "A Scalable Active Framework for Region Annotation in 3D Shape Collections" paper, containing about 17,000 3D shape point clouds from 16 shape categories.
QM9 The QM9 dataset from the "MoleculeNet: A Benchmark for Molecular Machine Learning" paper, consisting of about 130,000 small organic molecules (up to 9 heavy atoms among C, O, N and F) with 19 regression targets.
ZINC The ZINC dataset from the ZINC database and the "Automatic Chemical Design Using a Data-Driven Continuous Representation of Molecules" paper, containing about 250,000 molecular graphs with up to 38 heavy atoms.
MoleculeNet The MoleculeNet benchmark collection from the "MoleculeNet: A Benchmark for Molecular Machine Learning" paper, containing datasets of physical chemistry, biophysics and physiology.
Reddit The Reddit dataset from the "Inductive Representation Learning on Large Graphs" paper, containing Reddit posts belonging to different communities.
Reddit2 The Reddit dataset from the "GraphSAINT: Graph Sampling Based Inductive Learning Method" paper, containing Reddit posts belonging to different communities.
Flickr The Flickr dataset from the "GraphSAINT: Graph Sampling Based Inductive Learning Method" paper, containing descriptions and common properties of images.
Yelp The Yelp dataset from the "GraphSAINT: Graph Sampling Based Inductive Learning Method" paper, containing customer reviewers and their friendship.
AmazonProducts The Amazon dataset from the "GraphSAINT: Graph Sampling Based Inductive Learning Method" paper, containing products and their categories.
PPI The protein-protein interaction networks from the "Predicting Multicellular Function through Multi-layer Tissue Networks" paper, containing positional gene sets, motif gene sets and immunological signatures as features (50 in total) and gene ontology sets as labels (121 in total), as used by GraphSAGE.

Negative samples of the TGB link property prediction datasets:

Class Description
TGBNegativeEdgeSampler The precomputed negative edges of the validation and test events of a TGB link property prediction dataset, as py-tgb's tgb.linkproppred.negative_sampler.NegativeEdgeSampler.

Utilities

Name Description
load_torch_file() Loads a file saved with torch.save (or a plain pickle file) without PyTorch, with every tensor converted to a numpy.ndarray.
SparseCOOMatrix Minimal stand-in for an unpickled scipy.sparse.coo_matrix.

Helpers of mlx_graphs.datasets.utils for writing a dataset (see the datasets guide):

Function Description
download() Download a given URL.
Function Description
check_sha1() Check whether the sha1 hash of the file content matches the expected hash.
extract_archive() Extract archive file.
save_graphs()
read_txt_array()
parse_txt_array()
is_floating_point()