library(gbm)
data('ecospat.testData')
# data for Soldanella alpina
data.Solalp<- ecospat.testData[c("Soldanella_alpina","ddeg","mind","srad","slp","topo")]
# gbm model for Soldanella alpina
gbm.Solalp <- gbm(Soldanella_alpina ~ ., data = data.Solalp,
distribution = "bernoulli", cv.folds = 10, n.cores=2)
# cross-validated predictions
gbm.pred <- ecospat.cv.gbm (gbm.obj= gbm.Solalp,data.Solalp,
K=10, cv.lim=10, jack.knife=FALSE)
Run the code above in your browser using DataLab