Error in R gbm function when cv.folds > 0
问题 I am using gbm to predict binary response. When I set cv.folds=0, everything works well. However when cv.folds > 1, I got error: Error in object$var.levels[[i]] : subscript out of bounds when the first irritation of crossvalidation finished. Someone said this could because some factor variables have missing levels in training or testing data, but I tried only use numeric variables and still get this error. > gbm.fit <- gbm(model.formula, + data=dataall_train, + distribution = "adaboost", + n