SHAP values quantify the contribution of each feature to a specific model prediction by computing Shapley values from cooperative game theory. The method fairly distributes the prediction difference from the average model output among the input features, ensuring that the sum of all feature attributions equals the exact difference between the model's prediction for that instance and the baseline expected value.
Glossary
SHAP Values

What are SHAP Values?
SHAP (SHapley Additive exPlanations) is a game-theoretic framework for interpreting machine learning model predictions by assigning each feature an importance value for a particular prediction.
In financial fraud anomaly detection, SHAP values enable investigators to understand precisely why a transaction was flagged. For example, a high SHAP value for transaction_amount and time_since_last_txn provides auditable, regulator-ready justification for a block decision. The framework is model-agnostic, working with tree-based models like XGBoost and deep learning architectures, and includes specialized implementations such as TreeSHAP for fast, exact computations on gradient-boosted trees.
Key Properties of SHAP Values
SHAP (SHapley Additive exPlanations) values decompose a model's prediction into the marginal contribution of each feature, ensuring a fair, consistent, and theoretically grounded attribution of importance.
Local Accuracy
The sum of all feature attributions plus the base value (average model output) always equals the model's actual prediction for that specific instance. This property guarantees that the explanation is a complete and faithful decomposition of the output, leaving no residual variance unaccounted for.
- Mathematical Guarantee: f(x) = φ₀ + Σᵢ φᵢ
- Practical Meaning: You can literally add up the SHAP values to reconstruct the prediction score.
- Contrast: Unlike LIME, which fits a local surrogate that may not perfectly match the original prediction, SHAP is an exact additive decomposition.
Missingness
A feature that is not present in the input (i.e., its value is missing or it was not used by the model) is guaranteed to receive a SHAP value of zero. This prevents the explanation from arbitrarily assigning importance to features that did not influence the decision.
- Zero Attribution: If xᵢ is absent, φᵢ = 0.
- Structural Integrity: Ensures that the explanation respects the actual feature space used by the model.
- Implementation Note: This is handled by manipulating the feature's value to a background dataset reference during the estimation process.
Consistency
If a model is changed so that a feature's contribution increases or stays the same regardless of other inputs, the SHAP value for that feature cannot decrease. This ensures that explanations are logically stable and that a feature's attributed importance monotonically tracks its true impact.
- Monotonicity: If a feature becomes more important to the model, its SHAP value must reflect that.
- Model Comparison: This property is critical for comparing two different models and trusting that a higher SHAP value genuinely means a larger effect.
- Violation Example: Gain-based feature importance in tree models can violate this, making SHAP a more reliable alternative.
Model Agnosticism
SHAP is a unified framework that connects game theory with local explanations. While it has model-specific fast implementations (TreeSHAP, DeepSHAP, LinearSHAP), the core KernelSHAP algorithm is fully model-agnostic and can explain any black-box function.
- KernelSHAP: Uses a weighted linear regression on coalitions of features to estimate Shapley values for any model.
- TreeSHAP: An exact, polynomial-time algorithm for tree-based models (XGBoost, LightGBM, Random Forest) that computes SHAP values without sampling error.
- DeepSHAP: A high-speed approximation for deep learning models that combines SHAP with DeepLIFT.
Interaction Values
Beyond individual feature effects, SHAP can decompose predictions into Shapley interaction values. These capture the synergistic or antagonistic effect between pairs of features that cannot be explained by their individual contributions alone.
- Pairwise Effects: φᵢⱼ represents the pure interaction effect between feature i and feature j.
- Fraud Use Case: In transaction monitoring, an interaction between a high transaction amount and a sudden change in device fingerprint might have a disproportionately large effect that individual SHAP values miss.
- Visualization: SHAP dependence plots can be colored by an interacting feature to visually reveal these non-linear synergies.
Global Interpretability
While SHAP values are locally computed for a single prediction, aggregating them across a dataset provides powerful global insights. A SHAP summary plot combines feature importance and feature effects into a single visualization.
- Mean |SHAP|: The average absolute SHAP value for a feature indicates its global importance.
- Feature Density: The spread of SHAP values reveals how a feature's impact varies across the population.
- Directionality: The sign of the SHAP value shows whether a feature pushes the prediction higher or lower, distinguishing it from purely magnitude-based importance metrics.
SHAP vs. Other Feature Importance Methods
A comparison of SHAP values against other common feature attribution methods used in financial fraud detection models, highlighting key differences in theoretical guarantees, consistency, and practical utility.
| Feature | SHAP | Permutation Importance | Gini/Default Importance |
|---|---|---|---|
Theoretical Foundation | Game-theoretic Shapley values | Empirical performance degradation | Impurity reduction during training |
Local Explanations (Single Prediction) | |||
Global Explanations (Aggregate) | |||
Consistency Guarantee | |||
Handles Correlated Features Correctly | |||
Model Agnostic | |||
Computational Cost (Relative) | High | Medium | Low |
Direction of Impact (Sign) |
SHAP Values in Financial Fraud Detection
SHAP (SHapley Additive exPlanations) is a game-theoretic approach to explain the output of any machine learning model by computing the contribution of each feature to a specific prediction. In financial fraud detection, SHAP values provide the granular, auditable reasoning required to justify blocking a transaction to regulators and customers.
The Core Mechanism: Shapley Values
SHAP borrows from cooperative game theory to assign a fair payout to each feature for a prediction. It calculates the marginal contribution of a feature by comparing the model's output with and without that feature, averaged over all possible subsets of features. This ensures the sum of all feature attributions equals the difference between the actual prediction and the average prediction. For a fraud model, this means the exact dollar amount of a transaction's risk score can be decomposed and assigned to specific drivers like transaction amount, device fingerprint mismatch, or velocity of recent logins.
Local vs. Global Interpretability
SHAP operates on two critical levels for fraud analysis:
- Local Explanations: Explain a single prediction. Why was this specific transaction flagged? A force plot can show that a high cross-border transfer amount pushed the risk score up by 0.4, while a recognized device ID pushed it down by 0.1.
- Global Explanations: Aggregate local explanations to understand overall model behavior. A summary plot reveals that transaction amount is the most impactful feature globally, but time since last password change has a long tail of high-impact outliers, indicating its role in catching account takeover fraud.
SHAP vs. Other Feature Importance Methods
Unlike permutation importance, which measures a feature's overall impact on model performance, or built-in Gini importance from tree models, SHAP provides consistent, individualized explanations. Key advantages:
- Consistency: If a model relies more on a feature, its SHAP value magnitude will not decrease.
- Accuracy: SHAP respects feature interactions. Two features like transaction amount and account age might have a synergistic effect that simpler additive methods miss.
- Model-Agnostic: KernelSHAP works with any model, while TreeSHAP is optimized for tree-based ensembles like XGBoost and LightGBM, which are common in fraud detection.
Regulatory Compliance and Model Auditing
Financial regulators increasingly require adverse action reasons for automated credit and fraud decisions. SHAP values provide a mathematically sound basis for generating these reasons. For a declined transaction, the explanation can be automatically generated: 'This transaction was blocked due to an unusually high transaction amount relative to the account's 30-day average and a device location inconsistent with the cardholder's home address.' This bridges the gap between a black-box deep learning model and the right to explanation mandated by regulations like GDPR and the Fair Credit Reporting Act (FCRA).
Detecting Model Bias and Data Leakage
Global SHAP analysis is a powerful debugging tool. If a protected attribute like geographic region or a proxy for it shows unexpectedly high SHAP importance, it signals potential bias requiring investigation. Similarly, if a feature like transaction ID or a highly granular user agent string has a dominant SHAP value, it strongly indicates data leakage—the model is memorizing identifiers rather than learning generalizable fraud patterns. This allows MLOps teams to catch critical flaws before a model is deployed to production.
Computational Considerations with TreeSHAP
Calculating exact Shapley values is computationally exponential. However, TreeSHAP, a variant specific to tree-based models, reduces the complexity to O(TLD^2) where T is the number of trees, L is the maximum number of leaves, and D is the maximum tree depth. This makes it feasible to generate explanations in milliseconds for real-time fraud scoring pipelines. For deep learning models used in sequence-based fraud detection, DeepSHAP uses a linear composition rule to approximate SHAP values by backpropagating attributions through the network layers.
Frequently Asked Questions
Clear, technically precise answers to the most common questions about SHapley Additive exPlanations for machine learning model interpretability.
SHAP (SHapley Additive exPlanations) values are a game-theoretic approach to explain the output of any machine learning model by computing the contribution of each feature to a specific prediction. The method is rooted in Shapley values from cooperative game theory, where the 'game' is the prediction task and the 'players' are the input features. SHAP works by considering all possible subsets of features and calculating the marginal contribution of a feature when it is added to a subset. The final SHAP value for a feature is the weighted average of its marginal contributions across all possible feature coalitions. This ensures a mathematically fair distribution of the prediction among the features, satisfying properties of local accuracy, missingness, and consistency. For a fraud detection model, a SHAP value tells you exactly how much a specific transaction feature—like transaction amount or time since last login—pushed the model's risk score higher or lower than the average prediction.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Core concepts that contextualize SHAP values within the broader landscape of model interpretability and feature attribution.
LIME (Local Interpretable Model-agnostic Explanations)
A precursor to SHAP that explains individual predictions by approximating the complex model locally with an interpretable surrogate model. Key differences from SHAP:
- Perturbs input data around the prediction to create a local neighborhood
- Fits a sparse linear model to the perturbed samples
- Does not guarantee the Shapley axioms of consistency and additivity
- Computationally lighter but less theoretically rigorous for feature attribution
- Often used as a faster alternative when exact Shapley values are prohibitively expensive
Permutation Importance
A global feature importance method that measures the decrease in model performance when a feature's values are randomly shuffled. Contrast with SHAP:
- Measures overall feature impact across the entire dataset, not per-prediction
- Does not reveal directionality (whether a feature pushes prediction higher or lower)
- Computationally efficient but can be misleading when features are correlated
- SHAP decomposes individual predictions; permutation importance aggregates model-level effects
- Both are model-agnostic and can be applied to any fitted estimator
Partial Dependence Plots (PDP)
A visualization technique showing the marginal effect of one or two features on the predicted outcome. Relationship to SHAP:
- PDPs average over the effects of all other features, showing a global trend
- SHAP dependence plots show the exact feature contribution per instance, colored by interaction effects
- PDPs can hide heterogeneous effects that SHAP reveals through vertical dispersion
- Combining PDP with SHAP values provides both aggregated trends and instance-level nuance
- Both assume feature independence for accurate interpretation
Tree SHAP
A polynomial-time algorithm that computes exact Shapley values for tree-based models (XGBoost, LightGBM, CatBoost, Random Forests). Advantages over Kernel SHAP:
- Exploits the internal tree structure to reduce complexity from O(2^M) to O(TLD²)
- Computes SHAP interaction values directly, quantifying pairwise feature interactions
- Returns consistent, deterministic results without sampling variance
- Integrated natively into XGBoost and LightGBM via their predict methods
- The default choice for gradient-boosted fraud detection models
SHAP Interaction Values
An extension of SHAP that decomposes predictions into main effects and pairwise interaction effects. Key properties:
- Captures synergies where two features together influence predictions beyond their individual contributions
- The SHAP value for a feature equals its main effect plus half of all its interaction effects
- Visualized as a matrix or dependence plot with color-coded interaction strength
- Critical for fraud detection where combinations of features (e.g., high amount + unusual time) trigger alerts
- Computationally more expensive than standard SHAP values
Shapley Values (Game Theory Origin)
The foundational concept from cooperative game theory that SHAP adapts. Original formulation by Lloyd Shapley (1953):
- Distributes the total payout of a coalition game fairly among players based on their marginal contributions
- Satisfies four axioms: Efficiency (sum equals total gain), Symmetry (identical contributions get equal payouts), Dummy (zero contribution gets zero), Additivity (combined games sum correctly)
- SHAP maps features to players and model prediction to the payout
- The only attribution method proven to satisfy all four axioms simultaneously
- Nobel Prize in Economics (2012) recognized Shapley's foundational work

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us