data leakage detection lab

    by nowrich

    1

    Inspects ML pipelines to identify and fix data leakage, contaminated features, and accidental hindsight.

    Secure checkout via Stripe

    0 installsSecurity scanned

    Works with the AI tools you already use

    CClaude CodeCCursorCCodex CLIGGitHub CopilotGGemini CLI+17 more

    See it in action

    You say

    Review this pipeline. I am using StandardScaler.fit(X) then train_test_split. My features include a rolling 30-day mean of the target variable. Is there leakage?

    Your agent does

    Leakage detected. 1) Preprocessing Leak: StandardScaler must be fit only on X_train to avoid test set statistics influencing training. 2) Future Leak: Rolling target means must be lagged or computed cumulatively to ensure future outcomes do not inform past predictions.

    What you get

    Detect features that use future information unknown at prediction time.Verify train-test split purity for grouped or temporal data.Scan for preprocessing steps fit on the entire dataset instead of training folds.Analyze high-importance features for hidden target encoding.

    About this skill

    The problem

    Machine learning models often report suspiciously high performance that collapses in production. This usually stems from data leakage, where information from the future or the test set accidentally contaminates the training process.

    What it does

    • Identifies future information leakage by auditing feature timestamps against label timestamps.
    • Detects preprocessing contamination where scalers, encoders, or imputers are fit on the full dataset before splitting.
    • Spots sample and group leakage where duplicate entities or near-duplicate records straddle the train-test boundary.
    • Exposes accidental hindsight by flagging features derived from revised, updated, or backfilled data.
    • Performs adversarial validation to determine if training and test sets are statistically distinguishable.

    Frameworks & tools

    Designed for Python-based data science stacks including scikit-learn, pandas, NumPy, and XGBoost/LightGBM. Works with Jupyter notebooks and automated ML pipelines.

    Why this beats prompting it yourself

    Standard LLMs often miss subtle leakage patterns like target encoding inside cross-validation or group-based dependencies. This skill uses specific diagnostic playbooks and adversarial tests to catch technical debt that manual reviews overlook.

    Use cases

    • Audit a Jupyter notebook before moving a model to a production environment.
    • Debug why a model achieved 0.99 AUC on real-world noisy data.
    • Verify that a temporal split correctly handles rolling windows and lag features.
    • Ensure multi-user datasets don't leak information via group identity.

    Known limitations

    Requires access to the data pipeline code and feature engineering logic. It cannot detect leakage in pre-compiled black-box models without seeing the training workflow.

    How to install

    Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean today

    Listedtoday

    Frequently Asked Questions

    Popular in Testing & QA