Cora
- class dhg.data.Cora(data_root=None)[source]
Bases:
dhg.data.base.BaseData
The Cora dataset is a citation network dataset for vertex classification task. More details can be found in this website.
The content of the Cora dataset includes the following:
num_classes
: The number of classes: \(7\).num_vertices
: The number of vertices: \(2,708\).num_edges
: The number of edges: \(10,858\).dim_features
: The dimension of features: \(1,433\).features
: The vertex feature matrix.torch.Tensor
with size \((2,708 \times 1,433)\).edge_list
: The edge list.List
with length \((10,858 \times 2)\).labels
: The label list.torch.LongTensor
with size \((2,708, )\).train_mask
: The train mask.torch.BoolTensor
with size \((2,708, )\).val_mask
: The validation mask.torch.BoolTensor
with size \((2,708, )\).test_mask
: The test mask.torch.BoolTensor
with size \((2,708, )\).
- Parameters
data_root (
str
, optional) – Thedata_root
has stored the data. If set toNone
, this function will auto-download from server and save into the default direction~/.dhg/datasets/
. Defaults toNone
.