QM7b数据集

class dgl.data.QM7bDataset(raw_dir=None, force_reload=False, verbose=False, transform=None)[source]

Bases: DGLDataset

用于图属性预测(回归)的QM7b数据集

该数据集包含7,211个分子,具有14个回归目标。 节点表示原子,边表示键。边数据‘h’表示 库仑矩阵的条目。

参考:http://quantum-machine.org/datasets/

统计:

  • 图表数量:7,211

  • 回归目标的数量:14

  • 平均节点数:15

  • 平均边数:245

  • 边缘特征大小:1

Parameters:
  • raw_dir (str) – Raw file directory to download/contains the input data directory. Default: ~/.dgl/

  • force_reload (bool) – Whether to reload the dataset. Default: False

  • verbose (bool) – Whether to print out progress information. Default: True.

  • transform (callable, optional) – A transform that takes in a DGLGraph object and returns a transformed version. The DGLGraph object will be transformed before every access.

num_tasks

预测任务的数量

Type:

int

num_labels

(已弃用,请使用num_tasks代替)预测任务的数量

Type:

int

Raises:

UserWarning – If the raw data is changed in the remote server by the author.

示例

>>> data = QM7bDataset()
>>> data.num_tasks
14
>>>
>>> # iterate over the dataset
>>> for g, label in data:
...     edge_feat = g.edata['h']  # get edge feature
...     # your code here...
...
>>>
__getitem__(idx)[source]

通过索引获取图形和标签

Parameters:

idx (int) – Item index

Return type:

(dgl.DGLGraph, Tensor)

__len__()[source]

数据集中的图表数量。

Return type:

int