Individual conditional expectation plot

Also known as: ICE · ICE plot · individual conditional expectation

On this page 7

An individual conditional expectation plot, or ICE plot, is a model-agnostic visualization that draws one line per instance showing how a trained model’s prediction changes as a single feature is varied while all other features of that instance stay fixed. In Explainable AI, it serves as the disaggregated counterpart of the partial dependence plot, revealing heterogeneous effects and feature interactions that an average curve hides.

ICE plots were introduced as a refinement of partial dependence analysis for black-box models such as gradient-boosted trees, random forests and neural networks. They answer a local question, how the prediction for this particular case would respond to a change in one input, and stack many such answers into one global picture.

How an ICE plot is computed

The computation is a simple what-if loop over the data. For each instance in a sample, the analyst replaces the value of the feature of interest with every point on a grid of values, keeps the remaining features unchanged, and records the model output. Connecting those outputs produces one ICE curve for that instance.

Formally, for feature j and instance i, the curve is the function that maps a grid value x to the model prediction f(x, x_C^(i)), where x_C^(i) denotes the complementary features of instance i. Averaging all ICE curves pointwise yields exactly the partial dependence function, which is why the two plots are often drawn together.

The table below summarizes the main inputs and how each influences cost and readability.

ParameterTypical choiceEffect
Number of instances100 to 1,000 sampled rowsMore lines, more clutter and compute
Grid resolution20 to 100 pointsFiner curves, linear cost increase
Grid placementQuantiles of the featureAvoids sparse regions
Prediction scaleProbability, logit or raw outputChanges visual size of effects
Centering anchorMinimum grid valueAligns curves for comparison
Main parameters of an ICE plot

The total cost equals the number of instances multiplied by the grid size, so a plot with 500 rows and 50 grid points requires 25,000 model calls. Batching these calls keeps the method practical even for slow models.

Variants: centered and derivative ICE

Raw ICE curves often start at very different heights, which makes it hard to see whether their shapes differ. The centered ICE plot (c-ICE) subtracts each curve’s value at an anchor point, so all lines begin at zero and diverging slopes become obvious. The derivative ICE plot (d-ICE) shows the partial derivative along the grid and highlights where interactions occur.

VariantWhat it showsBest use
Standard ICERaw prediction per instanceSeeing levels and spread
Centered ICE (c-ICE)Change relative to an anchorComparing curve shapes
Derivative ICE (d-ICE)Local slope per instanceLocating interaction regions
Colored ICECurves colored by a second featureIdentifying the interacting feature
ICE with PDP overlayIndividual lines plus the averageContrasting local and global views
ICE plot variants and when to use them

Coloring curves by a second variable is a practical way to diagnose interactions: if curves split into groups that match the colors, the second feature modulates the effect of the first. This visual check complements formal measures such as Friedman’s H-statistic.

ICE plots belong to the family of feature effect methods, and each member makes different assumptions. Partial dependence summarizes, accumulated local effects correct for correlated features, and attribution methods such as Shapley values distribute a single prediction among features rather than tracing a curve.

MethodScopeMain strengthMain weakness
ICE plotLocal curves, shown globallyReveals heterogeneityClutter, unrealistic points
Partial dependence plotGlobal averageSimple to readHides interactions
Accumulated local effectsGlobal, conditionalHandles correlated featuresNo per-instance view
Shapley valueLocal attributionAdditive, axiomaticSingle point, no curve
Permutation feature importanceGlobal rankingModel-agnostic scalarNo direction of effect
ICE plot compared with neighboring methods

In practice, analysts often use these methods together: a permutation importance ranking selects the features worth plotting, ICE plots show how effects vary across instances, and ALE plots confirm the shape when features are strongly correlated.

Reading and using ICE plots well

Interpretation starts with the overall pattern. Parallel curves indicate an additive effect that partial dependence describes adequately, whereas crossing or fanning curves signal interactions or subgroup behavior. Flat curves for most instances combined with steep curves for a few suggest that the feature matters only in a specific region of the data.

  • Plot a random sample of instances, not the full dataset, to keep lines readable.
  • Add a rug plot of observed values to mark where data actually exist.
  • Use centered curves when absolute levels differ widely.
  • Highlight a single instance to support local explanation for one decision.
  • Show results on the probability scale for audiences outside data science.

ICE plots are also useful for model debugging and fairness review. Curves that jump sharply at arbitrary thresholds can reveal overfitting in tree ensembles, and curves split by a protected attribute can expose a model that treats similar cases differently.

Limitations and common pitfalls

The central weakness is extrapolation into unrealistic data. Because the method changes one feature while freezing the others, it can create combinations that never occur, such as a two-meter-tall child, and the model’s output there is not meaningful. This problem grows with feature correlation.

PitfallCauseRemedy
Unrealistic grid pointsCorrelated features held fixedRestrict grid, compare with ALE
OverplottingToo many instancesSample, add transparency
Causal misreadingModel effect read as real-world effectState that it explains the model
One feature at a timeTwo-feature effects need surfacesUse colored or paired plots
Common pitfalls and remedies

An ICE plot describes how the model behaves, not how the world works. A curve that rises with income shows the model’s dependence on income, which may reflect correlation in training data rather than a causal relationship.

Understanding it simply

Think of a model that predicts house prices. Take one house and ask: what would the model say if this house had a bigger garden? Then try many garden sizes and draw a line. Do this for hundreds of houses, and you get one line per house on the same chart.

If all the lines move the same way, the garden matters in the same way for every house. If some lines rise and others stay flat, the garden matters only for certain houses. That is the key idea: an ICE plot shows how each single case reacts, not just the average.

Applied in practice

A credit risk team at a mid-sized lender reviews a gradient-boosted model that estimates the probability of default. The average partial dependence curve for debt-to-income ratio looks smooth and modest, so the team draws ICE curves for 400 sampled applicants across a grid of 40 ratio values.

The centered ICE plot shows two clear groups. For most applicants the risk rises gently, but for applicants with short credit histories the curves jump steeply above a ratio of 0.45. Coloring by credit history length confirms the interaction. The team documents this behavior in the model card, adjusts the review policy for thin-file applicants, and avoids a misleading conclusion that the average curve alone would have supported.