Pubmed

class dhg.data.Pubmed(data_root=None)[source]

Bases: dhg.data.base.BaseData

The PubMed dataset is a citation network dataset for vertex classification task. More details can be found in this website.

  • num_classes: The number of classes: \(3\).

  • num_vertices: The number of vertices: \(19,717\).

  • num_edges: The number of edges: \(88,676\).

  • dim_features: The dimension of features: \(500\).

  • features: The vertex feature matrix. torch.Tensor with size \((19,717 \times 500)\).

  • edge_list: The edge list. List with length \((88,676 \times 2)\).

  • labels: The label list. torch.LongTensor with size \((19,717, )\).

  • train_mask: The train mask. torch.BoolTensor with size \((19,717, )\).

  • val_mask: The validation mask. torch.BoolTensor with size \((19,717, )\).

  • test_mask: The test mask. torch.BoolTensor with size \((19,717, )\).

Parameters

data_root (str, optional) – The data_root has stored the data. If set to None, this function will auto-download from server and save into the default direction ~/.dhg/datasets/. Defaults to None.