July 2017
Beginner to intermediate
715 pages
17h 3m
English
K-means has a drawback: we need to specify the number of clusters K. Sometimes K can be known from the domain problem we are trying to solve. For example, if we know that there are 10 types of clients, we probably want to look for 10 clusters.
However, often we do not have this kind of domain knowledge. In situations like this, we can use a method often referred as the elbow method:
You can do it in the following way:
PrintWriter out = new PrintWriter("distortion.txt"); for (int k = 3; k < 50; k++) { int maxIter = ...