错误:
没有适用于“预测”的方法应用于类的对象 “ c('caretEnsemble','caretStack')。
model_list <- caretList(
`parkinson$Status`~., data=train,
trControl=fitControl,
methodList=c("glm", "C5.0","knn","svmLinear")
#ensembling
gbm_ensemble <- caretStack(model_list,
method="gbm",
verbose=FALSE,
tuneLength=10,
metric="ROC",
trControl=trainControl(method="boot",
number=10,
savePredictions="final",
classProbs=TRUE,
summaryFunction=twoClassSummary))
inputdata<-subset(train,select = -c(19,20,21,22))
predictdisease <- function(inputdata){
predict<-predict(gbm_ensemble,newdata=inputdata,type='raw')
}
print(predictdisease(inputdata))