Select optimal K for k-means clustering
get_kmeans_opt_k.RdDetermines optimal number of clusters (K) for k-means using elbow, silhouette, and gap statistic methods. Use for PUMA clustering diagnostics.
Details
Aggregates optimal K from multiple methods (median or mean).
Returns integer optimal K value for clustering.
Used for diagnostics and zone group selection.
See also
scripts/weighting/zone_groups.R
Other clustering utilities:
entropy_zone_groups(),
kmeans_zone_groups(),
spectral_zone_groups()