cv_control: cross validation set-up for model fitting functions

View source: R/utils.R

cv_controlR Documentation

cross validation set-up for model fitting functions

Description

This generates kfold indexes and vectors of reference values for the model fitting loop

Usage

cv_control(data, cv_folds = "kfold")

Arguments

data

A data.frame containing target and explanatory variables. May optionally contain a column with labeled folds and "Test" for test data. See cv_folds.

cv_folds

Control for cross-validation with various options, either:

  • the column name of the fold index supplied in data. Using this option, if there is a fold called "Test", this will serve as test data and held out in the model training.

  • an integer giving the number of cv evaluations to perform. Folds are constructed as block chunks. Default behaviour is 5 folds.

  • NULL indicates that no cross validation should be performed and the returned model is trained on all data.

  • vector of length==nrow(data) containing character or numeric fold labels

Details

....

Value

A named list containing the kfold indexes and the kfold loop reference values

Author(s)

Ciaran Gilbert, ciaran.gilbert@strath.ac.uk


jbrowell/ProbCast documentation built on July 20, 2024, 1:53 p.m.