Description Usage Arguments Details Value Author(s) Examples
Prediction function for mini-batch k-means applied to matrix-like objects.
1 | predict_mini_batch(data, CENTROIDS)
|
data |
matrix-like objectcontaining numeric or integer data (obseravtions in rows, variables in columns). |
CENTROIDS |
a matrix of initial cluster centroids. The rows of the CENTROIDS matrix should be equal to the number of clusters and the columns should equal the columns of the data. |
This function takes the data and the output centroids and returns the clusters.
This implementation relies very heavily on the
MiniBatchKmeans
implementation. We provide the
ability to work with other matrix-like objects other than base matrices (e.g,
DelayedMatrix and HDF5Matrix) through the beachmat
library.
it returns a vector with the clusters.
Yuwei Ni
1 2 3 4 5 | data(iris)
km = mini_batch(as.matrix(iris[,1:4]), clusters = 3,
batch_size = 10, max_iters = 10)
clusters = predict_mini_batch(as.matrix(iris[,1:4]),
CENTROIDS = km$centroids)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.