mindspore_gl.dataset.Enzymes

class mindspore_gl.dataset.Enzymes(root)[source]

Enzymes Dataset, a source dataset for reading and parsing Enzymes dataset.

About Enzymes dataset:

ENZYMES is a dataset of protein tertiary structures obtained from (Borgwardt et al., 2005) consisting of 600 enzymes from the BRENDA enzyme database (Schomburg et al., 2004). In this case the task is to correctly assign each enzyme to one of the 6 EC top-level classes.

Statistics:

  • Graphs: 600

  • Nodes: 32.63

  • Edges: 62.14

  • Number of Classes: 6

Dataset can be download here: ENZYMES .

You can organize the dataset files into the following directory structure and read.

.
├── ENZYMES_A.txt
├── ENZYMES_graph_indicator.txt
├── ENZYMES_graph_labels.txt
├── ENZYMES_node_attributes.txt
├── ENZYMES_node_labels.txt
└── README.txt
Parameters

root (str) – path to the root directory that contains enzymes_with_mask.npz.

Raises

Examples

>>> from mindspore_gl.dataset import Enzymes
>>> root = "path/to/enzymes"
>>> dataset = Enzymes(root)
property graph_count

Total graph numbers.

Returns

  • int, numbers of graph.

Examples

>>> #dataset is an instance object of Dataset
>>> graph_count = dataset.graph_count
property graph_edges

Accumulative graph edges count.

Returns

  • numpy.ndarray, array of accumulative edges.

Examples

>>> #dataset is an instance object of Dataset
>>> val_mask = dataset.graph_edges
property graph_label

Graph label.

Returns

  • numpy.ndarray, array of graph label.

Examples

>>> #dataset is an instance object of Dataset
>>> node_feat = dataset.graph_label
graph_node_feat(graph_idx)[source]

Graph features.

Parameters

graph_idx (int) – index of graph.

Returns

  • numpy.ndarray, node feature of graph.

Examples

>>> #dataset is an instance object of Dataset
>>> graph_node_feat = dataset.graph_node_feat(graph_idx)
property graph_nodes

Accumulative graph nodes count.

Returns

  • numpy.ndarray, array of accumulative nodes.

Examples

>>> #dataset is an instance object of Dataset
>>> val_mask = dataset.graph_nodes
property label_dim

Number of label classes.

Returns

  • int, the number of classes.

Examples

>>> #dataset is an instance object of Dataset
>>> label_dim = dataset.label_dim
property max_num_node

Max number of nodes in one graph.

Returns

  • int, the max number of node number.

Examples

>>> #dataset is an instance object of Dataset
>>> max_num_node = dataset.max_num_node
property node_feat

Node features.

Returns

  • numpy.ndarray, array of node feature.

Examples

>>> #dataset is an instance object of Dataset
>>> node_feat = dataset.node_feat
property node_feat_size

Feature size of each node.

Returns

  • int, the number of feature size.

Examples

>>> #dataset is an instance object of Dataset
>>> node_feat_size = dataset.node_feat_size
property test_graphs

Test graph ID.

Returns

  • numpy.ndarray, array of test graph id.

Examples

>>> #dataset is an instance object of Dataset
>>> test_graphs = dataset.test_graphs
property test_mask

Mask of test nodes.

Returns

  • numpy.ndarray, array of mask.

Examples

>>> #dataset is an instance object of Dataset
>>> test_mask = dataset.test_mask
property train_graphs

Train graph ID.

Returns

  • numpy.ndarray, array of train graph id.

Examples

>>> #dataset is an instance object of Dataset
>>> train_graphs = dataset.train_graphs
property train_mask

Mask of training nodes.

Returns

  • numpy.ndarray, array of mask.

Examples

>>> #dataset is an instance object of Dataset
>>> train_mask = dataset.train_mask
property val_graphs

Valid graph ID.

Returns

  • numpy.ndarray, array of valid graph id.

Examples

>>> #dataset is an instance object of Dataset
>>> val_graphs = dataset.val_graphs
property val_mask

Mask of validation nodes.

Returns

  • numpy.ndarray, array of mask.

Examples

>>> #dataset is an instance object of Dataset
>>> val_mask = dataset.val_mask