DSC_Kmeans
From stream v1.23
by Michael Hahsler
Kmeans Macroclusterer
Class implements the kmeans algorithm for reclustering a set of microclusters.
Usage
DSC_Kmeans(k, weighted = TRUE, iter.max = 10, nstart = 1,
algorithm = c("HartiganWong", "Lloyd", "Forgy", "MacQueen"), min_weight = NULL, description=NULL)
Arguments
 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 kmeans (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
 microclusters with a weight less than this will be ignored for reclustering.
 description
 optional character string to describe the clustering method.
Details
Please refer to function kmeans
in stats 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.
Value

An object of class
DSC_Kmeans
(subclass of DSC
,
DSC_R
, DSC_Macro
)
See Also
Examples
stream < DSD_Gaussians(k=3, noise=0)
# create microclusters via sampling
sample < DSC_Sample(k=20)
update(sample, stream, 500)
sample
# recluster microclusters
kmeans < DSC_Kmeans(k=3)
recluster(kmeans, sample)
plot(kmeans, stream, type="both")
# For comparison we use kmeans directly to cluster data
# Note: kmeans is not a data stream clustering algorithm
kmeans < DSC_Kmeans(k=3)
update(kmeans, stream, 500)
plot(kmeans, stream)
Community examples
Looks like there are no examples yet.