Learn R Programming

nestfs (version 1.0.3)

create.folds: Cross-validation folds

Description

Create a list of indices corresponding to cross-validation folds.

Usage

create.folds(num.folds, num.rows, seed = NULL)

Value

A list of length num.folds containing the indices of the observations to be withdrawn for validation in each fold.

Arguments

num.folds

Number of folds to be created.

num.rows

Number of observations in the dataset.

seed

Seed of the random number generator. If NULL, the folds generated will be different at each invocation; for reproducibility of results, it is recommended to set this to a specific value.

Examples

Run this code
all.folds <- create.folds(50, 307, 0)

Run the code above in your browser using DataLab