partition.cv(sperrorest)
partition.cv()所属R语言包:sperrorest
Partition the data for a (non-spatial) cross-validation
分区数据(非空间)交叉验证
译者:生物统计家园网 机器人LoveR
描述----------Description----------
partition.cv creates a represampling object for length(repetition)-repeated nfold-fold cross-validation.
partition.cv创建一个represamplinglength(repetition)重复nfold倍交叉验证的对象。
用法----------Usage----------
partition.cv(data, coords = c("x", "y"), nfold = 10,
repetition = 1, seed1 = NULL, return.factor = FALSE)
参数----------Arguments----------
参数:data
data.frame containing at least the columns specified by coords
data.frame的至少包含列指定的coords
参数:coords
(ignored by partition.cv)
(忽略的partition.cv)
参数:nfold
number of partitions (folds) in nfold-fold cross-validation partitioning
在nfold倍的交叉验证分区的分区数(倍)
参数:repetition
numeric vector: cross-validation repetitions to be generated. Note that this is not the number of repetitions, but the indices of these repetitions. E.g., use repetition=c(1:100) to obtain (the 'first') 100 repetitions, and repetition=c(101:200) to obtain a different set of 100 repetitions.
数字向量:交叉验证的重复产生。注意,这是不重复的次数,但这些重复的指数。例如,使用repetition=c(1:100)(“第一个”)取得100个重复,和repetition=c(101:200)获得一组不同的重复100次。
参数:seed1
seed1+i is the random seed that will be used by set.seed in repetition i (i in repetition) to initialize the random number generator before sampling from the data set.
seed1+i是随机的种子,将用于set.seed重复i(irepetition)采样前的数据初始化随机数生成器设置。
参数:return.factor
if FALSE (default), return a represampling object; if TRUE (used internally by other sperrorest functions), return a list containing factor vectors (see Value)
如果FALSE(默认),返回一个represampling对象,如果TRUE(内部使用其他sperrorest功能的),返回一个list因子矢量(见值)
Details
详细信息----------Details----------
This function does not actually perform a cross-validation or partition the data set itself; it simply creates a data structure containing the indices of training and test samples.
实际上,这个函数不执行交叉验证或分区数据集本身,它只是简单地创建一个数据结构,包含训练和测试样本的指数。
值----------Value----------
If return.factor=FALSE (the default), a represampling object. Specifically, this is a (named) list of length(repetition) resampling objects. Each of these resampling objects is a list of length nfold corresponding to the folds. Each fold is represented by a list of containing the components train and test, specifying the indices of training and test samples (row indices for data). If return.factor=TRUE (mainly used internally), a (named) list of length length(repetition). Each component of this list is a vector of length nrow(data) of type factor, specifying for each sample the fold to which it belongs. The factor levels are factor(1:nfold).
如果return.factor=FALSE(默认值),一个represampling对象。具体而言,这是一个(命名)length(repetition)resampling的对象列表。这些resampling对象中的每一个是一个列表的长度nfold对应的褶皱。每个倍数的列表,包含的组件为代表的train和test,指定指数的训练和测试样本(行索引为data)。如果return.factor=TRUE(主要是内部使用),(命名)列表的长度length(repetition)。此列表中的每个组件是一个向量,长度为nrow(data)类型factor,指定对每个样品的褶皱,它属于。因子水平是factor(1:nfold)。
参见----------See Also----------
sperrorest, represampling
sperrorest,represampling
实例----------Examples----------
data(ecuador)
## non-spatial cross-validation:[#非空间交叉验证:]
resamp = partition.cv(ecuador, nfold = 5, repetition = 1:2)
plot(resamp, ecuador)
# first repetition, second fold, test set indices:[第一次重复,第二次倍数,测试集指数:]
idx = resamp[["1"]][[2]]$test
# test sample used in this particular repetition and fold:[在这个特殊的重复和倍数试验所用样品:]
ecuador[ idx , ]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|