Ml Shap logo

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.

Overview

PublisherFrom-zero-tohero
RepositoryML-SHAP-Skill
Skill nameml-shap
Stars
57
Forks
6
Bundled files
3
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by From-zero-tohero on GitHub. Read the source before you install it.

Installation

Install the Ml Shap AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/From-zero-tohero/ML-SHAP-Skill/tree/main/ml-shap
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ml Shap in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ml Shap on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ml Shap is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Ml Shap AI skill do?

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.

Why use Ml Shap on TypingMind?

Because you install it once and use it with any model. Ml Shap is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ml Shap in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/From-zero-tohero/ML-SHAP-Skill/tree/main/ml-shap. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Ml Shap?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ml Shap?

As many as you like. As long as a model supports skills, you can use Ml Shap with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ml Shap AI skill free?

It is published on GitHub by From-zero-tohero. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇