This function builds a classification model using Canonical Discriminant Analysis.
CDA(
train,
labels,
tune = FALSE,
methodparameters = NULL,
graph = FALSE,
seed = NULL,
...
)The classification model, as an object of class cda.
The training set (description), as a data.frame.
Class labels of the training set (vector or factor).
If true, the function returns parameters instead of a classification model.
Present for interface consistency with performance
(which always passes it when fitting a model). Currently unused: CDA does not
support reusing pre-tuned parameters.
Present for interface consistency with performance (which always
passes it when fitting a model). Currently unused: CDA does not produce a plot.
A specified seed for random number generation, so that two runs on the same data give the same model. Every learning method accepts it, so that it can be set the same way whatever the method; the deterministic ones simply have nothing to draw and give the same model with or without it.
Other parameters.
The projection is computed from the class sizes, as the between-class scatter requires. The
predictions, on the other hand, use equal prior probabilities -- an observation goes
to the nearest class centre in the canonical space, whatever the size of that class. This is
the geometric reading plot.cda draws, and it is where CDA differs from
LDA, which weights the classes by their observed frequencies: on an
imbalanced problem the two do not predict the same thing.
plot.cda, predict.cda, cda-class
require (datasets)
data (iris)
CDA (iris [, -5], iris [, 5])
Run the code above in your browser using DataLab