Quant Memo
Core

Feature-Effect Plots When Features Are Correlated

Why partial dependence plots — a standard way to show how a prediction changes with one feature — can mislead badly when that feature is correlated with others, and what to use instead.

Prerequisites: Global vs Local Explanations

A partial dependence plot (PDP) shows how a model's average prediction changes as one feature moves, holding everything else fixed. It's built by, for every value of that feature, replacing every observation's actual value with it, re-running the model, and averaging the result. The problem: "holding everything else fixed" quietly creates data points that never occur in reality when the plotted feature is correlated with others, and the model's response to those fabricated points can be nonsense.

Where it breaks

Suppose a credit or trading model uses both a stock's market capitalization and its average daily dollar volume, two features that are almost always highly correlated — large-cap stocks trade in large dollar volumes. A PDP for market cap forces every observation, including small illiquid names, to take on a huge market-cap value while their trading volume stays exactly as it was in the real data. The model is now evaluated on a "huge company with tiny volume," a combination that essentially never exists in the training data. Whatever the model outputs there is extrapolation into an empty region of feature space, and the resulting curve reflects the model's arbitrary behavior off-distribution rather than any real economic relationship.

The fix: individual conditional expectation and ALE

Two adjustments help. Individual conditional expectation (ICE) plots draw one line per observation instead of a single average, which at least reveals when lines fan out wildly or disagree, a sign the average is being computed over a mix of realistic and unrealistic points. The more robust fix is the accumulated local effects (ALE) plot: instead of holding other features fixed, ALE only perturbs the target feature within small, realistic windows and looks at how the prediction changes within each window, using only observations that are actually similar to real data. It then accumulates those local changes into a global curve, avoiding the fabricated-combination problem entirely.

Worked example

A model predicts credit spread widening from a bond's duration and its issuer's leverage ratio, correlated at ρ=0.7\rho = 0.7 (long-duration bonds tend to come from more leveraged issuers). A PDP for duration, built by fixing every bond's duration to 20 years while leaving leverage as-is, shows spread widening rising sharply past duration 15 — but that region mixes real high-leverage long bonds with fabricated low-leverage-but-20-year combinations that don't exist in the market. An ALE plot, comparing bonds only within realistic (duration, leverage) neighborhoods, shows a much flatter rise past duration 15, revealing most of the PDP's apparent effect was really leverage's effect misattributed to duration.

Bond duration (years) PDP (biased) ALE (realistic)
Past duration 15, the PDP inflates the apparent effect by evaluating fabricated high-duration, low-leverage bonds; ALE, restricted to realistic neighborhoods, shows a smaller true effect.

What this means in practice

Before trusting a PDP on any financial model, check the correlation between the plotted feature and the others it's held fixed against; anything above roughly 0.50.5 is a warning sign. When features are strongly correlated, prefer ALE plots or restrict the PDP to a plausible joint range, and always report the correlation structure alongside the plot so a reader can judge how much of the curve is signal versus extrapolation artifact.

A partial dependence plot can mislead when its feature is correlated with others, because it averages the model's predictions over feature combinations that never occur in real data. ALE plots fix this by only comparing nearby, realistic observations, at the cost of losing the simple "hold everything else fixed" interpretation.

A quick sanity check before reading any PDP: compute the correlation of the plotted feature with the others in the model. High correlation is your signal to reach for ALE or ICE plots instead of trusting the PDP curve at face value.

Related concepts

Practice in interviews

Further reading

  • Molnar, Interpretable Machine Learning, ch. 8
ShareTwitterLinkedIn