rrfcv(RRF)
rrfcv()所属R语言包:RRF
Random Forest Cross-Valdidation for feature selection
随机森林的跨Valdidation为特征选择
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function shows the cross-validated prediction performance of models with sequentially reduced number of predictors (ranked by variable importance) via a nested cross-validation procedure.
此功能显示顺序数量减少的预测(变量重要性排名)通过一个嵌套的交叉验证程序的交叉验证模型的预测性能。
用法----------Usage----------
rrfcv(trainx, trainy, cv.fold=5, scale="log", step=0.5,
mtry=function(p) max(1, floor(sqrt(p))), recursive=FALSE, ...)
参数----------Arguments----------
参数:trainx
matrix or data frame containing columns of predictor variables
矩阵或数据框包含的列的预测变量
参数:trainy
vector of response, must have length equal to the number of rows in trainx
响应矢量的,必须具有等于trainx的行数的长度
参数:cv.fold
number of folds in the cross-validation
在交叉验证的倍数数
参数:scale
if "log", reduce a fixed proportion (step) of variables at each step, otherwise reduce step variables at a time
如果"log",减少一个固定的比例(step)变量的每一步,否则减少step一个时间变量
参数:step
if log=TRUE, the fraction of variables to remove at each step, else remove this many variables at a time
如果log=TRUE,分数的变量,在每一步中删除,否则删除的时候在这许多变数
参数:mtry
a function of number of remaining predictor variables to use as the mtry parameter in the RRF call
剩余的预测变量用作mtry参数在RRF呼叫数目的函数
参数:recursive
whether variable importance is (re-)assessed at each step of variable reduction
是否可变的重要性是(重新)评估变量减少在每一步
参数:...
other arguments passed on to RRF
其他参数传递给RRF
值----------Value----------
A list with the following components:
以下组件列表:
list(n.var=n.var, error.cv=error.cv, predicted=cv.pred)
的列表(n.var = n.var,error.cv = error.cv,预测= cv.pred)
参数:n.var
vector of number of variables used at each step
在每个步骤中所用的变量数目的矢量
参数:error.cv
corresponding vector of error rates or MSEs at each step
在每个步骤中的错误率或微型和小型企业对应的向量
参数:predicted
list of n.var components, each containing the predicted values from the cross-validation
n.var的组件,每个组件包含交叉验证的预测值的列表
(作者)----------Author(s)----------
Andy Liaw
参考文献----------References----------
Random Forest to Modeling Structure-Activity Relationships of Pharmaceutical Molecules”, MCS 2004, Roli, F. and Windeatt, T. (Eds.) pp. 334-343.
参见----------See Also----------
RRF, importance
RRF,importance
实例----------Examples----------
set.seed(647)
myiris <- cbind(iris[1:4], matrix(runif(508 * nrow(iris)), nrow(iris), 508))
result <- rrfcv(myiris, iris$Species)
with(result, plot(n.var, error.cv, log="x", type="o", lwd=2))
## The following can take a while to run, so if you really want to try[#下面可能需要一段时间来运行,所以,如果你真的想尝试一下]
## it, copy and paste the code into R.[#,复制和粘贴代码到R.]
## Not run: [#不运行:]
result <- replicate(5, rrfcv(myiris, iris$Species), simplify=FALSE)
error.cv <- sapply(result, "[[", "error.cv")
matplot(result[[1]]$n.var, cbind(rowMeans(error.cv), error.cv), type="l",
lwd=c(2, rep(1, ncol(error.cv))), col=1, lty=1, log="x",
xlab="Number of variables", ylab="CV Error")
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|