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

Description Usage Arguments Details Value See Also Examples

Description

The function randomly generates fold data for cross-validation

Usage

1
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

Details

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

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

See Also

do.stratified.cv.data.from.folds

Examples

1
do.stratified.cv.data(1:100, 1:20, k = 10)

Example output

Warning message:
replacing previous import 'BBmisc::isFALSE' by 'backports::isFALSE' when loading 'ParamHelpers' 
$fold.non.positives
$fold.non.positives[[1]]
[1] 58 82 83 21 42 71 95 84

$fold.non.positives[[2]]
[1]  27  72  36  68 100  87  96  78

$fold.non.positives[[3]]
[1] 73 90 24 56 29 40 41 30

$fold.non.positives[[4]]
[1] 48 22 85 38 70 98 57 92

$fold.non.positives[[5]]
[1] 55 75 52 31 91 67 61 46

$fold.non.positives[[6]]
[1] 76 47 34 45 93 60 53 35

$fold.non.positives[[7]]
[1] 69 65 49 23 37 89 80 26

$fold.non.positives[[8]]
[1] 66 63 79 81 43 86 54 39

$fold.non.positives[[9]]
[1] 94 50 74 99 62 59 44 32

$fold.non.positives[[10]]
[1] 25 97 33 64 88 77 51 28


$fold.positives
$fold.positives[[1]]
[1]  2 19

$fold.positives[[2]]
[1] 10  9

$fold.positives[[3]]
[1]  4 17

$fold.positives[[4]]
[1]  3 11

$fold.positives[[5]]
[1] 14 12

$fold.positives[[6]]
[1] 16 13

$fold.positives[[7]]
[1] 5 6

$fold.positives[[8]]
[1] 20  1

$fold.positives[[9]]
[1] 18  8

$fold.positives[[10]]
[1] 15  7

hyperSMURF documentation built on May 2, 2019, 9:20 a.m.