powered by
The function randomly generates fold data for cross-validation
do.stratified.cv.data(examples, positives, k = 10, seed = 0)
vector of integer: indices of the examples
vector of integer: Indices of the positive examples. The indices refer to the indices of examples
examples
number of folds (def = 10)
seed of the random generator (def=0). If is set to 0 no initialization is performed
a list with two components;
a list with k components. Each component is a vector with the indices of the non positive elements of the fold
k
a list with k components. Each component is a vector with the indices of the positive elements of the fold
he folds are separated for positive and negative examples. The elements included in each fold are obtained by random sampling the data.
do.stratified.cv.data.from.folds
# NOT RUN { do.stratified.cv.data(1:100, 1:20, k = 10) # }
Run the code above in your browser using DataLab