Error in ConfusionMatrix the data and reference factors must have the same number of levels

后端 未结 9 998
自闭症患者
自闭症患者 2020-12-08 20:13

I\'ve trained a tree model with R caret. I\'m now trying to generate a confusion matrix and keep getting the following error:

Error in confusionMatrix

9条回答
  •  没有蜡笔的小新
    2020-12-08 21:04

    Try specifying na.pass for the na.action option:

    predictionsTree <- predict(treeFit, testdata,na.action = na.pass)
    

提交回复
热议问题