Is it expected that predict.randomForest() produces the response vector when
given the same data frame as provided to randomForest()?  See below.

Thanks.

Rodney

> rf <- randomForest (Species ~ ., iris)
> pc <- predict (rf, iris)
> confusion (pc, iris$Species)
            true
object       setosa versicolor virginica
  setosa         50          0         0
  versicolor      0         50         0
  virginica       0          0        50
attr(,"error")
[1] 0
> confusion (rf$predicted, iris$Species)
            true
object       setosa versicolor virginica
  setosa         50          0         0
  versicolor      0         47         3
  virginica       0          3        47
attr(,"error")
[1] 0.04
> rf$confusion
           setosa versicolor virginica class.error
setosa         50          0         0        0.00
versicolor      0         47         3        0.06
virginica       0          3        47        0.06
>

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to