没有合适的资源?快使用搜索试试~ 我知道了~
首页随机森林(Random Forest)的Fortran和R语言实现
随机森林(Random Forest)的Fortran和R语言实现
2星 需积分: 50 75 下载量 3 浏览量
更新于2023-03-16
评论 2
收藏 182KB PDF 举报
August 29, 2013 Breiman and Cutler’s random forests for classification and regression Version 4.6-7
资源详情
资源评论
资源推荐
Package ‘randomForest’
August 29, 2013
Title Breiman and Cutler’s random forests for classification and regression
Version 4.6-7
Date 2012-10-16
Depends R (>= 2.5.0), stats
Suggests RColorBrewer, MASS
Author Fortran original by Leo Breiman and Adele Cutler, R port by Andy Liaw and Matthew Wiener.
Description Classification and regression based on a forest of trees using random inputs.
Maintainer Andy Liaw <andy_liaw@merck.com>
License GPL (>= 2)
URL http://stat-www.berkeley.edu/users/breiman/RandomForests
Repository CRAN
Date/Publication 2012-10-16 13:43:29
NeedsCompilation yes
R topics documented:
classCenter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
combine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
getTree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
grow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
importance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
imports85 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
margin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
MDSplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
na.roughfix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
outlier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
partialPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1
2 classCenter
plot.randomForest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
predict.randomForest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
randomForest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
rfcv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
rfImpute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
rfNews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
treesize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
tuneRF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
varImpPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
varUsed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Index 29
classCenter Prototypes of groups.
Description
Prototypes are ‘representative’ cases of a group of data points, given the similarity matrix among
the points. They are very similar to medoids. The function is named ‘classCenter’ to avoid conflict
with the function prototype in the methods package.
Usage
classCenter(x, label, prox, nNbr = min(table(label))-1)
Arguments
x a matrix or data frame
label group labels of the rows in x
prox the proximity (or similarity) matrix, assumed to be symmetric with 1 on the
diagonal and in [0, 1] off the diagonal (the order of row/column must match that
of x)
nNbr number of nearest neighbors used to find the prototypes.
Details
This version only computes one prototype per class. For each case in x, the nNbr nearest neighors
are found. Then, for each class, the case that has most neighbors of that class is identified. The pro-
totype for that class is then the medoid of these neighbors (coordinate-wise medians for numerical
variables and modes for categorical variables).
This version only computes one prototype per class. In the future more prototypes may be computed
(by removing the ‘neighbors’ used, then iterate).
Value
A data frame containing one prototype in each row.
combine 3
Author(s)
Andy Liaw
See Also
randomForest, MDSplot
Examples
data(iris)
iris.rf <- randomForest(iris[,-5], iris[,5], prox=TRUE)
iris.p <- classCenter(iris[,-5], iris[,5], iris.rf$prox)
plot(iris[,3], iris[,4], pch=21, xlab=names(iris)[3], ylab=names(iris)[4],
bg=c("red", "blue", "green")[as.numeric(factor(iris$Species))],
main="Iris Data with Prototypes")
points(iris.p[,3], iris.p[,4], pch=21, cex=2, bg=c("red", "blue", "green"))
combine Combine Ensembles of Trees
Description
Combine two more more ensembles of trees into one.
Usage
combine(...)
Arguments
... two or more objects of class randomForest, to be combined into one.
Value
An object of class randomForest.
Note
The confusion, err.rate, mse and rsq components (as well as the corresponding components in
the test compnent, if exist) of the combined object will be NULL.
Author(s)
Andy Liaw <andy\_liaw@merck.com>
See Also
randomForest, grow
4 getTree
Examples
data(iris)
rf1 <- randomForest(Species ~ ., iris, ntree=50, norm.votes=FALSE)
rf2 <- randomForest(Species ~ ., iris, ntree=50, norm.votes=FALSE)
rf3 <- randomForest(Species ~ ., iris, ntree=50, norm.votes=FALSE)
rf.all <- combine(rf1, rf2, rf3)
print(rf.all)
getTree Extract a single tree from a forest.
Description
This function extract the structure of a tree from a randomForest object.
Usage
getTree(rfobj, k=1, labelVar=FALSE)
Arguments
rfobj a randomForest object.
k which tree to extract?
labelVar Should better labels be used for splitting variables and predicted class?
Details
For numerical predictors, data with values of the variable less than or equal to the splitting point go
to the left daughter node.
For categorical predictors, the splitting point is represented by an integer, whose binary expansion
gives the identities of the categories that goes to left or right. For example, if a predictor has
four categories, and the split point is 13. The binary expansion of 13 is (1, 0, 1, 1) (because
13 = 1 ∗ 2
0
+ 0 ∗ 2
1
+ 1 ∗ 2
2
+ 1 ∗ 2
3
), so cases with categories 1, 3, or 4 in this predictor get sent
to the left, and the rest to the right.
Value
A matrix (or data frame, if labelVar=TRUE) with six columns and number of rows equal to total
number of nodes in the tree. The six columns are:
left daughter the row where the left daughter node is; 0 if the node is terminal
right daughter the row where the right daughter node is; 0 if the node is terminal
split var which variable was used to split the node; 0 if the node is terminal
split point where the best split is; see Details for categorical predictor
status is the node terminal (-1) or not (1)
prediction the prediction for the node; 0 if the node is not terminal
grow 5
Author(s)
Andy Liaw <andy\_liaw@merck.com>
See Also
randomForest
Examples
data(iris)
## Look at the third trees in the forest.
getTree(randomForest(iris[,-5], iris[,5], ntree=10), 3, labelVar=TRUE)
grow Add trees to an ensemble
Description
Add additional trees to an existing ensemble of trees.
Usage
## S3 method for class ’randomForest’
grow(x, how.many, ...)
Arguments
x an object of class randomForest, which contains a forest component.
how.many number of trees to add to the randomForest object.
... currently ignored.
Value
An object of class randomForest, containing how.many additional trees.
Note
The confusion, err.rate, mse and rsq components (as well as the corresponding components in
the test compnent, if exist) of the combined object will be NULL.
Author(s)
Andy Liaw <andy\_liaw@merck.com>
See Also
combine, randomForest
剩余28页未读,继续阅读
u013899602
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- stc12c5a60s2 例程
- Android通过全局变量传递数据
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论2