compute_wcss: Compute Whithin-Cluster Sum of Squares

View source: R/RcppExports.R

compute_wcssR 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)


drisso/mbkmeans documentation built on April 6, 2022, 4:33 a.m.