我正在处理学生表现数据集,我收到此消息错误
trafo 中的错误(data = data,numeric_trafo = numeric_trafo,factor_trafo = factor_trafo,:不支持数据类“字符”另外:警告消息:在 storage.mode(RET@predict_trafo)<-“double”:强制引入的 NA
从这段代码,我不知道为什么?
set.seed(1)
ind <- sample(2,nrow(d2),replace = TRUE ,prob = c(0.7,0.3))
trainData <- d2[ind==1,]
testData <- d2[ind==2,]
library(party)
myFormula <- higher~G1+G2+G3
d2_ctree <- ctree(myFormula, data=trainData)
table(predict(d2_ctree),trainData$higher)