Skip to content

Separate label validity and reject unusable return endpoints - #80

Open
initial-d wants to merge 4 commits into
mainfrom
codex/separate-training-masks-20261023
Open

initial-d wants to merge 4 commits into
mainfrom
codex/separate-training-masks-20261023

Conversation

@initial-d

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

Copy link
Copy Markdown
Owner

Summary

The training dataset previously coupled today's forward-label validity to tomorrow's factor availability. A limit-move exclusion can invalidate tomorrow's factors while today's observed return label remains valid. FactorDataset accepts a separate already-aligned label_mask, and the CLI supplies target_01's mask. Calls without the new argument retain the legacy intersection. Nonfinite training inputs are excluded and mask/label shapes are checked.

Forward labels now require finite positive closes at both endpoints and a finite computed return. Zero/negative prices no longer become clamped extreme returns; masked NaN/Inf produce zero values with false masks. Genuine zero returns stay valid. Positive integer horizons at or beyond panel length have no valid labels; multi-row horizons check endpoints only.

The mask contract distinguishes observations, factor exclusions, historical labels and order feasibility. This can change training sample counts; it is not new market-performance or alpha evidence.

Type of change

  • Bug fix
  • Documentation
  • Test or benchmark

Reproducibility

  • Deterministic mask/label/alignment/nonfinite/endpoint regression tests.
  • Updated API and research-policy documentation.
  • No external market data, private data or credentials.

Collaboration

  • Solo contribution.

Validation

Clean Python 3.12.14 / PyTorch 2.14.1, macOS 26.6.2, Apple M5 CPU:

python -m pytest: 173 passed
python -m ruff check src tests: All checks passed

docs/audits/training-masks-20261023/ preserves the original checks and older-environment failures. docs/audits/forward-labels-20261024/ records the endpoint follow-up and raw test output. All evidence is synthetic/unit-test engineering evidence; archived public-data returns are not revalidated.

@initial-d initial-d changed the title Separate forward-label validity from factor availability Separate label validity and reject unusable return endpoints Oct 23, 2026

This branch has not been deployed

No deployments
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