cv.scout(scout)
cv.scout()所属R语言包:scout
Perform cross-validation for covariance-regularized regression, aka the Scout.
执行交叉验证为协方差正规化的回归,又名童军。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function returns cross-validation error rates for a range of lambda1 and lambda2 values, and also makes beautiful CV plots if plot=TRUE.
这个函数返回的范围的lambda1和lambda2值交叉验证错误率,也使美丽的CV图,如果图= TRUE。
用法----------Usage----------
cv.scout(x, y, K= 10, lam1s=seq(0.001,.2,len=10),lam2s=seq(0.001,.2,len=10),p1=2,p2=1,trace = TRUE, plot=TRUE,plotSE=FALSE,rescale=TRUE,...)
参数----------Arguments----------
参数:x
A matrix of predictors, where the rows are the samples and the columns are the predictors
的预测,其中各行是样品和列的矩阵的预测
参数:y
A matrix of observations, where length(y) should equal nrow(x)
矩阵的观测,长度(Y),应等于NROW(X)
参数:K
Number of cross-validation folds to be performed; default is 10
进行的交叉验证折数,默认为10
参数:lam1s
The (vector of) tuning parameters for regularization of the covariance matrix. Can be NULL if p1=NULL, since then no covariance regularization is taking place. If p1=1 and nrow(x)<ncol(x), then the no value in lam1s should be smaller than 1e-3, because this will cause graphical lasso to take too long. Also, if ncol(x)>500 then we really do not recommend using p1=1, as graphical lasso can be uncomfortably slow.
正规化的协方差矩阵(矢量)调整参数。可以为NULL,如果p1 = NULL,因为当时没有协方差正规化发生。如果p1 = 1,NROW(X)<NCOL(X),那么没有价值的lam1s应该小于1E-3,因为这将导致图形套索的时间过长。此外,NCOL(X)> 500,那么,我们真的不建议使用P1 = 1,图形化的套索而显得缓慢。
参数:lam2s
The (vector of) tuning parameters for the $L_1$ regularization of the regression coefficients, using the regularized covariacne matrix. Can be NULL if p2=NULL. (If p2=NULL, then non-zero lam2s have no effect). A value of 0 will result in no regularization.
(矢量)$ L_1 $正规化的回归系数的调整参数,使用正则covariacne的矩阵。可以是NULL如果p2 = NULL。 (如果p2 = NULL,然后非零lam2s的有没有影响)。值为0将导致在没有正规化。
参数:p1
The $L_p$ penalty for the covariance regularization. Must be one of 1, 2, or NULL. NULL corresponds to no covariance regularization.
L_P $罚款的协方差正规化。必须是1,2,或NULL。 NULL没有协方差正规化。
参数:p2
The $L_p$ penalty for the estimation of the regression coefficients based on the regularized covariance matrix. Must be one of 1 (for $L_1$ regularization) or NULL (for no regularization).
L_P $处罚的基础上正则的协方差矩阵的估计回归系数。必须是1($ L_1 $正规化)或NULL(不正规化)。
参数:trace
Print out progress as we go? Default is TRUE.
打印出的进步,因为我们去吗?默认值是TRUE。
参数:plot
If TRUE (by default), makes beautiful CV plots.
如果是TRUE(默认情况下),让美丽的CV图。
参数:plotSE
Should those beautiful CV plots also display std error bars for the CV? Default is FALSE
如果这些美丽的CV图还显示标准误差线的CV吗?默认是false。
参数:rescale
Scout rescales coefficients, by default, in order to avoid over-shrinkage
童军重新调整系数,默认情况下,为了避免过度收缩
参数:...
Additional parameters
额外的参数
Details
详细信息----------Details----------
Pass in a data matrix x and a vector of outcomes y; it will perform (10-fold) cross-validation over a range of lambda1 and lambda2 values. By default, Scout(2,1) is performed.
通过在一个数据矩阵x和一个向量的成果Ŷ;其将执行(10倍)以上的范围内的lambda1和lambda2值的交叉验证。默认情况下,童军(2,1)。
值----------Value----------
<table summary="R valueblock"> <tr valign="top"><td>folds</td> <td> The indices of the members of the K test sets are returned.</td></tr> <tr valign="top"><td>cv</td> <td> A matrix of average cross-validation errors is returned.</td></tr> <tr valign="top"><td>cv.error</td> <td> A matrix containing the standard errors of the elements in "cv", the matrix of average cross-validation errors.</td></tr> <tr valign="top"><td>bestlam1</td> <td> Best value of lam1 found via cross-validation.</td></tr> <tr valign="top"><td>bestlam2</td> <td> Best value fo lam2 found via cross-validation.</td></tr> <tr valign="top"><td>lam1s</td> <td> Values of lam1 considered.</td></tr> <tr valign="top"><td>lam2s</td> <td> Values of lam2 considered.</td></tr> </table>
<table summary="R valueblock"> <tr valign="top"> <TD> folds</ TD> <TD>指数的K测试组的成员的返回。</ TD> < / TR> <tr valign="top"> <TD> cv</ TD> <TD>的平均交叉验证错误,则返回一个矩阵。</ TD> </ TR> <TR VALIGN =“顶“<TD> cv.error </ TD> <TD>”CV“,平均交叉验证错误的矩阵的矩阵中的元素的标准误差。</ TD> </ TR> < TR VALIGN =“顶”> <TD>bestlam1 </ TD> <TD>找到最佳值lam1通过交叉验证。</ TD> </ TR> <tr valign="top"> <TD >bestlam2</ TD> <TD> FO lam2发现,通过交叉验证的最佳值。</ TD> </ TR> <tr valign="top"> <TD>lam1s</ TD考虑>的<td>的lam1值。</ TD> </ TR> <tr valign="top"> <TD> lam2s</ TD> <TD>考虑的lam2值。</ TD> < / TR> </ TABLE>
(作者)----------Author(s)----------
Daniela M. Witten and Robert Tibshirani
参考文献----------References----------
regression and classification for high-dimensional problems. Journal
参见----------See Also----------
scout, predict.scoutobject
侦察兵,predict.scoutobject
实例----------Examples----------
data(diabetes)
attach(diabetes)
par(mfrow=c(2,1))
par(mar=c(2,2,2,2))
cv.sc <- cv.scout(x2,y,p1=2,p2=1)
print(cv.sc)
cv.la <- cv.lars(x2,y)
print(c("Lars minimum CV is ", min(cv.la$cv)))
print(c("Scout(2,1) minimum CV is ", min(cv.sc$cv)))
detach(diabetes)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|