Logo vun Ml Shap

Ml Shap

Communautéit
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.

Iwwersiicht

EditeurFrom-zero-tohero
RepositoryML-SHAP-Skill
Skill-Nummml-shap
Stären
57
Forks
6
Matgeliwwert Fichieren
3
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 3 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum From-zero-tohero op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Ml Shap an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/From-zero-tohero/ML-SHAP-Skill/tree/main/ml-shap
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Ml Shap an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Ml Shap automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Ml Shap net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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.

Firwat Ml Shap op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Ml Shap besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Ml Shap an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/From-zero-tohero/ML-SHAP-Skill/tree/main/ml-shap an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Ml Shap benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Ml Shap benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Ml Shap domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Ml Shap gratis?

De Skill gëtt vum From-zero-tohero op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇