来自R的xgboost模型的部分依赖图

时间:2022-11-13 23:47:22

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.

是否有一个已经存在的函数来从R中的xgboost模型获得部分依赖图?我看到了使用mlr包的示例,但它似乎需要一个特定于mlr的包装类。我有点不清楚是否有办法将xgboost模型转换为该类。

2 个解决方案

#1


4  

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.

我一直在研究用于构建部分依赖图的R包pdp - https://github.com/bgreenwell/pdp。我能够使用XGBoost模型,但它仍然是实验性的。手稿文件夹中有一个正在进行的小插图/手稿可能会有所帮助。

#2


0  

This seems to do the trick without converting to mlr: https://github.com/FeiYeYe/xgboost/blob/master/R-package/R/plot.xgb.Booster.R

这似乎没有转换为mlr诀窍:https://github.com/FeiYeYe/xgboost/blob/master/R-package/R/plot.xgb.Booster.R

#1


4  

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.

我一直在研究用于构建部分依赖图的R包pdp - https://github.com/bgreenwell/pdp。我能够使用XGBoost模型,但它仍然是实验性的。手稿文件夹中有一个正在进行的小插图/手稿可能会有所帮助。

#2


0  

This seems to do the trick without converting to mlr: https://github.com/FeiYeYe/xgboost/blob/master/R-package/R/plot.xgb.Booster.R

这似乎没有转换为mlr诀窍:https://github.com/FeiYeYe/xgboost/blob/master/R-package/R/plot.xgb.Booster.R