首页 > 编程语言 > 详细

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

时间:2015-11-01 15:16:25      阅读:942      评论:0      收藏:0      [点我收藏+]

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)

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

原文:http://www.cnblogs.com/MarsMercury/p/4927609.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!