Repository navigation
Support purged time validation and record split provenance - #83
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_infoand checkpointsplit.jsonrecord 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 testsandgit 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.