I'm working on a student performance dataset and I get this message error
Error in trafo(data = data, numeric_trafo = numeric_trafo, factor_trafo = factor_trafo, : data class “character” is not supported In addition: Warning message: In storage.mode(RET@predict_trafo) <- "double" : NAs introduced by coercion
from this code, and I don't know why?
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)