r"""Cora citation network dataset. Nodes mean paper and edges mean citation relationships. Each node has a predefined feature with 1433 dimensions. The dataset is designed for the node classification task. The task is to predict the category of certain paper. Statistics
| 338 | |
| 339 | |
| 340 | class CoraGraphDataset(CitationGraphDataset): |
| 341 | r"""Cora citation network dataset. |
| 342 | |
| 343 | Nodes mean paper and edges mean citation |
| 344 | relationships. Each node has a predefined |
| 345 | feature with 1433 dimensions. The dataset is |
| 346 | designed for the node classification task. |
| 347 | The task is to predict the category of |
| 348 | certain paper. |
| 349 | |
| 350 | Statistics: |
| 351 | |
| 352 | - Nodes: 2708 |
| 353 | - Edges: 10556 |
| 354 | - Number of Classes: 7 |
| 355 | - Label split: |
| 356 | |
| 357 | - Train: 140 |
| 358 | - Valid: 500 |
| 359 | - Test: 1000 |
| 360 | |
| 361 | Parameters |
| 362 | ---------- |
| 363 | raw_dir : str |
| 364 | Raw file directory to download/contains the input data directory. |
| 365 | Default: ~/.dgl/ |
| 366 | force_reload : bool |
| 367 | Whether to reload the dataset. Default: False |
| 368 | verbose : bool |
| 369 | Whether to print out progress information. Default: True. |
| 370 | reverse_edge : bool |
| 371 | Whether to add reverse edges in graph. Default: True. |
| 372 | transform : callable, optional |
| 373 | A transform that takes in a :class:`~dgl.DGLGraph` object and returns |
| 374 | a transformed version. The :class:`~dgl.DGLGraph` object will be |
| 375 | transformed before every access. |
| 376 | reorder : bool |
| 377 | Whether to reorder the graph using :func:`~dgl.reorder_graph`. Default: False. |
| 378 | |
| 379 | Attributes |
| 380 | ---------- |
| 381 | num_classes: int |
| 382 | Number of label classes |
| 383 | |
| 384 | Notes |
| 385 | ----- |
| 386 | The node feature is row-normalized. |
| 387 | |
| 388 | Examples |
| 389 | -------- |
| 390 | >>> dataset = CoraGraphDataset() |
| 391 | >>> g = dataset[0] |
| 392 | >>> num_class = dataset.num_classes |
| 393 | >>> |
| 394 | >>> # get node feature |
| 395 | >>> feat = g.ndata['feat'] |
| 396 | >>> |
| 397 | >>> # get data split |
no outgoing calls