generateCVRuns(TunePareto)
generateCVRuns()所属R语言包:TunePareto
Generate cross-validation partitions
生成交叉验证分区
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function generates a set of partitions for a cross-validation. It can be employed if the same cross-validation settings should be used in the objective functions of several experiments. The resulting fold list can be passed to the cross-validation objective functions (see predefinedObjectiveFunctions) and the internal cross-validation precalculation function crossValidation.
这个函数生成一组分区交叉验证。它可以采用,如果相同的交叉验证的设置应中使用的几个实验的目标函数。将所得的倍数列表可以被传递到的交叉验证目标函数(参见predefinedObjectiveFunctions)和内部交叉验证预先计算函数crossValidation。
用法----------Usage----------
generateCVRuns(labels,
ntimes = 10,
nfold = 10,
leaveOneOut = FALSE,
stratified = FALSE)
参数----------Arguments----------
参数:labels
A vector of class labels of the data set to be used for the cross-validation.
类的数据的标签的向量设置用于交叉验证。
参数:nfold
The number of groups of the cross-validation. Ignored if leaveOneOut=TRUE.
交叉验证的基团的数目。如果忽略leaveOneOut=TRUE。
参数:ntimes
The number of repeated runs of the cross-validation.
交叉验证的反复运行的数目。
参数:leaveOneOut
If this is true, a leave-one-out cross-validation is performed, i.e. each sample is left out once in the training phase and used as a test sample
如果这是真的,离开一个进行交叉验证,即每个样品离开了曾经在训练阶段和使用作为测试样本
参数:stratified
If set to true, a stratified cross-validation is carried out. That is, the percentage of samples from different classes in the cross-validation folds corresponds to the class sizes in the complete data set. If set to false, the folds may be unbalanced.
如果设置为true,进行分层交叉验证。即是,从不同的类中的交叉验证褶皱的样品的百分比对应于在完整的数据集的类的大小。如果设置为false,则可能是不平衡的褶皱。
值----------Value----------
A list with ntimes elements, each representing a cross-validation run. Each of the runs is a list of nfold vectors specifying the indices of the samples to be left out in the folds.
ntimes元素,每个交叉验证运行列表。运行是一个nfold向量指定指数的样本被排除在外的褶皱列表。
参见----------See Also----------
predefinedObjectiveFunctions, crossValidation
predefinedObjectiveFunctions,crossValidation
实例----------Examples----------
# precalculate the cross-validation partitions[预先计算的交叉验证分区]
foldList <- generateCVRuns(labels = iris[, ncol(iris)],
ntimes = 10,
nfold = 10,
stratified=TRUE)
# build a list of objective functions[建立一个目标函数列表]
objectiveFunctions <- list(cvError(foldList=foldList),
cvSensitivity(foldList=foldList,caseClass="setosa"))
# pass them to tunePareto[通过他们tunePareto]
print(tunePareto(data = iris[, -ncol(iris)],
labels = iris[, ncol(iris)],
classifier = tunePareto.knn(),
k = c(3,5,7,9),
objectiveFunctions = objectiveFunctions))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|