# train test leakage auditor

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

train test leakage auditor is a free AI agent skill on Agensi by 2592980960, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [2592980960](https://www.agensi.io/creators/2592980960)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.0
- Last updated: 2026-11-20
- Security: scan passed (2026-11-20); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/train-test-leakage-auditor
- Tags: llm-ops, python, data-science, machine-learning, data-audit

## 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 this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the train test leakage auditor skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this skill prevent models from failing in production?

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).

### What file types and machine learning frameworks are supported?

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.

### What assets are included with the purchase of this skill?

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.

### Do I need to provide my training notebooks or source code for the audit to work?

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.

### How should I interpret the severity rankings in the final report?

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.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
