Optional TRAIN-only validation split for classification
In #366, the current use of TEST for validation was explained as an upper-bound protocol because UEA supplies only TRAIN and TEST. I am not proposing to silently change that published protocol.
Would an opt-in TRAIN-only validation protocol be welcome as a separate contribution from #858?
At current main, Exp_Classification.train() loads TEST for both vali_loader and test_loader, then selects the checkpoint using early_stopping(-val_accuracy, ...). #858 addresses normalization, not that model-selection policy.
A possible implementation would:
- Split whole sample IDs from TRAIN with a fixed seed and an explicit validation ratio, never individual time-step rows.
- Fit normalization only on the training fold, then reuse it for the validation fold and TEST.
- Select checkpoints on the held-out TRAIN fold and evaluate TEST only after selection.
- Record the seed, split IDs, and chosen protocol in the result metadata.
- Keep the existing upper-bound protocol available for reproducing published results.
The small-class policy needs a decision first: stratification can fail when a class has too few examples. I would prefer an explicit error or a documented deterministic fallback rather than silently using TEST again.
I can add tests proving sample disjointness, deterministic splitting, no fitting on validation or TEST values, and no TEST labels entering checkpoint selection. Does this scope match the evaluation modes you want to support, and should the stricter mode remain opt-in?
Source: thuml/Time-Series-Library