cross.val: Cross-validation

Description Usage Arguments Details Value Examples

View source: R/cross.validation.R

Description

Cross-validation

Usage

1
cross.val(x, y, method, params.cv = list(niter = 10, k = 3, test.size = 0.3))

Arguments

x

input data where columns are variables and rows are observations (all numeric)

y

decision variable as a boolean vector of length equal to number of observations

method

cross-validation method kfoldcv for cross-validation k-fold or rsampling for random sampling

params

A list with the following fields:

  • niter – the number of validation repetitions

  • k – the number of groups that a given data sample is to be split into

  • test.size – testing set size for random sampling validation

Details

creates a list with division of observational indices of the dataframe of observational indices into training and test subsamples of a given number of iterations Implements two methods : cross-validation k-fold and random sampling

Value

A list with lindices divided into train and test subsamples niter repetitions.

Examples

1
2
3
4
decisions <- data$class
data$class <- NULL

list.index.cross <- cross.val(x = data, y = decisions, method = 'kfoldcv', params.cv = list(niter = 10, k = 3))

pavhrablis/benchmarkFS documentation built on Feb. 5, 2021, 12:47 a.m.