楼主: ilandelle
2435 2

[有偿编程] 请教随机森林分析,有重谢 [推广有奖]

  • 2关注
  • 0粉丝

已卖:1455份资源

讲师

3%

还不是VIP/贵宾

-

威望
0
论坛币
4744 个
通用积分
1.7400
学术水平
1 点
热心指数
1 点
信用等级
0 点
经验
8904 点
帖子
252
精华
0
在线时间
451 小时
注册时间
2007-9-20
最后登录
2018-11-13

楼主
ilandelle 发表于 2011-9-9 09:54:15 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
自己目前在做这方面的工作,但不熟悉R软件,若有哪位会使用R软件randomforest分析的,请联系qq:297028420。
必有重谢!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:随机森林 randomForest Forest random Rest 森林 软件

思想退却,学术登台!

沙发
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)))

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-5 16:36