Logo di Ml Shap

Ml Shap

Community
From-zero-tohero
ml-shap

Run a complete, leakage-aware machine-learning workflow on CSV or Excel tabular data when the user identifies input features, one output feature, and optionally a date, group, region, or ID column. Use for regression or classification tasks requiring data audits, defensible train/test splitting, baseline and nonlinear model comparison, tuning, out-of-sample evaluation, SHAP interpretation, nonlinear thresholds, interactions, robustness checks, publication-ready figures and tables, a reproducible script, and a written results report.

Panoramica

Pubblicato daFrom-zero-tohero
RepositoryML-SHAP-Skill
Nome della skillml-shap
Stelle
57
Fork
6
File inclusi
3
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 3

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da From-zero-tohero su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Ml Shap in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/From-zero-tohero/ML-SHAP-Skill/tree/main/ml-shap
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/From-zero-tohero/ML-SHAP-Skill.git /tmp/ML-SHAP-Skill
mkdir -p .claude/skills
cp -r /tmp/ML-SHAP-Skill/ml-shap .claude/skills/ml-shap
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Ml Shap in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Ml Shap non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Ml Shap non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

ML-SHAP

Execute the analysis rather than only describing it. Preserve the source file and write all deliverables to a separate output directory.

Collect the specification

Obtain or infer:

  • source file and worksheet;
  • output column;
  • input columns;
  • regression or classification task;
  • date/time, group, region, and ID columns;
  • forecast horizon if the user means future prediction;
  • positive class and primary metric for classification;
  • research focus, such as a focal variable or expected threshold.

Ask only when a missing choice materially changes the scientific question. Otherwise infer safely and record the assumption.

Audit before modeling

Check schema, sample count, date range, duplicates, missingness, infinities, constant columns, data types, target distribution, category cardinality, outliers, class balance, and suspiciously high target correlations.

Detect leakage explicitly:

  • exclude IDs, post-outcome variables, target-derived fields, and future information;
  • distinguish same-period estimation from genuine forecasting;
  • if a feature is almost identical to the target, retain it only when requested and add an exclusion sensitivity analysis;
  • fit imputers, scalers, encoders, feature selection, and resampling inside the training pipeline only.

Stop and explain if the target is unusable. Otherwise continue.

Choose validation from the data structure

Never default blindly to random splitting.

  • Time or forecast task: sort chronologically, reserve the latest 15–25% as an untouched test set, and tune with expanding-window or rolling validation. Lag predictors according to the forecast horizon.
  • Repeated groups, people, firms, cities, or sites: use group holdout or grouped cross-validation.
  • Spatial generalization: prefer spatial blocks or region holdout.
  • Ordinary IID regression: use shuffled K-fold validation with a fixed seed.
  • IID classification: use stratified splits; use stratified-group validation when both class and group structure exist.

Keep the final test set untouched until model selection is finished. Report exact split dates or group rules.

Build and compare models

Always include a naive baseline and an interpretable linear baseline.

For regression, consider:

  • mean/median or persistence baseline;
  • linear regression, Ridge, or Elastic Net;
  • random forest and Extra Trees;
  • gradient boosting, XGBoost, LightGBM, or CatBoost when available;
  • SVR or neural models only when justified by scale and structure.

For classification, consider:

  • majority or prior baseline;
  • logistic regression;
  • random forest and Extra Trees;
  • gradient boosting, XGBoost, LightGBM, or CatBoost;
  • calibrated probabilities when decisions depend on risk scores.

Tune only competitive model families using the selected cross-validation design. Prefer randomized or Bayesian search to wasteful grids. Fix seeds and limit parallelism when resources are constrained.

Evaluate out of sample

Regression:

  • primary: RMSE or MAE;
  • also report R² and MAE; report MAPE only when targets are safely away from zero;
  • inspect observed-versus-predicted, residual-versus-predicted, residual distribution, and temporal residuals.

Classification:

  • report confusion matrix, precision, recall, F1, ROC-AUC, and PR-AUC;
  • prioritize PR-AUC, recall, or cost-sensitive metrics for imbalance;
  • show ROC, precision–recall, calibration, and threshold-performance plots;
  • never choose a threshold on the final test set.

Report cross-validation mean and dispersion plus untouched-test performance. Diagnose regime shifts, extrapolation failures, and subgroup errors rather than celebrating a single score.

Explain the selected model

Use SHAP when compatible:

  • TreeExplainer for tree ensembles;
  • LinearExplainer for linear models;
  • model-agnostic explainers only with a justified background sample and manageable computation.

Produce explanations in this order:

  1. global mean absolute SHAP importance;
  2. SHAP beeswarm / 蜂群图(蜂巢图) for feature importance, contribution direction, value distribution, and sample heterogeneity;
  3. dependence plots for key variables, with zero line and defensible smoothing;
  4. SHAP interaction values or interaction dependence for important pairs;
  5. waterfall plots for representative, extreme, correct, and failed predictions;
  6. grouped or temporal SHAP summaries when heterogeneity matters.

Explain predictions on validation/test observations, not only training data. State the SHAP background dataset and class explained.

If SHAP cannot be installed or computed, use permutation importance plus PDP/ALE and label these methods accurately. Never call a substitute “SHAP.” Prefer ALE over PDP when predictors are strongly correlated.

Treat all model explanations as predictive associations. Do not use causal language unless a valid causal design or estimator is added.

Read references/figures-and-tables.md when deciding the output set. Read references/quality-gates.md before finalizing.

Run robustness checks

Include checks proportional to the claim:

  • alternative seeds, folds, cut dates, or holdout groups;
  • removal of suspicious or dominant features;
  • alternative model families;
  • reduced versus full feature sets;
  • class weighting or resampling sensitivity;
  • subgroup and regime performance;
  • lag/horizon variants for forecasts;
  • bootstrap confidence intervals when useful.

Do not interpret unstable ranks or thresholds as substantive findings.

Deliver

Create:

  • an Excel workbook containing data audit, descriptive statistics, correlations, split definition, model comparison, best parameters, robustness results, feature importance, thresholds/interactions, and holdout predictions;
  • publication-ready PNG and vector PDF/SVG figures;
  • a concise Markdown or Word report covering methods, results, limitations, and interpretation boundaries;
  • a reproducible Python or R script plus environment/package information;
  • a machine-readable summary JSON when useful.

Lead the final response with the main result and the most important caveat. Link the report, workbook, script, and output directory.


name: ml-shap description: Run a complete, leakage-aware machine-learning workflow on CSV or Excel tabular data when the user identifies input features, one output feature, and optionally a date, group, region, or ID column. Use for regression or classification tasks requiring data audits, defensible train/test splitting, baseline and nonlinear model comparison, tuning, out-of-sample evaluation, SHAP interpretation, nonlinear thresholds, interactions, robustness checks, publication-ready figures and tables, a reproducible script, and a written results report.

ML-SHAP

Execute the analysis rather than only describing it. Preserve the source file and write all deliverables to a separate output directory.

Collect the specification

Obtain or infer:

  • source file and worksheet;
  • output column;
  • input columns;
  • regression or classification task;
  • date/time, group, region, and ID columns;
  • forecast horizon if the user means future prediction;
  • positive class and primary metric for classification;
  • research focus, such as a focal variable or expected threshold.

Ask only when a missing choice materially changes the scientific question. Otherwise infer safely and record the assumption.

Audit before modeling

Check schema, sample count, date range, duplicates, missingness, infinities, constant columns, data types, target distribution, category cardinality, outliers, class balance, and suspiciously high target correlations.

Detect leakage explicitly:

  • exclude IDs, post-outcome variables, target-derived fields, and future information;
  • distinguish same-period estimation from genuine forecasting;
  • if a feature is almost identical to the target, retain it only when requested and add an exclusion sensitivity analysis;
  • fit imputers, scalers, encoders, feature selection, and resampling inside the training pipeline only.

Stop and explain if the target is unusable. Otherwise continue.

Choose validation from the data structure

Never default blindly to random splitting.

  • Time or forecast task: sort chronologically, reserve the latest 15–25% as an untouched test set, and tune with expanding-window or rolling validation. Lag predictors according to the forecast horizon.
  • Repeated groups, people, firms, cities, or sites: use group holdout or grouped cross-validation.
  • Spatial generalization: prefer spatial blocks or region holdout.
  • Ordinary IID regression: use shuffled K-fold validation with a fixed seed.
  • IID classification: use stratified splits; use stratified-group validation when both class and group structure exist.

Keep the final test set untouched until model selection is finished. Report exact split dates or group rules.

Build and compare models

Always include a naive baseline and an interpretable linear baseline.

For regression, consider:

  • mean/median or persistence baseline;
  • linear regression, Ridge, or Elastic Net;
  • random forest and Extra Trees;
  • gradient boosting, XGBoost, LightGBM, or CatBoost when available;
  • SVR or neural models only when justified by scale and structure.

For classification, consider:

  • majority or prior baseline;
  • logistic regression;
  • random forest and Extra Trees;
  • gradient boosting, XGBoost, LightGBM, or CatBoost;
  • calibrated probabilities when decisions depend on risk scores.

Tune only competitive model families using the selected cross-validation design. Prefer randomized or Bayesian search to wasteful grids. Fix seeds and limit parallelism when resources are constrained.

Evaluate out of sample

Regression:

  • primary: RMSE or MAE;
  • also report R² and MAE; report MAPE only when targets are safely away from zero;
  • inspect observed-versus-predicted, residual-versus-predicted, residual distribution, and temporal residuals.

Classification:

  • report confusion matrix, precision, recall, F1, ROC-AUC, and PR-AUC;
  • prioritize PR-AUC, recall, or cost-sensitive metrics for imbalance;
  • show ROC, precision–recall, calibration, and threshold-performance plots;
  • never choose a threshold on the final test set.

Report cross-validation mean and dispersion plus untouched-test performance. Diagnose regime shifts, extrapolation failures, and subgroup errors rather than celebrating a single score.

Explain the selected model

Use SHAP when compatible:

  • TreeExplainer for tree ensembles;
  • LinearExplainer for linear models;
  • model-agnostic explainers only with a justified background sample and manageable computation.

Produce explanations in this order:

  1. global mean absolute SHAP importance;
  2. SHAP beeswarm for magnitude, direction, and heterogeneity;
  3. dependence plots for key variables, with zero line and defensible smoothing;
  4. SHAP interaction values or interaction dependence for important pairs;
  5. waterfall plots for representative, extreme, correct, and failed predictions;
  6. grouped or temporal SHAP summaries when heterogeneity matters.

Explain predictions on validation/test observations, not only training data. State the SHAP background dataset and class explained.

If SHAP cannot be installed or computed, use permutation importance plus PDP/ALE and label these methods accurately. Never call a substitute “SHAP.” Prefer ALE over PDP when predictors are strongly correlated.

Treat all model explanations as predictive associations. Do not use causal language unless a valid causal design or estimator is added.

Read references/figures-and-tables.md when deciding the output set. Read references/quality-gates.md before finalizing.

Run robustness checks

Include checks proportional to the claim:

  • alternative seeds, folds, cut dates, or holdout groups;
  • removal of suspicious or dominant features;
  • alternative model families;
  • reduced versus full feature sets;
  • class weighting or resampling sensitivity;
  • subgroup and regime performance;
  • lag/horizon variants for forecasts;
  • bootstrap confidence intervals when useful.

Do not interpret unstable ranks or thresholds as substantive findings.

Deliver

Create:

  • an Excel workbook containing data audit, descriptive statistics, correlations, split definition, model comparison, best parameters, robustness results, feature importance, thresholds/interactions, and holdout predictions;
  • publication-ready PNG and vector PDF/SVG figures;
  • a concise Markdown or Word report covering methods, results, limitations, and interpretation boundaries;
  • a reproducible Python or R script plus environment/package information;
  • a machine-readable summary JSON when useful.

Lead the final response with the main result and the most important caveat. Link the report, workbook, script, and output directory.

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Ml Shap?

Run a complete, leakage-aware machine-learning workflow on CSV or Excel tabular data when the user identifies input features, one output feature, and optionally a date, group, region, or ID column. Use for regression or classification tasks requiring data audits, defensible train/test splitting, baseline and nonlinear model comparison, tuning, out-of-sample evaluation, SHAP interpretation, nonlinear thresholds, interactions, robustness checks, publication-ready figures and tables, a reproducible script, and a written results report.

Perché usare Ml Shap su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Ml Shap è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Ml Shap in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/From-zero-tohero/ML-SHAP-Skill/tree/main/ml-shap. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Ml Shap?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Ml Shap?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Ml Shap: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Ml Shap è gratuita?

È pubblicata su GitHub da From-zero-tohero. Consulta il repository per i termini di licenza. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇