pidd-leakage-audit

Detects and fixes data leakage in PIDD machine learning pipelines using fold-isolated preprocessing.

6|1|Updated May 11, 2026
One-click install
npx skills add https://github.com/yakeworld/Synthos --skill pidd-leakage-audit-yakeworld
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pidd-leakage-audit
Source: https://github.com/yakeworld/Synthos/tree/main/skills/private/pidd-leakage-audit
Command: npx skills add https://github.com/yakeworld/Synthos --skill pidd-leakage-audit-yakeworld

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires imblearn, sklearn, shap, numpy, catboost.

What problem does it solve? Machine learning results on the PIDD diabetes dataset are frequently inflated by data leakage: SMOTE applied before train/test splitting, global imputation, and preprocessing outside cross-validation folds produce misleading metrics like F1 > 0.90 when the true ceiling is around 0.71. This Skill audits such pipelines, identifies leakage sources, and enforces correct methodology. ## Core Features & Use Cases - Leakage Detection: Flags severe leakage (SMOTE before splitting, causing Recall collapse to ~0.50 and Precision inflation to 1.00) and minor leakage (global imputation, ~+0.6% F1 inflation). - Correct Pipeline Enforcement: Requires imblearn.Pipeline instead of sklearn.Pipeline so SMOTE and imputation run inside each CV fold. - Environment & Citation Rules: Mandates an isolated venv with numpy>=2.0 for SHAP analysis and requires co-citing Shearer (2000) or Wirth & Hipp (2000) whenever CRISP-DM is referenced. - Use Case: Given a 10-fold CV script on PIDD (768 samples) reporting F1=0.93, the audit identifies fold-external SMOTE, rebuilds the pipeline with imblearn, and reruns to confirm F1 falls back to the ~0.71 range, producing cv_results.csv and comprehensive_results.json. ## Quick Start Audit my PIDD cross-validation script for data leakage and rerun it with preprocessing isolated inside the folds.

Frequently Asked Questions about pidd-leakage-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent data leakage when using SMOTE in cross-validation?

Apply SMOTE inside each training fold using imblearn.Pipeline, never before splitting the data. SMOTE on the full dataset before splitting causes severe leakage: Recall collapses to ~0.50 while Precision inflates to 1.00.

imblearn.Pipeline vs sklearn.Pipeline for SMOTE, which should I use?

Use imblearn.Pipeline, because sklearn.Pipeline does not properly support SMOTE resampling steps. imblearn.Pipeline ensures oversampling is applied only to training folds during cross-validation, keeping validation folds uncontaminated.

Why is an F1 score above 0.90 on the PIDD dataset suspicious?

PIDD has only 768 samples, and the best correctly-built models reach about F1 0.71. Any reported F1 above 0.90 almost always indicates data leakage, typically from fold-external SMOTE or global imputation, and should trigger an audit.

Why does SHAP crash with numpy errors on Debian system Python?

Debian system Python ships numpy 1.x compiled packages like numexpr and bottleneck that conflict with numpy 2.x required by SHAP. Create an isolated venv with numpy>=2.0 and run the SHAP script there to avoid crashes.

Is global imputation before cross-validation a serious leakage problem?

Global imputation is minor leakage, inflating F1 by roughly 0.6%, but it is still technically incorrect. Imputation values should be computed independently within each validation fold to eliminate the bias.

What citation is required when referencing CRISP-DM methodology?

CRISP-DM must always be co-cited with its original papers: Shearer (2000) or Wirth & Hipp (2000). Citing CRISP-DM alone without the original sources violates academic citation practice.