KMeansClustering {sharp} | R Documentation |
(Sparse) K-means clustering
Description
Runs k-means clustering using implementation from
kmeans
. This function is not using stability.
Usage
KMeansClustering(xdata, nc = NULL, Lambda = NULL, ...)
Arguments
xdata |
data matrix with observations as rows and variables as columns. |
nc |
matrix of parameters controlling the number of clusters in the
underlying algorithm specified in |
Lambda |
vector of penalty parameters (see argument |
... |
additional parameters passed to |
Value
A list with:
comembership |
an array of binary and symmetric co-membership matrices. |
weights |
a matrix of median weights by feature. |
References
Witten DM, Tibshirani R (2010). “A Framework for Feature Selection in Clustering.” Journal of the American Statistical Association, 105(490), 713-726. doi:10.1198/jasa.2010.tm09415, PMID: 20811510.
See Also
Other clustering algorithms:
DBSCANClustering()
,
GMMClustering()
,
HierarchicalClustering()
,
PAMClustering()
Examples
# Data simulation
set.seed(1)
simul <- SimulateClustering(n = c(10, 10), pk = 50)
# K means clustering
mykmeans <- KMeansClustering(xdata = simul$data, nc = seq_len(20))
# Sparse K means clustering
if (requireNamespace("sparcl", quietly = TRUE)) {
mykmeans <- KMeansClustering(
xdata = simul$data, nc = seq_len(20),
Lambda = c(2, 5)
)
}