# ML Experiment Reviewer

> Finds the silent bugs that make ML results look better than they are - data leakage, train/test contamination, misleading metrics, missing seeds and PyTorch mistakes - in scripts and notebooks. 19 deterministic rules plus your agent's own review, ranked by severity with a fix for every finding.

ML Experiment Reviewer is a free AI agent skill on Agensi by MUHAMMAD WAQAS, in Code Quality & Review. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [MUHAMMAD WAQAS](https://www.agensi.io/creators/muhammad-waqas)
- Category: [Code Quality & Review](https://www.agensi.io/skills/code-quality-review)
- Version: 1.0
- Last updated: 2026-11-26
- Security: scan passed (2026-11-26); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/ml-experiment-reviewer
- Tags: code-review, research, testing, machine-learning, data-leakage, scikit-learn, pytorch, kaggle

## About this skill

Your model scores 0.99, but is it real? This skill reviews ML training code (.py scripts and Jupyter notebooks) for the bugs that silently inflate results, and returns a report ranked by severity with a concrete fix for every finding.

### What it catches
- **Data leakage:** scalers, imputers, encoders, PCA or feature selection fitted before the split; target left in the features; target encoding on all rows; SMOTE before the split
- **Train/test contamination:** fitting on test data, test set used for early stopping or tuning, model trained on the full dataset then scored on test
- **Misleading metrics:** accuracy-only on imbalanced data, ROC AUC from hard predictions, training-only scores
- **Wrong splits:** random splits on time series or on data with repeated users/patients
- **Reproducibility and PyTorch:** missing seeds, missing zero_grad(), missing model.eval()

### How it works
1. A deterministic rule engine (19 checks, Python standard library only) parses your code. It never executes it, and your code never leaves your machine.
2. Your agent then reads the code itself to confirm each finding and catch what rules cannot see: features only known after the outcome, ID columns used as features, unused fitted vectorizers.
3. You get a verdict (FAIL / WARNING / PASS), findings ranked critical to low with exact line or notebook-cell locations, and the fix for each.

### Why this beats prompting it yourself
Generic code review misses leakage because the code runs without errors. The rule engine tracks how data flows to the split, cross-validation and evaluation calls, so it gives the same answer every time and points to the exact line. It was tested on scikit-learn's 282 official examples with no crashes.

## Requires

- python 3.9+

## Known limitations

Supports Python only. Static analysis follows variables within one file; cannot detect leakage in external SQL or data exports. Variable naming influences rule detection.

## 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 ML Experiment Reviewer 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

### Does it run my code?

No. It only reads and parses the code.

### Is my code uploaded anywhere?

No. Your own agent reviews it locally.

### Does it need an API key?

No.

### Which libraries does it understand?

The ones in the compatibility note. It works on Python code only.

---

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.
