compute_wcss {mbkmeans} | R Documentation

## Compute Whithin-Cluster Sum of Squares

### Description

Given a vector of cluster labels, a matrix of centroids, and a dataset, it computes the WCSS.

### Usage

    compute_wcss(clusters, cent, data)

### Arguments

`clusters` | numeric vector with the cluster assignments.
`cent` | numeric matrix with the centroids (clusters in rows, variables in columns).
`data` | matrix-like object containing the data (numeric or integer).

### Value

A numeric vector with the value of WCSS per cluster.

### Examples

    data = matrix(1:30,nrow = 10)
    cl <- mini_batch(data, 2, 10, 10)
    compute_wcss(cl$Clusters, cl$centroids, data)

[Package mbkmeans version 1.8.0 Index]