DSC_Kmeans | R Documentation |
Macro Clusterer. Class implements the k-means algorithm for reclustering a set of micro-clusters.
DSC_Kmeans(
formula = NULL,
k,
weighted = TRUE,
iter.max = 10,
nstart = 10,
algorithm = c("Hartigan-Wong", "Lloyd", "Forgy", "MacQueen"),
min_weight = NULL,
description = NULL
)
formula |
|
k |
either the number of clusters, say k, or a set of initial (distinct) cluster centers. If a number, a random set of (distinct) rows in x is chosen as the initial centers. |
weighted |
use a weighted k-means (algorithm is ignored). |
iter.max |
the maximum number of iterations allowed. |
nstart |
if centers is a number, how many random sets should be chosen? |
algorithm |
character: may be abbreviated. |
min_weight |
micro-clusters with a weight less than this will be ignored for reclustering. |
description |
optional character string to describe the clustering method. |
update()
and recluster()
invisibly return the assignment of the data points
to clusters.
Please refer to function stats::kmeans()
for more details on
the algorithm.
Note that this clustering cannot be updated iteratively and every time it is used for (re)clustering, the old clustering is deleted.
An object of class DSC_Kmeans
(subclass of DSC,
DSC_R, DSC_Macro)
Michael Hahsler
Other DSC_Macro:
DSC_DBSCAN()
,
DSC_EA()
,
DSC_Hierarchical()
,
DSC_Macro()
,
DSC_Reachability()
,
DSC_SlidingWindow()
# 3 clusters with 5% noise
stream <- DSD_Gaussians(k = 3, d = 2, noise = 0.05)
# Use a moving window for "micro-clusters and recluster with k-means (macro-clusters)
cl <- DSC_TwoStage(
micro = DSC_Window(horizon = 100),
macro = DSC_Kmeans(k = 3)
)
update(cl, stream, 500)
cl
plot(cl, stream)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.