Learn R Programming

ChemometricsWithR (version 0.1.13)

Evaluation: Evaluation function examples for SA- or GA-based variable selection in classification applications.

Description

Two examples of functions that can be used in variable selection for classification. The outcome of these functions should be maximized by the optimization.

Usage

lda.loofun(x, grouping, subset, ...)
pls.cvfun(x, response, subset, ...)

Arguments

x

Data matrix: independent variables used by eval.fun

grouping

Class vector, possibly a factor

response

Dependent variable, typically a real number

subset

A vector containing the indices of the variables to be included

Further arguments, such as the number of latent variables to use in plscvfun

Value

One value indicating the quality of the subset

Details

The evaluation function should give high values for good subsets, and low values for bad subsets. The lda.loofun function simply counts the number of correct predictions in LOO crossvalidation, and subtracts the number of variables in the subset. Function pls.cvfun returns the mean squared error of cross-validation.

References

R. Wehrens. "Chemometrics with R - Multivariate Data Analysis in the Natural Sciences and Life Sciences". Springer, Heidelberg, 2011.

See Also

GA, SA