← Lessons

quiz vs the machine

Gold1420

Machine Learning

Partial Dependence Plots

Seeing how a prediction changes with one feature on average.

4 min read · core · beat Gold to climb

Partial Dependence Plots

Feature importance says which inputs matter, but not how they shape the output. A partial dependence plot shows the average effect of one feature on the prediction.

How it is built

To find the partial dependence at one value of a feature, the method fixes that feature to the value for every row, keeps all other features as they are, predicts, and averages the results. Repeating across a grid of values traces a curve.

  • The curve reveals shape, whether the effect is rising, flat, or curved.
  • It marginalizes over the other features by averaging them out.
  • The y axis is the average prediction, not a single example.

What it reveals

A partial dependence plot can expose nonlinearities and thresholds a model learned, such as risk that climbs sharply past a certain age. This makes an otherwise opaque model easier to explain.

The independence caveat

The averaging assumes the chosen feature is roughly independent of the others. When features are strongly correlated, fixing one while shuffling realistic combinations creates impossible data points, and the curve can mislead. Individual conditional expectation curves help spot when averaging hides differences across individuals.

Key idea

A partial dependence plot averages predictions over the data to show how one feature moves the output.

Check yourself

Answer to earn rating on the learn ladder.

1. How is a partial dependence value computed at one feature value?

2. When can a partial dependence plot mislead?