Skip to content

Define leakage-resistant delay-model contract - #3

Merged
mitulpatel123 merged 1 commit into
mainfrom
agent/ml-data-contract
Aug 8, 2026
Merged

Define leakage-resistant delay-model contract#3
mitulpatel123 merged 1 commit into
mainfrom
agent/ml-data-contract

Conversation

@mitulpatel123

Copy link
Copy Markdown
Owner

What changed

  • defined the exact T-24h arrival-delay prediction task
  • documented the BTS source, cohort, target, candidate study window, and chronological split
  • separated schedule-time features from prohibited post-departure leakage fields
  • established missing-data, category, evaluation, calibration, error-slice, and threshold-selection rules
  • added reproducibility and model-artifact safety requirements
  • excluded raw/processed data and model/report artifacts from Git

Why

The live v0.1 API currently exposes a transparent rules baseline. Before adding a trained model, the project needs an auditable contract that prevents target leakage, retrospective metric inflation, and unsafe artifact handling.

Impact

Issue #2 now has a concrete foundation for preprocessing and training. Future model results can be evaluated against a fixed question and acceptance standard instead of changing the task to fit the output.

Validation

  • python -m pytest — 6 passed
  • git diff --check
  • source and field definitions checked against the official BTS Reporting Carrier On-Time Performance documentation

@mitulpatel123
mitulpatel123 marked this pull request as ready for review August 8, 2026 22:50
@mitulpatel123
mitulpatel123 merged commit f6a9b1b into main Aug 8, 2026
2 checks passed
@mitulpatel123
mitulpatel123 deleted the agent/ml-data-contract branch August 8, 2026 22:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c642918d5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/ml/data-contract.md
- route identifier
- route distance band

Historical aggregates are permitted only when calculated from rows strictly earlier than the prediction row:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Cut historical aggregates off at the prediction timestamp

For a T-24h prediction, requiring only that an aggregate use rows earlier than the current row still permits future outcomes. For example, when scoring an 18:00 flight at 18:00 the previous day, a same-day 10:00 flight sorts earlier but its ArrDel15 is not yet known. Implementing the contract literally would therefore leak labels into every listed prior-delay feature and invalidate validation/test metrics; require each contributing outcome to have become available before the current flight's T-24h timestamp, including the prior used for smoothing.

Useful? React with 👍 / 👎.

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