Description Usage Arguments Value See Also Examples
Runs flexmix
repeatedly for different cluster values and returns the result with highest likelihood value.
1 |
cluster |
List of initial cluster assignments of observations at the start of the EM algorithm. |
verbose |
If |
drop |
If |
unique |
If |
... |
Passed to |
An object of class "stepFlexmix"
containing the best models with respect to the log likelihood for the different number of components in a slot if length(k)>1
, else directly an object of class "flexmix"
.
If unique=FALSE
, then the resulting object contains one model per element of k
(which is the number of clusters the EM algorithm started with).
If unique=TRUE
, then the result is resorted according to the number of clusters contained in the fitted models (which may be less than the number with which
the EM algorithm started), and only the maximum likelihood solution for each number of fitted clusters is kept. This operation can also be done manually by
calling unique()
on objects of class "stepFlexmix"
.
Other mixtures: FLXMCL-class
,
FLXPwlda-class
, FLXPwlda
,
myfitted
, mypredict
1 2 3 4 5 6 7 8 9 10 | library(benchData)
data <- xor3Data(500)
model <- FLXMCLmultinom(trace = FALSE, decay = 0.1)
cluster <- lapply(1:5, kmeans(data$x, centers = 3)$cluster)
fit <- myStepFlexmix(y ~ ., data = as.data.frame(data), concomitant = FLXPmultinom(~ x.1 + x.2), model = model,
cluster = cluster, control = list(verb = 1, tolerance = 10^-1))
fit2 <- flexmix(y ~ ., data = as.data.frame(data), concomitant = FLXPmultinom(~ x.1 + x.2), model = model,
cluster = posterior(fit), control = list(verb = 1))
pred <- mypredict(fit2, aggregate = TRUE)
mean(max.col(pred[[1]]) != data$y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.