Skip to content
cccskills
FreePublished on GitHub

designing-leakage-safe-experiments

Design leakage-safe machine learning experiments that mirror real deployment and support fair model comparisons. Use when defining prediction timing, feature eligibility, train-validation-test splits, baselines, metrics, or controlled model iterations; not for auditing whether raw labels are trustworthy.

The English summary is being prepared. Showing the original description.

Run score Not tested

See how to install

Files included (4)

  • SKILL.md3.8 KB
  • agents/openai.yaml264 B
  • assets/leakage-safe-experiment-plan.md2.9 KB
  • references/leakage-threats-and-splits.md4.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Design Leakage-Safe Experiments

Create an experiment whose result would remain credible when the model meets new data in its intended operating environment. Leakage prevention starts with time and causality, not with a random split parameter.

Define the prediction event

Write down:

  • entity and prediction grain;
  • decision made from the prediction;
  • prediction timestamp and feature cutoff;
  • outcome definition and maturity window;
  • eligible population at prediction time;
  • deployment cadence, horizon, and retraining policy;
  • operational cost of each error type.

Build an availability ledger for candidate features: source event, observation time, recording delay, correction or backfill behavior, earliest production availability, and whether the value depends on the outcome. Exclude or reconstruct features that would not exist in the same form at prediction time.

Read references/leakage-threats-and-splits.md when choosing a split or investigating a suspected leakage path.

Lock the comparison protocol

  1. Choose a split that matches deployment: temporal for future generalization, grouped for repeated entities, spatial or site holdout for new locations, or a justified combination.
  2. Reserve the final test set before feature selection or tuning. Repeated test inspection turns it into validation data.
  3. Fit preprocessing, imputation, encoding, scaling, selection, and resampling only on the training portion of each fold.
  4. Fit a calibrator from a separate calibration split or from out-of-fold predictions that did not train the base prediction for those records.
  5. Choose the operating threshold or decision policy from validation or calibration evidence. Keep the final test untouched until the model, calibrator, and policy are locked.
  6. Define primary and guardrail metrics before seeing candidate results.
  7. Establish a transparent baseline: prevalence, naive forecast, rule, or simple regularized model as appropriate.
  8. Hold data, split, metric implementation, and compute budget constant while comparing one material change at a time.
  9. Record every run, including failures and negative results. Complexity earns adoption only through a repeatable, decision-relevant improvement.

Challenge the design

Test for duplicate or near-duplicate rows across folds; entity, household, device, site, or document overlap; target proxies; post-outcome updates; full-dataset preprocessing; retrospective cohort filters; label-window overlap; and repeated tuning against the holdout.

Where risk is material, run a temporal backtest, group holdout, label or feature permutation check, suspicious-feature ablation, and slice stability analysis. A surprisingly strong result is a reason to investigate, not a reason to relax scrutiny.

Ask for approval when a choice changes the business target, acceptable error tradeoff, evaluation population, or deployment assumptions. Make routine technical choices within the agreed protocol and document them.

Produce the protocol

Use assets/leakage-safe-experiment-plan.md before implementation. The finished protocol must let a reviewer determine:

  • what was knowable at prediction time;
  • why no entity or future information crosses folds;
  • how the baseline and candidates receive an equal comparison;
  • which set controls tuning and which set supports the final claim;
  • what improvement would justify added complexity;
  • which observed failures remain unresolved.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Audit datasets, joins, labels, and ground truth before analysis or modeling. Use when data meaning, row grain, time semantics, source-of-truth reliability, or label construction may invalidate conclusions; not for general model evaluation after the evidence base is already trusted.

The English summary is being prepared. Showing the original description.

aiopshwang/data-analysis-ml-agent-skills13Updated Aug 27, 2026

Isolate the root cause of ML performance drops, inconsistent evaluations, prediction errors, and training-serving mismatches across data, labels, splits, pipelines, models, metrics, and runtime behavior. Use when investigating a reproducible failure or regression, not routine model selection or general performance validation.

The English summary is being prepared. Showing the original description.

aiopshwang/data-analysis-ml-agent-skills13Updated Aug 27, 2026

Orchestrate an end-to-end data analysis or machine learning project from decision framing through reproducible handoff. Use when a request spans multiple lifecycle stages or an ambiguous modeling request must become a decision-ready result; use narrower audit or experiment-design skills for isolated reviews.

The English summary is being prepared. Showing the original description.

aiopshwang/data-analysis-ml-agent-skills13Updated Aug 27, 2026

Package completed data analysis and ML work so an independent recipient can reproduce the claimed results, verify artifact lineage, and operate the handoff within its stated scope. Use when finalizing a project, study, model package, or review bundle; not for deploying to a live system.

The English summary is being prepared. Showing the original description.

aiopshwang/data-analysis-ml-agent-skills13Updated Aug 27, 2026

Route data analysis and machine learning work to the right skill in this suite. Use when starting any analysis, modeling, validation, or reproducibility task and the matching specialized skill is not yet clear; not needed when one specific skill already clearly applies.

The English summary is being prepared. Showing the original description.

aiopshwang/data-analysis-ml-agent-skills13Updated Aug 27, 2026

Validate trained models and analytical claims against their intended decision, independent evidence, and human-reviewed ground truth. Use when reviewing model performance, analysis conclusions, launch claims, or evaluation reports; use failure diagnosis instead when the main task is locating a known defect.

The English summary is being prepared. Showing the original description.

aiopshwang/data-analysis-ml-agent-skills13Updated Aug 27, 2026

See all skills by aiopshwang

Report a problem with this skill