经管之家App
让优质教育人人可得
立即打开
全部版块
我的主页
›
论坛
›
数据科学与人工智能
›
数据分析与数据科学
›
R语言论坛
请教随机森林分析,有重谢
楼主
ilandelle
2403
2
收藏
2011-09-09
自己目前在做这方面的工作,但不熟悉R软件,若有哪位会使用R软件randomforest分析的,请联系qq:297028420。
必有重谢!
扫码加我 拉你入群
请注明:姓名-公司-职位
以便审核进群资格,未注明则拒绝
全部回复
沙发
yahoocom
2011-9-9 17:35:07
这个确实比较少人用
扫码加我 拉你入群
请注明:姓名-公司-职位
以便审核进群资格,未注明则拒绝
藤椅
DM小菜鸟
2015-1-7 16:28:17
在
randomForest
包可以做的
这里有详细的说明
http://cran.r-project.org/web/packages/randomForest/randomForest.pdf
我还有一个例子:
Examples——
## Classification:
##data(iris)
set.seed(71)
iris.rf <- randomForest(Species ~ ., data=iris, importance=TRUE,
proximity=TRUE)
print(iris.rf)
## Look at variable importance:
round(importance(iris.rf), 2)
## Do MDS on 1 - proximity:
iris.mds <- cmdscale(1 - iris.rf$proximity, eig=TRUE)
op <- par(pty="s")
pairs(cbind(iris[,1:4], iris.mds$points), cex=0.6, gap=0,
col=c("red", "green", "blue")[as.numeric(iris$Species)],
main="Iris Data: Predictors and MDS of Proximity Based on RandomForest")
par(op)
print(iris.mds$GOF)
## The `unsupervised' case:
set.seed(17)
iris.urf <- randomForest(iris[, -5])
MDSplot(iris.urf, iris$Species)
## Regression:
## data(airquality)
set.seed(131)
ozone.rf <- randomForest(Ozone ~ ., data=airquality, mtry=3,
importance=TRUE, na.action=na.omit)
print(ozone.rf)
## Show "importance" of variables: higher value mean more important:
round(importance(ozone.rf), 2)
## "x" can be a matrix instead of a data frame:
set.seed(17)
x <- matrix(runif(5e2), 100)
y <- gl(2, 50)
(myrf <- randomForest(x, y))
(predict(myrf, x))
## "complicated" formula:
(swiss.rf <- randomForest(sqrt(Fertility) ~ . - Catholic + I(Catholic < 50),
data=swiss))
(predict(swiss.rf, swiss))
## Test use of 32-level factor as a predictor:
set.seed(1)
x <- data.frame(x1=gl(32, 5), x2=runif(160), y=rnorm(160))
(rf1 <- randomForest(x[-3], x[[3]], ntree=10))
## Grow no more than 4 nodes per tree:
(treesize(randomForest(Species ~ ., data=iris, maxnodes=4, ntree=30)))
扫码加我 拉你入群
请注明:姓名-公司-职位
以便审核进群资格,未注明则拒绝
相关推荐
【求助】:R语言中随机森林(randomForest)程序包
随机森林预测精度(randomforest)
随机森林randomforest
R中随机森林函数所画的图怎么理解?
[红包]基于C++的RandomForest随机森林总结
R软件的随机森林包下载
关于随机森林预测结果
请问随机森林(randomForest)这个图怎么看?
R语言randomForest包的随机森林
随机森林算法的一些问题
栏目导航
R语言论坛
站务与外事
文献求助专区
CFA、CVA、FRM等金融考证论坛
经管类求职与招聘
论文版
热门文章
CDA 数据分析师:特征处理核心指南
电子行业深度报告:量子深潜-计算篇:从比特 ...
制造业全要素生产率(2000-2024年)
从知识图谱到认知智能
中物联:全球供应链发展趋势蓝皮书(2025)
企业降低融资成本白皮书(2025)
2025年最值得关注的公司-放射配体创新者开启 ...
中国能源统计年鉴1986-2023
签个到
安永2025年全球财务主管DNA调查(英)
推荐文章
AI狂潮席卷学术圈,不会编程也能打造专属智 ...
10月重磅来袭|《打造Coze/Dify专属学术智能 ...
最快1年拿证,学费不足5W!热门美国人工智能 ...
关于如何利用文献的若干建议
关于学术研究和论文发表的一些建议
关于科研中如何学习基础知识的一些建议 (一 ...
一个自编的经济学建模小案例 --写给授课本科 ...
AI智能体赋能教学改革: 全国AI教育教学应用 ...
2025中国AIoT产业全景图谱报告-406页
关于文献求助的一些建议
说点什么
分享
微信
QQ空间
QQ
微博
扫码加好友,拉您进群
各岗位、行业、专业交流群