﻿# Planetoid Cora: test-index reordering is part of reconstructing the dataset

Load the packaged Cora benchmark without detaching test features and labels from graph nodes; distinguish array reconstruction from choosing a train/test split.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-planetoid-cora-test-index-reconstruction/
Language: en

## Read the packaged arrays as a coordinated representation

The [original Planetoid repository](https://github.com/kimiyoung/planetoid) documents feature arrays, label arrays, a graph dictionary and test indices. These files describe related views of a node population; they are not independent tables that can be concatenated in arbitrary order. For a Cora adapter, define how each output row corresponds to a graph node before running a neural layer. A shape check alone cannot establish that relationship, because an incorrect permutation can leave every dimension unchanged.

## Inspect the reconstruction operation

The [PyG reader source](https://raw.githubusercontent.com/pyg-team/pytorch_geometric/master/torch_geometric/io/planetoid.py) concatenates the appropriate feature blocks and reassigns rows using the supplied test-index order and its sorted counterpart. It also applies the corresponding label reassignment. That operation reconstructs a common node namespace rather than introducing new training examples. When implementing another loader, compare actual indexed rows with the reference reader instead of assuming that the test feature block already occupies final graph order.

## Keep features and targets aligned together

Suppose an importer correctly restores feature rows but retains the pre-reordering label vector. Classification then asks the model to explain a target attached to another document. The failure may resemble a weak architecture, unstable optimization or an unexpectedly difficult split. Check selected node identifiers across features, labels and adjacency in a small diagnostic view. Preserve the mapping through sparse-to-dense conversion, caching and export, where a later sort can silently undo otherwise correct reconstruction.

## Choose masks after establishing node identity

The [Planetoid wrapper documentation](https://pytorch-geometric.readthedocs.io/en/latest/generated/torch_geometric.datasets.Planetoid.html) exposes several split policies. Their masks decide which established nodes participate in training, validation or testing. A random split is not a repair for incorrectly reconstructed rows. Record both the artifact reconstruction and the mask policy, and invalidate processed caches when either changes. This separates an input-integrity correction from a legitimate change in the evaluation protocol.

## Validate identity before interpreting model quality

Compare a few reference-loader rows and incident edges, then inspect that masks address the same node namespace. Avoid copying dataset-specific repair branches into unrelated citation collections without checking their purpose. The existing [entity-group guide](/journal/data-guide-entity-group-split-design/) and [software reproducibility guide](/journal/software-stack-reproducibility/) provide related evaluation and environment context. The useful result is an auditable mapping from packaged files to graph examples, making a later accuracy comparison about models rather than accidental row permutations.
