简体   繁体   English

使用gbm.plot(dismo)和partial(pdp)时部分依赖图的差异,为什么?

[英]Differences in partial dependence plots when using gbm.plot (dismo) and partial (pdp), why?

I am using boosted regression trees (gbm and dismo packages) to build habitat models and use partial dependence plots to look at the influence each predictor variable has on the response variable. 我正在使用增强回归树(gbm和dismo软件包)来构建栖息地模型,并使用偏相关图来查看每个预测变量对响应变量的影响。 I initially was using the gbm.plot function from the dismo package, but found the partial function from the pdp package which creates nicer looking plots however there are discrepancies between the two plots. 我最初使用的是dismo包中的gbm.plot函数,但发现了pdp包中的局部函数,该函数创建了更好看的图,但是这两个图之间存在差异。 See example images for latitude 查看示例图片以了解纬度 gbm.plot部分的 The lines look similar but the y-axis is different on both plots, and I am wondering why. 两条线看起来相似,但y轴在两个图中都不同,我想知道为什么。 I tried looking at the functions using print() but it does not yield much for partial. 我尝试使用print()查看函数,但对于局部函数来说并没有太多收益。

final.model : fitted BRT final.model :装有BRT

ceta_dd_final : data used to build BRT ceta_dd_final :用于构建BRT的数据

Code for gbm.plot: gbm.plot的代码:

gbm.plot(final.model, n.plots = 17, write.title = T,
  show.contrib = T, y.label = "fitted function")

Code for partial: 部分代码:

final.model %>%
  partial(pred.var = "lat", plot=FALSE, train = ceta_dd_final, n.trees = 2400) %>%
  plotPartial(smooth = TRUE, train = ceta_dd_final, rug = TRUE,
      lwd = 2, ylab = expression(f(lat)))

不同之处在于gbm.plot使用普通logit作为绘图的结果,而partial使用以类为中心的logit进行此选择,以使y轴在二项式和多项式模型中具有相同的比例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM