Works with the AI Agents you already use

    train test leakage auditor

    by 2592980960

    1

    Audit tabular train/test splits for duplicate rows, identifier overlap, and target leakage using data-only checks.

    Free

    Security scanned
    train test leakage auditor

    train test leakage auditor

    Example session with this skill installed

    Audit these files for leakage. Train is 'data/train_v1.csv', test is 'data/test_v1.csv'. The target is 'is_converted' and the id is 'user_uuid'.

    • Read your context and instructions
    • Compiled the train test leakage
    • Generated the data export

    I have completed the data-level leakage audit. The check identified one critical overlap between the splits.

    Train/Test Leakage Audit Report

    Verdict: BLOCK (partial)
    Inputs:

    • Train: data/train_v1.csv (10,450 rows)
    • Test: data/test_v1.csv (2,500 rows)
    • Target: is_converted
    • ID Column: user_uuid
    IDSeverityCheckEvidence
    L001BLOCKIdentifier Overlap42 unique user_uuid values found in both splits.
    S001INFOSchema MatchAll 14 columns match across splits.
    T002INFOTarget DistributionTrain (12.4% positive), Test (N/A - unlabeled).

    Recommended actions

    • Resolve ID Overlap: Remove the 42 overlapping users from the training set to prevent memorization.
    • Verify Split Logic: Review the sampling script to ensure it is grouped by user_uuid rather than random row-wise.

    Not checked

    • Code-level preprocessing (scaling, encoding).
    • Temporal leakage (timestamp ordering).
    • Data provenance.

    Reproduce

    python scripts/audit_leakage.py --train data/train_v1.csv --test data/test_v1.csv --target is_converted --id-column user_uuid
    

    Next steps

    1. Review the list of 42 overlapping UUIDs in the log file.
    2. Re-run the split using a grouped strategy.
    3. Re-audit the new files before training.

    train_v1.csv

    CSV · data export

    Generated

    Example file from a real run - the skill writes it into your workspace.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Data leakage is often the silent killer behind models that look perfect in training but fail in production. This skill audits train and test splits for contamination without needing access to your training pipelines or notebooks.

    What it does

    • Duplicate Detection identifies exact or near-duplicate rows that straddle the train/test boundary.
    • Identifier Overlap flags unique keys or IDs present in both splits, preventing data memorization.
    • Schema Validation checks for drift or column mismatches between the two datasets.
    • Target Leakage Analysis finds features that proxy the label or encode future information.
    • Severity Ranking categorizes findings as BLOCK, WARN, or INFO based on established rubrics.

    How it works

    1. Input Verification confirms file existence, row/column counts, and target column presence.
    2. Audit Execution runs the audit_leakage.py script against your train and test files.
    3. Severity Calibration matches script outputs against the severity-rubric.md for accurate reporting.
    4. Report Generation produces a structured audit report using the audit_report_template.md.

    Frameworks & tools

    This skill uses a Python-based auditor that relies on the standard library for maximum portability. It supports csv, tsv, and delimited text files.

    Why this beats prompting it yourself

    Generic prompts often miss "proxy" leakage or fail to check row-level overlap systematically across large files. This tool follows a rigid, severity-ranked protocol and provides a reproducible command for every audit it performs.

    Use cases

    • Validating a new dataset split handed over by a third party or colleague.
    • Investigating suspiciously high test metrics (AUC/F1) before deployment.
    • Documenting split integrity for technical papers or model documentation.
    • Detecting feature drift when regenerating splits from a live data source.

    Known limitations

    Does not detect code-level leakage like fitting scalers on the full dataset or temporal shuffling errors. Requires a target column for label-based checks.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 15 days ago

    • Free with an Agensi account

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed15 days ago

    What's inside

    Creator

    2

    2592980960

    Frequently Asked Questions

    This skill detects 'data contamination,' where information from your test set accidentally exists in your training data. It prevents inflated performance metrics by identifying duplicate rows, overlapping IDs, and features that give away the answer (target leakage).

    The auditor currently supports tabular data in CSV, TSV, and delimited text formats. It is designed to be framework-agnostic, meaning it works regardless of whether you trained your model in Scikit-Learn, XGBoost, or TensorFlow.

    You will receive the core Python audit engine, the severity rubric for risk assessment, and the standardized report template. All tools are designed to run locally or within your agent environment for maximum data privacy.

    No, this skill performs data-only audits, meaning it analyzes your finalized files rather than your code. It is specifically designed to catch leakage that occurred during data collection or manual splitting that code-based linters often miss.

    Finding a 'BLOCK' severity indicates high-risk leakage that will likely lead to model failure; you should fix the split before proceeding. 'WARN' and 'INFO' flags highlight potential biases or schema drifts that deserve investigation but may not be fatal.

    New in LLM Ops

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.

    Free