错误:数据和参考值必须在R中具有完全相同的级别

时间:2017-11-16 13:48:53

标签: r

了解confussionMatrix()我试过这个

library(caret)
dataset1 = data.frame(forecast=c(4671397.7147,4602397.5887,4756124.2292,4754702.5180,4811885.2432,4886686.7732))

dataset2 = data.frame(PaidAmount= c(3377420.5946,3304701.4007,4197240.7709,3202655.9895,3332027.0383,3850655.8740))

result = confusionMatrix(dataset1$forecast,dataset2$PaidAmount)
print(result)

但我收到错误

Error : the data and reference values must have exactly the same levels

demo work here

我该如何解决这个问题?

0 个答案:

没有答案