Skip to contents

Returns the current centroid positions as a matrix. During the warm-up phase, only the centroids initialised so far contain meaningful values.

Usage

kmeans_stream_centers(model)

Arguments

model

a streaming k-means model created by kmeans_stream_new

Value

a k x d numeric matrix of current centroid positions, one centroid per row

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