Processes a single observation, updating the nearest centroid in place.
During the warm-up phase (first k observations), each point is
used directly as an initial centroid.
Arguments
- model
a streaming k-means model created by
kmeans_stream_new- x
a numeric vector of length
d
Examples
model <- kmeans_stream_new(k = 2L, d = 2L)
assignment <- kmeans_stream_update(model, c(1.0, 2.0))
assignment
#> [1] 1