小编Ter*_*ero的帖子

预测(随机森林):概率或投票对回归没有意义

当我运行预测函数时,出现以下错误:

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)

谁能帮助我了解问题所在?谢谢

r predict random-forest

1
推荐指数
1
解决办法
2920
查看次数

标签 统计

predict ×1

r ×1

random-forest ×1