0

我试图结合gbm.plot.fit不同plot.gbmgbm模型。这是我的示例代码:

#----------------------ask on stackexchange----------------------------#
mydata <- read.csv("http://www.ats.ucla.edu/stat/data/binary.csv")

library(gbm)
library(dismo)

full.model<- gbm.step(data=mydata,gbm.x = 2:4,gbm.y = 1,family = "bernoulli", tree.complexity = 5,learning.rate = 0.005, bag.fraction = 0.5)

fit1 <- gbm.step(data=mydata,gbm.x = 2,gbm.y = 1,family = "bernoulli", tree.complexity = 5,learning.rate = 0.005, bag.fraction = 0.5)

a=gbm.plot.fits(full.model,v="gre")

b=plot.gbm(full.model,i.var="gre")

c=gbm.plot.fits(fit1)

d=plot.gbm(fit1)

grid.arrange(a, b, c, d, ncol=2, nrow =2)

错误信息是:

安排Grob(...,as.table = as.table,clip = clip,main = main,:输入必须是grobs!

有人可以告诉我我的代码可能出了什么问题吗?

4

0 回答 0