Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Partial dependence plot from an xgboost model in R

Tags:

r

xgboost

Is there an already existing function to get a partial dependence plot from an xgboost model in R? I saw examples of using mlr package, but it seems to require an mlr-specific wrapper class. I am a little unclear if there is a way to convert an xgboost model into that class.

like image 271
Anarcho-Chossid Avatar asked Apr 14 '16 00:04

Anarcho-Chossid


People also ask

How do you interpret a partial dependence plot for classification?

A partial dependence (PD) plot depicts the functional relationship between a small number of input variables and predictions. They show how the predictions partially depend on values of the input variables of interest. For example, a PD plot can show whether the probability of flu increases linearly with fever.

What is partial dependency plot?

The partial dependence plot (short PDP or PD plot) shows the marginal effect one or two features have on the predicted outcome of a machine learning model (J. H. Friedman 200130). A partial dependence plot can show whether the relationship between the target and a feature is linear, monotonic or more complex.

What is partial dependence plot in random forest?

Partial dependence plots (PDP) is a useful tool for gaining insights into the relationship between features and predictions. It helps us understand how different values of a particular feature impact model's predictions.

What is y axis in partial dependence plot?

The y-axis of a partial dependence plot for regression represents the marginal impact of the independent variable to the dependent variable. E.g. if the line is at 0, then for that value of the independent variable, there is 0 impact to the dependent variable.


1 Answers

I have been working on an R package, pdp, for constructing partial dependence plots--https://github.com/bgreenwell/pdp. I was able to get it to work with XGBoost models, but it is still experimental. There is a vignette/manuscript in progress in the manuscript folder that may help.

like image 188
bgreenwell Avatar answered Oct 17 '22 05:10

bgreenwell