随机森林运算出现这种状况是怎么回事?
Error in na.fail.default(list(x11 = c(1L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, :
missing values in object、
整个程序运行完是这样的:
#随机森林分类
> library(randomForest)
> set.seed(1010)
> a=randomForest(x11~.,w,importance=TRUE,proximity=TRUE)
Error in na.fail.default(list(x11 = c(1L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, :
missing values in object
> wp=predict(a,w)
> (Z=table(w[,D],wp))
Error in table(w[, D], wp) : 所有参数的长度都应一致
> (E0=(sum(Z)-sum(diag(Z)))/sum(Z))
[1] 0