Learn R Programming

hyperSMURF (version 2.0)

do.stratified.cv.data: Construction of random folds for cross-validation

Description

The function randomly generates fold data for cross-validation

Usage

do.stratified.cv.data(examples, positives, k = 10, seed = 0)

Arguments

examples

vector of integer: indices of the examples

positives

vector of integer: Indices of the positive examples. The indices refer to the indices of examples

k

number of folds (def = 10)

seed

seed of the random generator (def=0). If is set to 0 no initialization is performed

Value

a list with two components;

fold.non.positives

a list with k components. Each component is a vector with the indices of the non positive elements of the fold

old.positives

a list with k components. Each component is a vector with the indices of the positive elements of the fold

Details

he folds are separated for positive and negative examples. The elements included in each fold are obtained by random sampling the data.

See Also

do.stratified.cv.data.from.folds

Examples

Run this code
# NOT RUN {
do.stratified.cv.data(1:100, 1:20, k = 10)
# }

Run the code above in your browser using DataLab