cv.mogavs: k-Fold Crossvalidation for a mogavs model
Description
Performs k-fold CV for a model of class mogavs via the cvTools package.
Usage
cv.mogavs(mogavs, nvar, data, y_ind, K = 10, R = 1, order = FALSE)
Arguments
mogavs
A model of class mogavs.
nvar
The number of variables for which you want to run k-fold CV.
data
Used data set.
y_ind
The column number for the y-variable in the dataset.
K
Number of folds in the cross-validation, default K=10.
R
Number of repeats for the CV, default R=1.
order
Logical, whether the result should be sorted by the column CVerror.
Value
A data frame with the following columns:
archInd
The row index of the linear model in the archiveSet of the mogavs model.
formula
The formula of the linear model as a character string.
CVerror
The root mean square error of the model.
CVse
The standard error of the model across the R runs of the cross-validation. NA if R=1.
%% If it is a LIST, use
%% \item{comp1 }{Description of 'comp1'}
%% \item{comp2 }{Description of 'comp2'}
%% ...
Details
Perform k-fold cross-validation for all the linear models with nvar number of variables, which have been tried during the course of the genetic algorithm.