Learn R Programming

fda.usc (version 2.1.0)

classif.kfold: Functional Classification usign k-fold CV

Description

Computes Functional Classification using k-fold cross-validation

Usage

classif.kfold(
  formula,
  data,
  classif = "classif.glm",
  par.classif,
  kfold = 10,
  param.kfold = NULL,
  measure = "accuracy",
  cost,
  models = FALSE,
  verbose = FALSE
)

Value

Best fitted model computed by the k-fold CV using the method indicated in the classif argument and also returns:

  1. param.min, value of parameter (or parameters) selected by k-fold CV.

  2. params.error, k-fold CV error for each parameter combination.

  3. pred.kfold, predicted response computed by k-fold CV.

  4. model, if TRUE, list of models for each parameter combination.

Arguments

formula

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

data

list, it contains the variables in the model.

classif

character, name of classification method to be used in fitting the model, see Details section.

par.classif

list of arguments used in the classification method.

kfold

integer, number of k-fold.

param.kfold

list, arguments related to number of k-folds for each covariate, see Details section.

measure

character, type of measure of accuracy used, see cat2meas function.

cost

numeric, see cat2meas function.

models

logical. If TRUE, return a list of the fitted models used, (k-fold -1) X (number of parameters)

verbose

logical. If TRUE, print some internal results.

Author

Manuel Febrero-Bande, Manuel Oviedo de la Fuente manuel.oviedo@udc.es

Details

Parameters for k-fold cross validation:

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

  2. Bandwidth parameter. Option used in non-parametric classificiation models such as classif.np and classif.gkam.

Examples

Run this code
if (FALSE) {
data(tecator)    
cutpoint <- 18
tecator$y$class <- factor(ifelse(tecator$y$Fat

Run the code above in your browser using DataLab