Inferensys

Glossary

Baseline Value

The expected model output across the background dataset, representing the prediction when no feature information is known and serving as the anchor point for additive feature attributions.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
SHAP REFERENCE POINT

What is Baseline Value?

The baseline value is the expected model prediction across a background dataset, representing the output when no feature information is available.

The baseline value is the model's average prediction over a representative background dataset, serving as the starting point for SHAP explanations. It represents the expected output when all features are missing or unknown. In the additive feature attribution framework, individual Shapley values quantify how each feature pushes the prediction away from this reference point toward the actual model output for a specific instance.

Selecting an appropriate baseline is critical for meaningful explanations. A poorly chosen background dataset can produce attributions that violate the efficiency property, where the sum of feature contributions no longer equals the difference between the prediction and the baseline. Common choices include the training data mean prediction or a cluster centroid, with the selection directly impacting whether SHAP reflects interventional or observational conditional expectations.

FOUNDATIONAL CONCEPT

Key Properties of the Baseline Value

The baseline value serves as the anchor point for all SHAP explanations. It represents the model's expected output when no feature information is available, providing the reference from which all feature contributions are measured.

01

Definition and Mathematical Role

The baseline value is the expected model prediction over the background dataset. Formally, it is the average prediction when all features are missing: E[f(x)] where the expectation is taken over the background distribution.

  • Acts as the intercept term in the additive explanation model
  • Represents the prediction before any feature information is known
  • Every SHAP value measures deviation from this baseline
E[f(x)]
Mathematical Notation
02

Efficiency Property Connection

The Efficiency Property of Shapley values guarantees that the sum of all feature attributions plus the baseline value exactly equals the model's prediction for any instance.

  • f(x) = baseline + Σ SHAP values
  • Ensures complete decomposition of the prediction
  • No unexplained residual remains
  • Critical for auditability in regulated industries
100%
Attribution Coverage
03

Background Dataset Selection

The baseline value depends critically on the background dataset used to compute it. This dataset represents the distribution of 'missing' feature values.

  • Training data mean: Most common choice, represents average case
  • Median sample: Robust to outliers in skewed distributions
  • Domain-specific reference: A clinically normal patient, a zero-signal state
  • K-means centroids: Multiple baselines for clustered data
  • The choice directly impacts SHAP value interpretation
K-means
Multi-Baseline Method
04

Waterfall Plot Anchor

In a SHAP waterfall plot, the baseline value appears as the starting point at the bottom of the chart. Each feature's SHAP value is then stacked sequentially, pushing the prediction upward or downward.

  • E[f(x)] sits at the base of the waterfall
  • Red arrows push above the baseline (positive contribution)
  • Blue arrows push below the baseline (negative contribution)
  • The final bar equals f(x), the actual prediction
  • Provides intuitive visual decomposition for single-instance explanations
05

Interventional vs. Observational Baseline

The method of computing the baseline distinguishes two SHAP formulations:

  • Interventional SHAP: Breaks feature correlations by sampling from the marginal distribution. The baseline is the unconditional expectation. Reflects causal 'what-if' interventions.
  • Observational SHAP: Preserves correlations by conditioning on observed features. The baseline respects the joint distribution. Reflects model behavior on the natural data manifold.
  • The choice affects how correlated features are attributed
06

Practical Implementation

In the SHAP library, the baseline value is computed automatically from the background dataset passed to the Explainer object.

  • shap.Explainer(model, background_data) computes E[f(x)] internally
  • For TreeSHAP, the background dataset also defines the feature splitting paths
  • For DeepSHAP, a single reference sample or mean is often used
  • The base_value attribute of a SHAP explanation object stores this value
  • Can be accessed via explanation.base_values for inspection
BASELINE VALUE CLARIFIED

Frequently Asked Questions

Clear answers to common questions about the role and mechanics of the baseline value in SHAP explanations.

The baseline value is the expected model output averaged over the entire background dataset. It represents the model's prediction when no feature information is known for a specific instance. In the additive feature attribution framework, the baseline serves as the starting point—the prediction you would make if all features were missing. Every SHAP value then quantifies how much a specific feature pushes the prediction away from this baseline. Mathematically, the baseline is the intercept term in the explanation model, ensuring the Efficiency Property holds: the sum of all SHAP values plus the baseline exactly equals the model's actual prediction for the instance being explained.

Prasad Kumkar

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.