News for hackers. Stuff that matters.
Re:Show HN: Want something better than k-means? Try BanditPAM by yeldarb on Wednesday April 05, 2023 @04:45PM (#35460136)
Is there a good heuristic for picking a reasonable number of clusters automatically for an arbitrary set of vectors?
Re:Show HN: Want something better than k-means? Try BanditPAM by esalman on Wednesday April 05, 2023 @05:03PM (#35460347)
I usually go with Davies-Bouldin index but there are a few methods:

Python/Sklearn: https://scikit-learn.org/stable/modules/clustering.html#clus...

R: https://cran.r-hub.io/web/packages/clusterCrit/clusterCrit.p...

Re:Show HN: Want something better than k-means? Try BanditPAM by motiwari on Wednesday April 05, 2023 @04:59PM (#35460299)
The elbow method is pretty common! https://en.wikipedia.org/wiki/Elbow_method_(clustering)

You can also use some regularization criterion (AIC, BIC, or other)

Re:Show HN: Want something better than k-means? Try BanditPAM by syntaxfree on Wednesday April 05, 2023 @06:35PM (#35461381)
You could always try to use a density based clusterer like DBSCAN, HDBSCAN or OPTICS to determine a likely number of clusters.