Returns the index of the nearest centroid to x without
updating the model.
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)
kmeans_stream_update(model, c(0.0, 0.0))
#> [1] 1
kmeans_stream_update(model, c(5.0, 5.0))
#> [1] 2
kmeans_stream_predict(model, c(0.1, 0.1))
#> [1] 1