Preprint
Machine Learning

pdp: An R Package for Constructing Partial Dependence Plots

M. Greenwell Brandon
January 1, 2017The R Journal1,192 citations

1.2k

Citations

62

Influential Citations

The R Journal

Venue

2017

Year

Abstract

Complex nonparametric models-like neural networks, random forests, and support vector machines-are more common than ever in predictive analytics, especially when dealing with large observational databases that don't adhere to the strict assumptions imposed by traditional statistical techniques (e.g., multiple linear regression which assumes linearity, homoscedasticity, and normality). Unfortunately, it can be challenging to understand the results of such models and explain them to management. Partial dependence plots offer a simple solution. Partial dependence plots are lowdimensional graphical renderings of the prediction function so that the relationship between the outcome and predictors of interest can be more easily understood. These plots are especially useful in explaining the output from black box models. In this paper, we introduce pdp, a general R package for constructing partial dependence plots.

Analysis

Why This Paper Matters

Partial dependence plots (PDPs) are a cornerstone technique for interpreting complex machine learning models, which are often criticized as black boxes. This paper introduces pdp, an R package that makes constructing these plots straightforward and accessible to practitioners. Given the growing emphasis on explainable AI, the package fills a critical gap by providing a simple, unified tool for model-agnostic interpretation.

The paper's significance is underscored by its high citation count (1192), indicating its widespread adoption in both academia and industry. By lowering the barrier to creating PDPs, the package has enabled many data scientists to better understand and communicate their models' behavior, fostering trust and transparency in predictive analytics.

Technical Contributions

The key technical contributions of the pdp package include:

  • Unified interface: Works with various modeling frameworks (e.g., randomForest, caret, xgboost) through a common partial() function.
  • Flexible visualization: Offers both base R and ggplot2 plotting options, allowing customization.
  • Support for multiple predictors: Can generate PDPs for single or multiple predictors, including interaction plots.
  • Efficient computation: Implements algorithms to reduce computational burden, especially for large datasets.
  • Extensibility: Designed to be easily extended to new model classes.

Results

The paper does not present quantitative benchmarks or comparisons. Instead, it provides illustrative examples using datasets like the Boston housing data and a classification problem, showing how PDPs reveal relationships between predictors and outcomes. The main 'result' is the package's functionality and ease of use, which has been validated by its broad adoption in the R community.

Significance

The pdp package has had a lasting impact on the field of machine learning interpretability. It has become a standard tool in R for generating partial dependence plots, and its influence extends to other languages and packages that have adopted similar approaches. By making PDPs easy to generate, it has contributed to the broader movement toward explainable AI, helping practitioners and stakeholders understand complex models. The package's success also highlights the importance of user-friendly software in translating research methods into practical tools.