cross.val: Cross-validation

View source: R/cross.validation.R

cross.valR Documentation

Cross-validation

Description

Cross-validation

Usage

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.cv

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

## Not run: 

decisions <- data$class
data$class <- NULL

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

## End(Not run)


biocsuwb/EnsembleFS-package documentation built on Dec. 9, 2024, 5:32 p.m.