在R中运行集成代码时发出警告

时间:2018-07-29 20:05:50

标签: r if-statement ensemble-learning

我正在尝试使用多数表决方法来运行集成模型。这是它的代码。

pred_majority<-as.factor(ifelse(pred_rf_new=='TRUE' & 
model_1_epoch_predict$predict=='TRUE','TRUE',ifelse(pred_rf_new=='TRUE' & ksvm_predict=='TRUE','TRUE',ifelse(model_1_epoch_predict$predict=='TRUE' & ksvm_predict=='TRUE','TRUE','FALSE'))))

执行该行将还原以下警告。

Warning messages:
1: In pred_rf_new == "TRUE" & model_1_epoch_predict$predict == "TRUE" :
longer object length is not a multiple of shorter object length
2: In model_1_epoch_predict$predict == "TRUE" & ksvm_predict == "TRUE" :
longer object length is not a multiple of shorter object length

请帮帮我。

0 个答案:

没有答案