Inferensys

Glossary

Individual Conditional Expectation

A disaggregated visualization technique that plots the functional relationship between a feature and the prediction for every single instance, revealing heterogeneous effects hidden by partial dependence plots.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
HETEROGENEOUS EFFECT VISUALIZATION

What is Individual Conditional Expectation?

A disaggregated visualization technique that plots the functional relationship between a feature and the prediction for every single instance, revealing heterogeneous effects hidden by partial dependence plots.

Individual Conditional Expectation (ICE) is a model-agnostic visualization method that plots one line per instance, showing how an individual prediction changes as a single feature varies while holding all other features constant. Unlike Partial Dependence Plots (PDP), which display an averaged marginal effect, ICE plots explicitly reveal heterogeneous treatment effects and interaction-driven divergences across a dataset.

An ICE plot is generated by taking each instance in a dataset, creating a grid of values for the feature of interest, and recording the model's prediction for each grid value while keeping the instance's other features fixed. A centered ICE plot, or c-ICE, subtracts the initial prediction from each curve to align them at the origin, making it easier to visually identify clusters of instances that respond differently to the same feature change.

DISAGGREGATED VISUALIZATION

Key Characteristics of ICE Plots

Individual Conditional Expectation (ICE) plots decompose a Partial Dependence Plot into its constituent parts, revealing heterogeneous effects and interactions that are averaged away in aggregate views.

01

Instance-Level Disaggregation

Unlike a Partial Dependence Plot (PDP) which shows a single average line, an ICE plot draws one line per instance in the dataset. Each line represents the change in that specific instance's prediction as the feature of interest is varied. This reveals heterogeneous treatment effects where the functional form differs across subgroups, preventing the ecological fallacy of assuming the average effect applies to all individuals.

02

Centered ICE (c-ICE) for Effect Comparison

A variant called Centered ICE subtracts each curve's value at a chosen anchor point (often the minimum feature value). This forces all curves to originate at zero, making it easier to compare the relative change in prediction across instances. c-ICE is particularly useful when the absolute prediction levels vary widely across instances, obscuring the shape of the partial relationship.

03

Derivative ICE (d-ICE) for Interaction Detection

Derivative ICE plots the partial derivative of the prediction with respect to the feature for each instance. If all d-ICE curves are flat and identical, there is no interaction between the feature of interest and other features. Substantial variation in the slopes of d-ICE curves visually confirms the presence of feature interactions that a standard PDP would completely mask.

04

Computational Mechanism

To generate an ICE plot for feature (X_S):

  • For each instance (i), hold all other features (x_C^{(i)}) constant at their observed values.
  • Create a grid of values for (X_S).
  • Predict (\hat{f}(x_S, x_C^{(i)})) for each grid point.
  • Plot the resulting curve. This is repeated for every instance, creating a grid of counterfactual predictions that shows how each individual's outcome would change under different values of (X_S).
05

Visual Clustering for Subgroup Discovery

When ICE plots reveal distinct clusters of curves with different slopes or shapes, this indicates the presence of latent subgroups in the data. For example, in a medical risk model, increasing age might increase risk for most patients but decrease it for a specific subgroup with a particular genetic marker. Visual inspection of ICE curves can guide subsequent subgroup analysis and feature engineering.

06

Limitations and Scalability

ICE plots become visually overwhelming with more than a few hundred instances, requiring subsampling or transparency techniques. They also suffer from the same extrapolation risk as PDPs when the feature of interest is correlated with other features—the held-constant values (x_C^{(i)}) may represent unrealistic combinations. Additionally, ICE plots only visualize one or two features at a time, limiting their ability to capture higher-order interactions.

ICE PLOTS EXPLAINED

Frequently Asked Questions

Individual Conditional Expectation (ICE) plots disaggregate the global view of Partial Dependence Plots to reveal heterogeneous relationships between a feature and the model's prediction for every single instance in a dataset.

An Individual Conditional Expectation (ICE) plot is a disaggregated visualization technique that plots the functional relationship between a specific input feature and the model's prediction for each individual instance in a dataset. Unlike a Partial Dependence Plot (PDP) which averages the effect across all instances into a single line, an ICE plot draws one line per instance. The algorithm works by taking a single observation, holding all other feature values constant, and systematically varying the target feature across its range of values to record how the prediction changes. This process is repeated for every instance, generating a dense set of curves. The average of all ICE curves recovers the PDP, making ICE a strictly more informative superset of partial dependence. This technique is essential for detecting heterogeneous treatment effects and interaction effects that are completely invisible in the averaged PDP curve.

VISUALIZATION COMPARISON

ICE vs. Partial Dependence Plots

Key differences between Individual Conditional Expectation curves and Partial Dependence Plots for understanding feature effects on model predictions.

FeatureICE PlotsPartial Dependence Plots

Granularity

Instance-level curves for every observation

Single global average curve

Heterogeneous effects

Directly visible via divergent curves

Masked by averaging

Interaction detection

Revealed by crossing or non-parallel curves

Hidden unless explicitly plotted (2D PDP)

Computational cost

Higher; requires one prediction per instance per grid point

Lower; averages predictions across all instances per grid point

Visual clutter risk

High with large datasets; requires centering or subsampling

Low; single clean line

Centered ICE variant

Subtracts a fixed point to align curves and highlight heterogeneity

Not applicable

Bias under correlated features

Inherits PDP bias; extrapolates in sparse regions

Suffers from same extrapolation bias

Primary use case

Diagnosing when PDP average is misleading

Summarizing marginal feature effect globally

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.