Description Usage Arguments Details Value Author(s) References See Also Examples
Performs a Quadratic Discriminant Analysis
1 2 |
variables |
matrix or data frame with explanatory variables |
group |
vector or factor with group memberships |
prior |
optional vector of prior probabilities. Default
|
validation |
type of validation, either |
learn |
optional vector of indices for a learn-set. Only used when
|
test |
optional vector of indices for a test-set. Only used when
|
prob |
logical indicating whether the group classification results should be expressed in probability terms |
functions |
logical indicating whether the discriminant functions should be computed explicitly and returned |
When validation=NULL
there is no validation
When
validation="crossval"
cross-validation is performed by randomly
separating the observations in ten groups.
When
validation="learntest"
validation is performed by providing a
learn-set and a test-set of observations.
An object of class "quada"
, basically a list with the
following elements:
functions |
discriminant functions - a list with an element for each group which, in turn, is a list containing an upper triangular matrix containing the coefficients of the quadratict terms, a vector containing the coefficients of the linear terms and a constant |
confusion |
confusion matrix |
scores |
discriminant scores for each observation |
classification |
assigned class |
error_rate |
misclassification error rate |
Gaston Sanchez
Lebart L., Piron M., Morineau A. (2006) Statistique Exploratoire Multidimensionnelle. Dunod, Paris.
Tenenhaus G. (2007) Statistique. Dunod, Paris.
Tuffery S. (2011) Data Mining and Statistics for Decision Making. Wiley, Chichester.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
# load iris dataset
data(iris)
# quadratic discriminant analysis with no validation
my_qua1 = quaDA(iris[,1:4], iris$Species)
my_qua1$confusion
my_qua1$error_rate
# quadratic discriminant analysis with cross-validation
my_qua2 = quaDA(iris[,1:4], iris$Species, validation="crossval")
my_qua2$confusion
my_qua2$error_rate
# quadratic discriminant analysis with learn-test validation
learning = c(1:40, 51:90, 101:140)
testing = c(41:50, 91:100, 141:150)
my_qua3 = quaDA(iris[,1:4], iris$Species, validation="learntest",
learn=learning, test=testing)
my_qua3$confusion
my_qua3$error_rate
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.