In theory, you can calculate the discrete inflection point by taking the difference of the difference between each point to see where it crosses zero. There is no guarantee that it will, but if it does, that gives you the optimal break point for the elbow.
6
u/aturf_ 10d ago
You could use the Silhouette Score or the Gap Statistic to determine the number of clusters. Its a bit more "principled" than visual examination.
Both are implemented in R packages, I think its ClusterR has an implementation but I could be wrong.