predict_mini_batch: Predict_mini_batch

Description Usage Arguments Details Value Author(s) Examples

View source: R/RcppExports.R

Description

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

Usage

1

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

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)

mbkmeans documentation built on Nov. 15, 2020, 2:07 a.m.