Extract Current Centroids from a Streaming K-Means Model
Source:R/stream.R
kmeans_stream_centers.RdReturns the current centroid positions as a matrix. During the warm-up phase, only the centroids initialised so far contain meaningful values.
Arguments
- model
a streaming k-means model created by
kmeans_stream_new
Examples
model <- kmeans_stream_new(k = 2L, d = 2L)
kmeans_stream_update(model, c(1.0, 2.0))
#> [1] 1
kmeans_stream_update(model, c(4.0, 5.0))
#> [1] 2
kmeans_stream_centers(model)
#> [,1] [,2]
#> [1,] 1 2
#> [2,] 4 5