Skip to content

Commit 3bc9e30

Browse files
spec: add ice-basic specification
1 parent 53ee57c commit 3bc9e30

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

plots/ice-basic/specification.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# ice-basic: Individual Conditional Expectation (ICE) Plot
2+
3+
## Description
4+
5+
An Individual Conditional Expectation (ICE) plot visualizes how the predicted outcome of a machine learning model changes for each individual observation as a single feature varies across its range. Unlike partial dependence plots (PDP) that show the average marginal effect, ICE plots display one line per observation, revealing heterogeneous effects, feature interactions, and subgroup-specific behaviors that would be hidden by averaging. This makes ICE plots essential for detecting when a feature's effect varies across the population.
6+
7+
## Applications
8+
9+
- Detecting feature interactions in ensemble models by identifying observations whose prediction curves diverge from the average trend
10+
- Identifying subgroups with different feature responses in clinical prediction models, such as patients who respond differently to dosage changes
11+
- Validating monotonicity assumptions in pricing or risk models by checking whether all individual curves move in the expected direction
12+
- Exploring non-linear and heterogeneous effects in gradient boosting or random forest models during model audit and interpretability review
13+
14+
## Data
15+
16+
- `feature_value` (float) - Grid of values for the feature of interest, spanning its observed range on the x-axis
17+
- `prediction` (float) - Model-predicted outcome for each observation at each grid point on the y-axis
18+
- `observation_id` (int) - Unique identifier for each observation, defining individual ICE lines
19+
- Size: 50-200 observations with 50-100 grid points per observation
20+
- Example: ICE curves from a GradientBoostingRegressor showing how house price predictions change as square footage varies for individual houses
21+
22+
## Notes
23+
24+
- Individual lines should use low alpha (semi-transparent) to show density and overlap patterns
25+
- Overlay the partial dependence (PDP) line as a bold, opaque curve to show the average effect
26+
- Consider a centered ICE (c-ICE) variant that shifts all lines to start at zero for easier comparison of effect shapes
27+
- A rug plot along the x-axis can indicate the distribution of observed feature values
28+
- Color-coding lines by a second feature can help reveal interaction effects
29+
- Complements the existing `pdp-basic` spec by showing individual-level detail behind the average

plots/ice-basic/specification.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Specification-level metadata for ice-basic
2+
# Auto-synced to PostgreSQL on push to main
3+
4+
spec_id: ice-basic
5+
title: Individual Conditional Expectation (ICE) Plot
6+
7+
# Specification tracking
8+
created: "2026-04-11T20:22:17Z"
9+
updated: null
10+
issue: 5238
11+
suggested: MarkusNeusinger
12+
13+
# Classification tags (applies to all library implementations)
14+
# See docs/reference/tagging-system.md for detailed guidelines
15+
tags:
16+
plot_type:
17+
- line
18+
data_type:
19+
- numeric
20+
- continuous
21+
domain:
22+
- machine-learning
23+
- statistics
24+
features:
25+
- basic
26+
- multi
27+
- comparison

0 commit comments

Comments
 (0)