Title: | Order Constrained Solutions in k-Means Clustering |
---|---|
Description: | Extends 'flexclust' with an R implementation of order constrained solutions in k-means clustering (Steinley and Hubert, 2008, <doi:10.1007/s11336-008-9058-z>). |
Authors: | Sebastian Krey [aut, cre], Friedrich Leisch [aut], Sebastian Hoffmeister [ctb] |
Maintainer: | Sebastian Krey <[email protected]> |
License: | GPL-2 | GPL-3 |
Version: | 1.1 |
Built: | 2024-11-12 06:35:12 UTC |
Source: | CRAN |
Runs ockc for different numbers of clusters on bootstrap replica of the original data (maintaining the supplied order) and returns corresponding cluster assignments, centroids and Rand indices comparing pairs of partitions.
bootockc(x, k, nboot = 100, order = NULL, correct = TRUE, seed = NULL, multicore = TRUE, verbose = FALSE, ...)
bootockc(x, k, nboot = 100, order = NULL, correct = TRUE, seed = NULL, multicore = TRUE, verbose = FALSE, ...)
x , k , ...
|
Passed to |
nboot |
Number of bootstrap pairs (maintaining order). |
order |
Order restriction of |
correct |
Logical, correct the index for agreement by chance? |
seed |
If not |
multicore |
Use parallelization, if available. For examples and additional
documentation see |
verbose |
Logical, show progress information during computations.
Ignored if |
Returns an object of class "bootFlexclust"
.
Sebastian Krey
ockc
, bootFlexclust
, stepFlexclust
x <- rbind(cbind(rnorm(10, mean=0), rnorm(10, mean=0,), rnorm(10, mean=0)), cbind(rnorm(10, mean=10), rnorm(10, mean=10), rnorm(10, mean=0)), cbind(rnorm(10, mean=10), rnorm(10, mean=0), rnorm(10, mean=10)), cbind(rnorm(10, mean=10), rnorm(10, mean=10), rnorm(10, mean=10)) ) bockc <- bootockc(x, 2:4, nboot=4, order=c(1:10, 21:40, 11:20), multicore=FALSE, verbose=FALSE) bockc
x <- rbind(cbind(rnorm(10, mean=0), rnorm(10, mean=0,), rnorm(10, mean=0)), cbind(rnorm(10, mean=10), rnorm(10, mean=10), rnorm(10, mean=0)), cbind(rnorm(10, mean=10), rnorm(10, mean=0), rnorm(10, mean=10)), cbind(rnorm(10, mean=10), rnorm(10, mean=10), rnorm(10, mean=10)) ) bockc <- bootockc(x, 2:4, nboot=4, order=c(1:10, 21:40, 11:20), multicore=FALSE, verbose=FALSE) bockc
Calculates an order constrained clustering solution (default k-means) on a data matrix.
ockc(x, k, family = kccaFamily("kmeans"), order = NULL, control = NULL, save.data = FALSE, multicore = FALSE, ...)
ockc(x, k, family = kccaFamily("kmeans"), order = NULL, control = NULL, save.data = FALSE, multicore = FALSE, ...)
x |
A numeric matrix of data. |
k |
An integer vector of number of clusters. For each element of k a clustering solution is computed (reusage of intermediate results makes this more efficient than individual calls of ockc). |
family |
Object of class |
order |
Order restriction of |
control |
An object of class |
save.data |
Save a copy of |
multicore |
Use parallelization, if available. For examples and additional
documentation see |
... |
Additional options for |
Sebastian Krey, Friedrich Leisch, Sebastian Hoffmeister
Steinley, D. and Hubert, L. (2008). Order-Constrained Solutions in K-Means Clustering: Even Better Than Being Globally Optimal. Psychometrika, 73 (4), pp. 647-664.
x <- rbind(cbind(rnorm(10, mean=0), rnorm(10, mean=0,), rnorm(10, mean=0)), cbind(rnorm(10, mean=10), rnorm(10, mean=10), rnorm(10, mean=0)), cbind(rnorm(10, mean=10), rnorm(10, mean=0), rnorm(10, mean=10)), cbind(rnorm(10, mean=10), rnorm(10, mean=10), rnorm(10, mean=10)) ) res <- ockc(x, k=4, nboot=4, order=c(1:10, 21:40, 11:20)) res
x <- rbind(cbind(rnorm(10, mean=0), rnorm(10, mean=0,), rnorm(10, mean=0)), cbind(rnorm(10, mean=10), rnorm(10, mean=10), rnorm(10, mean=0)), cbind(rnorm(10, mean=10), rnorm(10, mean=0), rnorm(10, mean=10)), cbind(rnorm(10, mean=10), rnorm(10, mean=10), rnorm(10, mean=10)) ) res <- ockc(x, k=4, nboot=4, order=c(1:10, 21:40, 11:20)) res