【发布时间】:2015-10-10 13:57:20
【问题描述】:
在我看来,在回归案例中使用随机森林进行预测的过程并不简单,因为我得到的结果与内置过程不同:
set.seed(1)
wyn <- randomForest(y = iris[, 1], x = iris[, -1])
(wyn) #Mean of squared residuals: 0.1341068
response=predict(wyn, iris[, -1]) # is it ok ? below to lines gives different output
mean((iris[,1]-wyn$predicted)^2) #returns 0.1341068
mean((iris[,1]-response)^2) # returns 0.07259335
plot(wyn$predicted,response) # almost but not identical
我在上面使用predict() 有什么问题?
【问题讨论】:
标签: r random-forest