Learn R Programming

tidylearn (version 0.1.0)

calc_wss: 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)

Value

A tibble with k and corresponding total within-cluster SS

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)