compute_wcss: Compute Whithin-Cluster Sum of Squares

Description Usage Arguments Value Examples

View source: R/RcppExports.R

Description

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

Usage

1
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

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

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