liveBook · Manning

Partial dependence plot

As explained in Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

A partial dependence plot displays a model's average predicted response as one or more input features vary while marginalizing over other features.

A partial dependence plot (PDP) shows how a trained model’s average prediction changes as one or more input features vary, while marginalizing over other features. It helps reveal modeled linearities, nonlinearities, and possible interactions before transforming numerical data. section 6.1.4

Use PDPs with these practical cautions:

  • Interpret the plotted feature as having a direct effect only when it is independent of other inputs; correlated features make the result an average that also reflects their effects. section 6.1.4
  • Compare average PDPs with ICE plots when individual prediction paths matter, and inspect two-feature PDPs when interactions are suspected. section 6.1.4

Airbnb NYC model inspection

Fit an XGBoost model in a preprocessing pipeline, then call scikit-learn’s PartialDependenceDisplay with kind='average' for features such as minimum_nights, number_of_reviews, calculated_host_listings_count, and availability_365. Plot a classification threshold to help interpret predicted outcomes.

How Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI covers it

How deep it goes
Defines averaging and independence assumptions, demonstrates plots, and stops short of resolving correlated-feature effects.
Examples
Uses Airbnb NYC numeric features, binary-feature boxplots, ICE panels, and conjoint plots for suspected interactions.
What it assumes
Assumes a fitted predictive model and input data, while introducing feature relationships through visual inspection.
What you can do after
Apply PDPs through scikit-learn’s PartialDependenceDisplay to inspect a fitted XGBoost pipeline.
How it connects
Connects PDPs with gradient-boosted decision trees, feature transformations, ICE plots, and interaction analysis.

Also explained in

Compare how 2 books explain partial dependence plot →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI. The section links point to the parts of the book it draws on.