A partial dependence plot (PDP) is a global, model-agnostic explanation that shows how the average prediction of a machine learning model changes when one or two input features are varied while the influence of all other features is averaged out. In AI ethics, it is a standard tool for transparency and auditing, because it reveals whether a model responds to a feature in a plausible, monotonic or suspicious way.
The method was introduced by Jerome Friedman in 2001 alongside gradient boosting machines. It complements local methods such as SHAP and LIME: where those explain individual predictions, a partial dependence plot summarizes the average marginal effect of a feature across a whole dataset, which makes it useful for reviewers, regulators and affected stakeholders in artificial intelligence governance.
How a partial dependence plot is computed
The partial dependence function for a feature of interest is the expected model output when that feature is fixed at a chosen value and the remaining features keep their observed distribution. In practice it is estimated by averaging predictions over the dataset, which removes the need to know anything about the model internals.
- Choose the feature of interest and a grid of values, often 20 to 100 points or quantiles of the observed range.
- For each grid value, replace that feature in every row of the dataset with the grid value while leaving other features unchanged.
- Run the model on the modified dataset and average the predictions.
- Plot the averages against the grid values to obtain the curve.
The computational cost is the number of grid points multiplied by the number of rows, so analysts often use a random sample of a few thousand rows. For classifiers the plotted quantity is usually a predicted probability or log-odds, and the choice changes the shape of the curve.
The table below lists the main parameters and their effect on the result.
| Parameter | Typical setting | Effect on the plot |
|---|---|---|
| Grid resolution | 20 to 100 points | Finer grids show detail but cost more |
| Grid placement | Quantiles or even spacing | Quantiles avoid empty regions of data |
| Sample size | 1,000 to 10,000 rows | Larger samples reduce noise in averages |
| Output scale | Probability, log-odds or raw score | Determines linearity and readability |
| Number of features | One or two | Two-way plots reveal interactions |
One-way, two-way and related variants
A one-way plot shows a single curve and answers how the prediction moves with one feature on average. A two-way plot uses a heat map or contour chart to show the joint effect of two features, which exposes interactions that one-way plots hide.
Several variants address the weaknesses of the basic method, as the following comparison shows.
| Method | What it shows | Main advantage | Main weakness |
|---|---|---|---|
| Partial dependence plot | Average effect over all rows | Simple and intuitive | Hides heterogeneous effects |
| ICE plot | One curve per individual row | Reveals varied responses | Cluttered for large datasets |
| Centered ICE plot | ICE curves aligned at a start point | Makes slope differences visible | Loses absolute levels |
| ALE plot | Accumulated local effects | Robust to correlated features | Harder to explain to non-experts |
| SHAP dependence plot | Shapley value against feature value | Links to local attributions | Higher computational cost |
Individual conditional expectation (ICE) curves are the components that a PDP averages. Plotting both together is a recommended practice, because a flat average may conceal two groups of rows that respond in opposite directions.
Role of partial dependence plots in AI ethics
In fairness and accountability work, a partial dependence plot helps reviewers check whether a model treats a feature in a way that is justifiable and consistent with policy. It is a common component of an AI audit or an algorithmic impact assessment, where documentation must explain how inputs drive outcomes.
- Detecting proxy discrimination: a strong effect of postal code or first language in a credit model may indicate a proxy for a protected attribute.
- Checking monotonicity: a loan score that falls as income rises over part of the range signals a modeling problem or data artifact.
- Comparing groups: computing separate plots for subgroups shows whether a feature affects groups differently, a starting point for fairness analysis.
- Supporting contestability: plots give affected people and regulators a readable account of the model’s general behavior.
The plot does not measure fairness by itself. It shows associations learned by the model, and a reviewer must still compare them with fairness metrics such as demographic parity or equalized odds and with the legal context.
Limitations and common misinterpretations
The central assumption is that the feature of interest is independent of the other features. When features are correlated, the method creates unrealistic synthetic rows, such as a 20-year-old applicant with 40 years of work history, and the averaged predictions then describe data the model never saw.
The table below lists frequent errors, their cause and the usual remedy.
| Mistake | Cause | Remedy |
|---|---|---|
| Reading the curve as causal | PDP reflects the model, not the world | State that effects are model associations |
| Trusting a flat curve | Opposite effects cancel in the average | Overlay ICE curves |
| Ignoring correlated inputs | Extrapolation into impossible combinations | Use ALE plots or conditional sampling |
| Over-reading sparse regions | Few observations at extreme values | Add a rug plot or data histogram |
| Comparing across scales | Probability versus log-odds outputs | Report the output scale explicitly |
A further risk is explanation washing: presenting attractive plots as proof of responsible design while the underlying data or objective remains biased. A partial dependence plot is evidence for review, not a certificate of trustworthy AI.
Using partial dependence plots in a review process
Effective use combines the plot with domain expertise and documentation. Reviewers typically select the most important features by permutation importance, generate one-way plots with ICE overlays, add two-way plots for suspected interactions and record the findings in a model card or audit report.
Widely used libraries such as scikit-learn provide built-in functions for one-way and two-way plots, which makes the method easy to reproduce across model versions. Repeating the same plots after each retraining helps detect behavioral drift before deployment.
In simple terms
A partial dependence plot is a chart about a prediction model. It answers one question. If only this one thing changes, what happens to the answer on average? Think of testing a recipe. You change the salt in every batch, keep everything else the same, and taste the average result.
This helps people check whether a computer system behaves sensibly. The chart shows what the model learned, not what is true in the real world. It can also hide cases where different people are affected in different ways.
A practical example
A bank’s model risk team reviews a gradient-boosted credit scoring model before it is used for consumer loans. The team generates one-way partial dependence plots for the ten most important features on a sample of 5,000 applications, with ICE curves overlaid.
Most curves look reasonable: approval probability rises steadily with income and falls with existing debt. However, the plot for applicant postal district shows a drop of about 12 percentage points for a cluster of districts with a high share of one ethnic minority. Separate subgroup plots confirm that the feature acts as a proxy for a protected attribute.
The team removes the district feature, retrains the model and repeats the analysis together with an equalized odds check. The final audit report documents the plots, the change and the reduced disparity between groups.