View source: R/cross.validation.R
cross.val | R Documentation |
Cross-validation
cross.val(x, y, method, params.cv = list(niter = 10, k = 3, test.size = 0.3))
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 |
params.cv |
A
|
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
A list
with lindices divided into train and test subsamples niter repetitions.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.