Skip to content

Support purged time validation and record split provenance - #83

Merged
initial-d merged 1 commit into
mainfrom
codex/purged-date-split-20261029
Oct 29, 2026
Merged

initial-d merged 1 commit into
mainfrom
codex/purged-date-split-20261029

Conversation

@initial-d

@initial-d initial-d commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Multi-period labels need an explicit training/validation gap, but the trainer previously had no way to remove boundary dates or inspect the effective split beside its checkpoints.

Add TrainConfig.purge_dates (default zero), which removes complete observed signal dates immediately before time validation while leaving validation dates fixed. Nonzero gaps require time mode and at least one remaining training date. Purged samples enter neither loader. Trainer.split_info and checkpoint split.json record effective split/batch modes, sample/date counts and numeric date ranges for all three partitions. Existing loss-history keys remain unchanged.

The unit is observed signal dates, not calendar days. Callers select a gap from their actual label horizon/information timing; this does not infer overlap, purge the CLI's outer out-of-sample boundary or change separate walk-forward scripts. The default one-day protocol is unchanged. Random splits reject nonzero gaps rather than claiming chronological isolation. No external market data or performance estimate is included.

Local checks on head b369648972a006588ffec786d7916742f8244dc1: Python 3.12.14 / PyTorch 2.14.1, macOS 26.6.2, Apple M5 CPU, deterministic unit/synthetic fixtures; costs not applicable to split correctness.

  • /tmp/projects-push-20261028-venv/bin/python -m pytest tests/test_purged_training.py tests/test_cross_section_training.py tests/test_trainer_split.py — 30 passed.
  • /tmp/projects-push-20261028-venv/bin/python -m pytest — 221 passed.
  • /tmp/projects-push-20261028-venv/bin/python -m ruff check src tests and git diff --check — passed.

Regression tests use actual four-period return labels to check boundary endpoint timing, complete-date exclusion under MSE and IC, fixed validation windows, sparse date IDs, JSON/report agreement and invalid-gap preservation of existing checkpoints. Based on main; pending #80/#81 are excluded.

GitHub CI passed on the exact head above: Python 3.9/3.10/3.11 lint, full tests and CLI smoke checks. Direct merge follows the maintainer's previously stated instruction to merge the quant changes after checks. The repository permits administrator override of the review requirement; no independent review is claimed and branch protection settings are unchanged.

@initial-d
initial-d merged commit c0c77cd into main Oct 29, 2026
3 checks passed
@initial-d
initial-d deleted the codex/purged-date-split-20261029 branch October 29, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant