predict_mini_batch {mbkmeans} | R Documentation

## Predict_mini_batch

### Description

Prediction function for mini-batch k-means applied to matrix-like objects.

### Usage

    predict_mini_batch(data, CENTROIDS)

### Arguments

`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.

### Details

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.

### Value

it returns a vector with the clusters.

### Author(s)

Yuwei Ni

### Examples

    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)

[Package mbkmeans version 1.6.1 Index]