Logo de Ml Shap

Ml Shap

Comunidade
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.

Visão geral

Publicado porFrom-zero-tohero
RepositórioML-SHAP-Skill
Nome da habilidademl-shap
Estrelas
57
Forks
6
Arquivos incluídos
3
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Arquivos incluídos: 3

    Scripts, templates e referências que o modelo pode ler enquanto trabalha. Os arquivos são somente para leitura e nunca são executados.

  • Código aberto

    Publicada por From-zero-tohero no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Ml Shap no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/From-zero-tohero/ML-SHAP-Skill/tree/main/ml-shap
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse 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
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Ml Shap em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Ml Shap automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Ml Shap não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo 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.

Arquivos incluídos

O modelo lê esses arquivos sob demanda enquanto a habilidade está carregada. Eles são disponibilizados para leitura e nunca são executados.

Perguntas frequentes

O que a habilidade de IA Ml Shap faz?

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.

Por que usar Ml Shap no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Ml Shap é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Ml Shap no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/From-zero-tohero/ML-SHAP-Skill/tree/main/ml-shap. O TypingMind lê o arquivo SKILL.md, reúne os arquivos da habilidade e a instala para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Ml Shap?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Ml Shap?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Ml Shap com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Ml Shap é gratuita?

A habilidade é publicada no GitHub por From-zero-tohero. Consulte os termos de licenciamento no repositório. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇