Computes Functional Classification using k-fold cross-validation
classif.kfold(
formula,
data,
classif = "classif.glm",
par.classif,
kfold = 10,
param.kfold = NULL,
measure = "accuracy",
cost,
models = FALSE,
verbose = FALSE
)
Best fitted model computed by the k-fold CV using the method indicated
in the classif
argument and also returns:
param.min
, value of parameter (or parameters) selected by k-fold CV.
params.error
, k-fold CV error for each parameter combination.
pred.kfold
, predicted response computed by k-fold CV.
model
, if TRUE
, list of models for each parameter combination.
an object of class formula
(or one that can be coerced to that class):
a symbolic description of the model to be fitted. The procedure only considers functional covariates (not implemented for non-functional covariates).
list
, it contains the variables in the model.
character, name of classification method to be used in fitting the model, see Details
section.
list
of arguments used in the classification method.
integer
, number of k-fold.
list
, arguments related to number of k-folds for each covariate, see Details
section.
character
, type of measure of accuracy used, see cat2meas
function.
numeric
, see cat2meas
function.
logical
. If TRUE
, return a list of the fitted models used, (k-fold -1) X (number of parameters)
logical
. If TRUE
, print some internal results.
Manuel Febrero-Bande, Manuel Oviedo de la Fuente manuel.oviedo@udc.es
Parameters for k-fold cross validation:
Number of basis elements:
Data-driven basis such as Functional Principal Componetns (PC). No implemented for PLS basis yet.
Fixed basis (bspline, fourier, etc.).
Option used in some classifiers such as classif.glm
, classif.gsam
, classif.svm
, etc.
Bandwidth parameter. Option used in non-parametric classificiation models such as classif.np
and classif.gkam
.
if (FALSE) {
data(tecator)
cutpoint <- 18
tecator$y$class <- factor(ifelse(tecator$y$Fat
Run the code above in your browser using DataLab