mixmodLearn.default | R Documentation |
MixmodLearn
] classThis function computes the first step of a discriminant analysis. It will find the best classification rule by running an M step from the training observations.
mixmodLearn.default(
data,
knownLabels,
dataType = NULL,
models = NULL,
criterion = "CV",
nbCVBlocks = 10,
weight = NULL
)
data |
frame containing quantitative,qualitative or heterogeneous data. Rows correspond to observations and columns correspond to variables. |
knownLabels |
an integer vector or a factor of size number of observations. Each cell corresponds to a cluster affectation. So the maximum value is the number of clusters. |
dataType |
character. Type of data is "quantitative", "qualitative" or "composite". Set as NULL by default, type will be guessed depending on variables type (in case of homogeneous data). 'composite' type must be specified explicitly. |
models |
a [ |
criterion |
list of character defining the criterion to select the best model. Possible values: "BIC", "CV" or c("CV","BIC"). Default is "CV". |
nbCVBlocks |
integer which defines the number of block to perform the Cross Validation. This value will be ignored if the CV criterion is not chosen. Default value is 10. |
weight |
numeric vector with n (number of individuals) rows. Weight is optional. This option is to be used when weight is associated to the data. |
Returns an instance of the [MixmodLearn
] class. Those two attributes will contain all outputs:
a list of [MixmodResults
] object containing all the results sorted in ascending order
according to the given criterion.
a S4 [MixmodResults
] object containing the best model results.
Florent Langrognet and Remi Lebret and Christian Poli ans Serge Iovleff, with contributions from C. Biernacki and G. Celeux and G. Govaert contact@mixmod.org
## A quantitative example with the famous iris data set
learn.iris <- mixmodLearn(iris[1:4], iris$Species)
## get summary
summary(learn.iris)
## A qualitative example with the famous birds data set
data(birds)
birds.partition <- as.integer(c(rep(1, 34), rep(2, 35)))
learn.birds <- mixmodLearn(data = birds, knownLabels = birds.partition)
## get summary
summary(learn.birds)
## A composite example with a heterogeneous data set
data(heterodatatrain)
learn.hetero <- mixmodLearn(heterodatatrain[-1], knownLabels = heterodatatrain$V1)
## get summary
summary(learn.hetero)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.