calc_wss: Calculate Within-Cluster Sum of Squares for Different k

View source: R/unsupervised-clustering.R

calc_wssR Documentation

Calculate Within-Cluster Sum of Squares for Different k

Description

Used for elbow method to determine optimal k

Usage

calc_wss(data, max_k = 10, nstart = 25)

Arguments

data

A data frame or tibble

max_k

Maximum number of clusters to test (default: 10)

nstart

Number of random starts for each k (default: 25)

Value

A tibble with k and corresponding total within-cluster SS


tidylearn documentation built on Feb. 6, 2026, 5:07 p.m.