SHAP Value Calculator

Calculate local and global SHAP contributions, validate additivity, compare features, explore coalitions, visualise impacts, and export clear machine learning explanations instantly online with confidence.

Calculation results

Results appear here after calculation.

Ready
Model prediction
Expected output
Total SHAP contribution
Additivity difference
Strongest positive
Strongest negative
Most influential
Features analysed

Feature contribution chart

Baseline-to-prediction waterfall

Rank Feature Value SHAP value Absolute value Contribution Direction Running output
No results yet.

Model and explanation settings

Background and reference settings

Feature contributions

Enter each feature value and its SHAP contribution.

Coalition outputs

Provide model outputs for every subset. Use comma-separated feature numbers.

Exact calculation is limited to ten features.

Global SHAP matrix analysis

Paste a CSV matrix. The first row must contain feature names. Each following row must contain SHAP values.

Interaction values

Optional pairwise effects support interaction ranking.

Display and filtering options

Use zero to show every feature.

Formula used

SHAP explanations use an additive model. The prediction equals the expected output plus all feature contributions. This identity supports direct additivity validation.

f(x) = φ₀ + Σ φᵢ

φᵢ = Σ [ |S|! (M - |S| - 1)! / M! ] × [ f(S ∪ {i}) - f(S) ]

Here, φ₀ is the expected model output. Each φᵢ measures one feature’s marginal contribution. Coalition weights average effects across possible feature orders.

How to use

  1. Select regression or classification.
  2. Choose the model output scale.
  3. Enter the expected model output.
  4. Add each feature and SHAP value.
  5. Optionally add pairwise interactions.
  6. Set filtering and precision options.
  7. Calculate and review additivity.
  8. Export the table when needed.

Example data

FeatureObserved valueSHAP valueInterpretation
Income620002.1Raises the prediction.
Age340.7Raises the prediction.
Debt ratio0.31-0.9Lowers the prediction.
Account tenure5.21.3Raises the prediction.

Interpretation guide

A positive SHAP value moves the output above its baseline. A negative value moves the output below its baseline. Larger absolute values indicate stronger influence.

Probability explanations should remain within zero and one. Log-odds values require conversion before probability interpretation. Correlated features can divide or redistribute apparent influence.

Local explanations describe one observation. Global importance aggregates many observations using absolute SHAP values. Always compare explanations with model behaviour.

Frequently asked questions

What is a SHAP value?

It estimates how one feature changes a prediction from the expected model output.

Why must SHAP values add up?

The additive explanation reconstructs the prediction from the baseline and feature contributions.

What does a negative SHAP value mean?

It means the feature pushes the explained output lower than it otherwise would be.

Can SHAP explain classification probabilities?

Yes, when the explainer returns probability-scale values or values converted from log-odds.

What is the expected value?

It is the average model output over the selected background or reference dataset.

What is global SHAP importance?

It is commonly the mean absolute SHAP value across many observations.

Why do correlated features cause issues?

Their shared information can make attribution depend strongly on background assumptions.

When should exact coalitions be used?

Use them for small feature sets because subset counts grow exponentially.

Does this replace a model explainer library?

No. It validates, explores, and calculates supplied outputs without loading trained models.

Related Calculators

Gradient Descent CalculatorStochastic Gradient Descent CalculatorMomentum Optimiser CalculatorAdam Optimiser CalculatorLearning Rate Decay CalculatorK-Nearest Neighbours CalculatorKNN Majority Vote CalculatorQ-Learning Update CalculatorMulti-Armed Bandit CalculatorModel Calibration Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.