Accumulated Local Effects Plots

PDPs can wander into impossible combinations. Accumulated Local Effects plots stay closer to the observed data by measuring small prediction changes inside local feature intervals.

Those local differences are accumulated and centered around zero.

Local differences, then accumulation

ALE divides a feature into bins. Within each bin, it compares predictions at the bin's upper and lower edges for observations that actually fall there. The average differences are accumulated:

ALE(x)=E[f(X)xjXj=z]dzALE(x)=\int E\left[\frac{\partial f(X)}{\partial x_j}\mid X_j=z\right]dz

Accumulate Local Effects by Income Bin

Move through observed income bins. Within each bin, the model compares the lower and upper edge only for applicants who actually live in that interval.

Applicants in bin

73

Centered ALE

0.030

Lower edge prediction

0.34

Upper edge prediction

0.46

local effect = 0.46 - 0.34 = 0.12
accumulated through bin 3 = 0.24
centered effect = 0.030

ALE stays near observed combinations. Sparse bins still deserve caution because a local average built from 16 cases is less stable than one built from 73.

How to create an ALE plot

  1. Bin the feature — divide the feature of interest into several intervals (bins). These bins help manage the data and compute local effects within smaller, more manageable segments.
  2. Compute local effects — for each bin, calculate the local effect of the feature on the prediction by: calculating the change in prediction when moving from the lower to the upper edge of the bin, then averaging this change over all instances that fall into that bin.
  3. Accumulate effects — starting from the first bin, accumulate the local effects across all bins. Sum up the average effects sequentially to show how the feature influences the prediction as its value changes.
  4. Center — to make the plot more interpretable, center the accumulated effects around zero. Subtract the mean of the accumulated effects, which forces the interpretation to focus on deviations from the average prediction.

When calculating effects within each bin, ALE only makes predictions using small, local changes around actual data points. This means that if features X and Y are correlated, ALE only considers variations of X within the range where that correlation actually exists in your data — it won't extrapolate to impossible or unlikely feature combinations.

The local effect calculation is also conditional on all other features. When computing how a change in X affects predictions, ALE uses the actual values of correlated features that appear in your data. This preserves the natural relationships between variables.

ALE vs PDP — Square Footage & Bedrooms

Square footage and bedroom count are correlated: large homes have more bedrooms. Select a bedroom count to see which square footage values the PDP considers versus what ALE restricts to.

PDP — considers all homes

$200k$350k$500k$650kSquare footagePriceother bedroom countsPDP curve

PDP sweeps sqft from 620 to 3,200 sq ft — pairing 3 beds with sizes from homes that have 1–6 bedrooms.

ALE — stays within realistic range

$200k$350k$500k$650kSquare footagePrice1,2001,5103 beds homes onlyrealistic sqft rangeALE curve

ALE only considers 1,2001,510 sq ft — the range where 3 beds homes actually appear in the data.

ALE only makes predictions within the square footage range that actually exists for homes with that many bedrooms. PDP uses every home regardless, creating impossible combinations like a 3,200 sq ft 1-bedroom.

ALE is usually the better choice when features are correlated. It is faster than PDP in many implementations and avoids much of the extrapolation problem.

The binning strategy still matters. Sparse bins produce noisy estimates, while wide bins can smooth over meaningful behavior.

Checkpoint

Why does ALE center effects around zero?