View source: R/compute_labels.R
predict_mini_batch_r | R Documentation |
Given a data matrix and a centroid matrix, it assigns each data point to the closest centroid, using block processing.
predict_mini_batch_r( data, centroids, BPPARAM = BiocParallel::SerialParam(), ... )
data |
a matrix-like object with features in row and samples in columns. |
centroids |
a matrix with the coordinates of the centroids. |
BPPARAM |
for parallel computations. See the 'BiocParallel' package. |
... |
passed to 'blockApply'. |
a vector of cluster labels for each observation.
data(iris) km <- mini_batch(as.matrix(iris[,1:4]), clusters = 3, batch_size = 10, max_iters = 100) predict_mini_batch_r(t(as.matrix(iris[,1:4])), km$centroids)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.