/ds:target-leakage-detectionfrom ds
Detect target leakage in feature sets by checking temporal validity, feature-target correlation, and information flow. Run before training any model.
Ships in ds. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Detect data leakage that would inflate model performance during development but fail in production.
For each feature, verify it would be available at prediction time:
outcome_date when predicting outcome)Check: For each feature, ask: "At the moment we need to make a prediction, would this value already be known?" If no, it's leakage.
Check for features that are transformations of the target:
cancellation_reason when predicting churn)revenue_bucket when predicting revenue)Check: If removing this feature drops model performance by >50%, it may be a proxy for the target.
Flag when any of these occur:
| Signal | Classification Threshold | Regression Threshold |
|---|---|---|
| Single feature AUC | > 0.95 | N/A |
| Single feature R-squared | N/A | > 0.95 |
| Feature importance dominated by 1 feature | >50% of total importance | >50% of total importance |
| Train and test performance nearly identical | Gap < 0.5% | Gap < 0.5% |
Check: Run single-feature models. Any feature with AUC > 0.95 or R-squared > 0.95 warrants investigation.
Check for information leaking across the train/test boundary:
Check: Verify that train_ids.intersection(test_ids) is empty for all entity identifiers.
For each detected leakage:
import pandas as pd
from sklearn.metrics import roc_auc_score
def check_leakage(df, target_col, feature_cols):
"""Flag features with suspiciously high single-feature AUC."""
results = []
for col in feature_cols:
if df[col].dtype in ['float64', 'int64']:
try:
auc = roc_auc_score(df[target_col], df[col])
auc = max(auc, 1 - auc) # Handle inverse correlation
if auc > 0.95:
results.append({'feature': col, 'auc': auc, 'risk': 'HIGH'})
elif auc > 0.85:
results.append({'feature': col, 'auc': auc, 'risk': 'MEDIUM'})
except Exception:
pass
return pd.DataFrame(results).sort_values('auc', ascending=False)
What SKILL.md sets; muted values are Claude Code's defaults
19 skills in this plugin
/aeonAeon API patterns for time series machine learning -- classification, regression, clustering, anomaly detection, segmentation, and similarity search. Use when /ds:experiment needs time-series-specific ML algorithms (ROCKET, InceptionTime, DTW classifiers), or /ds:eda needs temporal feature extraction (Catch22, ROCKET features) or change point detection. For classical statistical forecasting (ARIMA/SARIMAX) use statsmodels; for tabular ML pipelines use scikit-learn; for visualization use matplotlib./data-preprocessingPre-model data preparation pipelines for cleaning, validation, transformation, and ETL orchestration. Use when raw data needs deduplication, schema validation, format conversion, or quality assurance before EDA or modeling./data-quality-frameworksGenerated from the plugin's indexed repository (andikarachman/data-science-plugin) — no native marketplace selected
npx claudepluginhub p/andikarachman-dsOther plugins' skills for the same job