Learn R Programming

MapperAlgo (version 1.0.3)

find_best_k_for_kmeans: Find the optimal number of clusters for k-means

Description

This function calculates the total within-cluster sum of squares (WSS) for a range of cluster numbers and identifies the best number of clusters (k) based on the elbow method.

Usage

find_best_k_for_kmeans(dist_object, max_clusters = 10)

Value

The optimal number of clusters (k) based on the elbow method.

Arguments

dist_object

A distance matrix or data frame containing the data to be clustered.

max_clusters

The maximum number of clusters to test for k-means. Default is 10.