找回密码
 注册
查看: 609|回复: 0

R语言 peperr包 resample.indices()函数中文帮助文档(中英文对照)

  [复制链接]
发表于 2012-9-24 02:30:26 | 显示全部楼层 |阅读模式
resample.indices(peperr)
resample.indices()所属R语言包:peperr

                                        Generation of indices for resampling Procedure
                                         重采样过程生成指数

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Generates training and test set indices for use in resampling estimation of prediction error, e.g. cross-validation or bootstrap (with and without replacement).
生成重采样的预测误差估计,如用于训练和测试集指数交叉验证或引导(无需更换)。


用法----------Usage----------


resample.indices(n, sample.n = 100, method = c("no", "cv" ,"boot", "sub632"))



参数----------Arguments----------

参数:n
number of observations of the full data set.
完整的数据集的观测数。


参数:sample.n
the number of bootstrap samples in case of method="boot" and the number of cross-validation subsets in case of method="cv", e.g. 10 for 10-fold cross-validation. Not considered if method="no", where number of samples is one (the full data set) by definition.
箱子method="boot"和交叉验证的子集的数目method="cv",例如箱子bootstrap样本的数目10为10倍交叉验证。不考虑,如果method="no",样品数为1(数据集)的定义。


参数:method
by default, the training set indices are the same as the test set indices, i.e. the model is assessed in the same data as fitted ("no"). "cv": Cross-validation, "boot": Bootstrap (with replacement), "sub632": Boostrap without replacement, also called subsampling. In the latter case, the number of observations in each sample equals round(0.632 * n), see Details.
默认情况下,训练集指数作为测试集指数是相同的,即评估模型装在相同的数据("no"“)。 "cv":交叉验证,"boot":自举(更换),"sub632":无需更换电池,也被称为二次抽样的自举。在后者的情况下,在每个样品中的观测数等于round(0.632 * n),请参阅详细信息。


Details

详细信息----------Details----------

As each bootstrap sample should be taken as if new data, complexity selection should be carried out in each bootstrap sample. Binder and Schumacher show that when bootstrap samples are drawn with replacement, often too complex models are obtained in high-dimensional data settings. They recommend to draw bootstrap samples without replacement, each of size round(0.632 * n), which equals the expected number of unique observations in one bootstrap sample drawn with replacement, to avoid biased complexity selection and improve predictive power of the resulting models.
由于每个引导应采取样本,如果新的数据,应进行复杂的选择,在每个引导样本。宾德和舒马赫bootstrap样本,绘制更换时,往往过于复杂的模型,得到在高维数据的设置。他们建议提请bootstrap样本,无需更换电池,每个的大小round(0.632 * n),这等于预期的一些独特的观察中得出一个自举样品与更换,以避免偏见的复杂选择和提高最终模型的预测能力。


值----------Value----------

A list containing two lists of length sample.n: <table summary="R valueblock"> <tr valign="top"><td>sample.index</td> <td> contains in each element the indices of observations of one training set.</td></tr> <tr valign="top"><td>not.in.sample</td> <td> contains in each element the indices of observations of one test set, corresponding to the training set in listelement sample.index.</td></tr> </table>
一个列表,其中包含两个列表的长度sample.n:<table summary="R valueblock"> <tr valign="top"> <TD>:sample.index </ TD> <TD>包含的每个元素的观察指标的一个训练集。</ TD> </ TR> <tr valign="top"> <TD>not.in.sample </ TD> <TD>中的每个元素包含一个测试指标的观测集,相应的训练表元素sample.index。</ TD> </ TR> </表>


参考文献----------References----------

<h3>See Also</h3>

实例----------Examples----------


# generate dataset: 100 patients, 20 covariates[生成数据集:100例患者中,20协变量]
data <- matrix(rnorm(2000), nrow=100)

# generate indices for training and test data for 10-fold cross-validation[10倍交叉验证的训练和测试数据的生成指数]
indices <- resample.indices(n=100, sample.n = 10, method = "cv")

# create training and test data via indices[创建训练和测试数据通过指数]
trainingsample1 <- data[indices$sample.index[[1]],]
testsample1 <- data[indices$not.in.sample[[1]],]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-23 22:32 , Processed in 0.019466 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表