当我运行预测函数时,出现以下错误:
Error in predict.randomForest(fit, newdata = na.roughfix(csvTest[, -c(1:2, :
'prob' or 'vote' not meaningful for regression code here
Run Code Online (Sandbox Code Playgroud)
这是代码:
fit <- foreach (ntree = rep (round(number_trees/nc), nc),
.combine = combine, .packages = 'randomForest') %dopar% randomForest(y=csv$mal,x=na.roughfix (csv[, c(1:2,4:5,8:13,17,19:20,22:29,ncol(csv))]), ntree = number_trees)
prob <- predict (fit, newdata = na.roughfix (csvTest[, -c(1:2,4:5,8:13,17,19:20,22:29,ncol(csvTest))]), type = 'prob')[, 2]
Run Code Online (Sandbox Code Playgroud)
谁能帮助我了解问题所在?谢谢