R语言randomForest包实现随机森林——iris数据集和kyphosis数据集

library(randomForest)
model.forest<-randomForest(Species~.,data=iris)
pre.forest<-predict(model.forest,iris)
table(pre.forest,iris$Species)

library(rpart)
library(randomForest)
model.forest<-randomForest(Kyphosis~.,data=kyphosis)
pre.forest<-predict(model.forest,kyphosis)
table(pre.forest,kyphosis$Kyphosis)

原文地址:https://www.cnblogs.com/MarsMercury/p/4927609.html