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.
| Parameter | Typical choice | Effect |
|---|---|---|
| Number of instances | 100 to 1,000 sampled rows | More lines, more clutter and compute |
| Grid resolution | 20 to 100 points | Finer curves, linear cost increase |
| Grid placement | Quantiles of the feature | Avoids sparse regions |
| Prediction scale | Probability, logit or raw output | Changes visual size of effects |
| Centering anchor | Minimum grid value | Aligns curves for comparison |
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.
| Variant | What it shows | Best use |
|---|---|---|
| Standard ICE | Raw prediction per instance | Seeing levels and spread |
| Centered ICE (c-ICE) | Change relative to an anchor | Comparing curve shapes |
| Derivative ICE (d-ICE) | Local slope per instance | Locating interaction regions |
| Colored ICE | Curves colored by a second feature | Identifying the interacting feature |
| ICE with PDP overlay | Individual lines plus the average | Contrasting local and global views |
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.
How ICE plots compare with related explanation methods
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.
| Method | Scope | Main strength | Main weakness |
|---|---|---|---|
| ICE plot | Local curves, shown globally | Reveals heterogeneity | Clutter, unrealistic points |
| Partial dependence plot | Global average | Simple to read | Hides interactions |
| Accumulated local effects | Global, conditional | Handles correlated features | No per-instance view |
| Shapley value | Local attribution | Additive, axiomatic | Single point, no curve |
| Permutation feature importance | Global ranking | Model-agnostic scalar | No direction of effect |
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.
| Pitfall | Cause | Remedy |
|---|---|---|
| Unrealistic grid points | Correlated features held fixed | Restrict grid, compare with ALE |
| Overplotting | Too many instances | Sample, add transparency |
| Causal misreading | Model effect read as real-world effect | State that it explains the model |
| One feature at a time | Two-feature effects need surfaces | Use colored or paired plots |
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.