mlx_graphs.datasets.TUDataset

mlx_graphs.datasets.TUDataset#

class mlx_graphs.datasets.TUDataset(name: str, cleaned: bool = False, base_dir: str | None = None)[source]#

A collection of over 120 benchmark datasets for graph classification and regression, made available by TU Dortmund University. Access all these datasets here.

This class also supports cleaned dataset versions containing only non-isomorphic graphs, and presented in Understanding Isomorphism Bias in Graph Data Sets.

Parameters:
  • name (str) – Name of the dataset to load (e.g. “MUTAG”, “PROTEINS”, “IMDB-BINARY”, etc.).

  • cleaned (bool) – Whether to use the cleaned or original version of datasets. Default is False.

  • base_dir (Optional[str]) – Directory where to store dataset files. Default is in the local directory .mlx_graphs_data/.

__init__(name: str, cleaned: bool = False, base_dir: str | None = None)[source]#

Methods

__init__(name[, cleaned, base_dir])

download()

Download the dataset at self.raw_path.

load()

Load the processed dataset

process()

Process the dataset and store data in self.data

save()

Save the processed dataset

Attributes

name

Name of the dataset

num_edge_classes

Returns the number of edge classes to predict.

num_edge_features

Returns the number of edge features.

num_graph_classes

Returns the number of graph classes to predict.

num_graph_features

Returns the number of graph features.

num_graphs

Returns the number of graphs in the dataset.

num_items

Returns the number of items in the dataset.

num_node_classes

Returns the number of node classes to predict.

num_node_features

Returns the number of node features.

processed_path

The path where raw files are stored.

raw_path

The path where raw files are stored.