Subroutine for creating k ~equal-sized subsamples of a rank-1 array. The array indices are shuffled using the Fisher–Yates algorithm. Then, k logical masks are constructed for the k subsamples.
Subroutine for creating k ~equal-sized samples of a rank-1 array. The array indices are shuffled using the Fisher–Yates algorithm. Then, k logical masks are constructed. In each mask, the indices belonging to one of the k folds (not part of the sample) are set to .false. and the remaining indices are set to .true., making the masks directly suitable for k-fold cross-validation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=i4), | intent(in) | :: | m |
size of population (array) |
||
| integer(kind=i4), | intent(in) | :: | k |
number of subsample sets |
||
| logical, | intent(out) | :: | mask(m,k) |
index mask for sampled data |