mlx_graphs.datasets.HeteroDataset#
- class mlx_graphs.datasets.HeteroDataset(name: str, base_dir: str | None = None, pre_transform: Callable | None = None, transform: Callable | None = None)[source]#
Bases:
BaseDatasetA dataset class for handling heterogeneous graph data.
- Parameters:
name (
str) – name of the datasetbase_dir (
Optional[str]) – Directory where to store dataset files. Default is in the local directory.mlx_graphs_data/.pre_transform (
Optional[Callable]) – A function/transform that takes in aHeteroGraphDataobject and returns a transformed version. The transformation is applied before the first access.transform (
Optional[Callable]) – A function/transform that takes in aHeteroGraphDataobject and returns a transformed version. The transformation is applied before every access, i.e., during the__getitem__call. By default, no transformation is applied.
Methods
Attributes
nameName of the dataset
Returns a dictionary of the number of edge classes for each edge type.
Returns a dictionary of the number of edge features for each edge type.
Returns a dictionary of the number of edges for each edge type.
Returns the number of graph features.
num_itemsReturns the number of items in the dataset.
Returns a dictionary of the number of node classes for each node type.
Returns a dictionary of the number of node features for each node type.
Returns a dictionary of the number of nodes for each node type.
processed_pathThe path where processed files are stored.
raw_pathThe path where raw files are stored.
- property num_edge_classes: dict[Any, int]#
Returns a dictionary of the number of edge classes for each edge type.
- property num_edge_features: dict[str, int]#
Returns a dictionary of the number of edge features for each edge type.
- property num_node_classes: dict[str, int] | None#
Returns a dictionary of the number of node classes for each node type.