0
我想运行在我的数据框的每个变量决策树,所以我用这个:在ctree环[R]
results_cont = list()
for (i in 2:(ncol(DATA)-1)) {
current_var = colnames(DATA[i])
current_result = ctree(TARGET ~ current_var, DATA, control = ctrl)
results_cont[[i]] = current_result
}
如果数据是数据框,其中第一列是ID最后一列(TARGET)是我的二进制目标。
我不断收到此错误:
Error in trafo(data = data, numeric_trafo = numeric_trafo, factor_trafo = factor_trafo, :
data class “character” is not supported
但我没有在MI数据帧的任何字符。
我的循环或别的东西有什么问题吗?
谢谢你们。
它的工作,谢谢! – rjara