使用caretstack或caretEnsemble可以使用哪个预测函数来预测集成模型?

时间:2018-08-03 15:01:42

标签: r r-caret ensemble-learning

错误:

  

没有适用于“预测”的方法应用于类的对象   “ 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))

0 个答案:

没有答案