Tanveer
Tanveer

Reputation: 900

Cost function value in k-means clustering mahout

How to compute cost function value in k-means clustering using mahout?

I am undergoing Coursera's class on machine learning. And there it was suggested if we go for random initialization of cluster during k-means clustering, to calculate cluster we should do it multiple times with different initial cluster centroids values. Then we should examine the value of cost function to see for which iteration cost incurred is minimum.

Can you please suggest how to calculate cost value in Apache mahout's implementation of k-means clustering?

Upvotes: 3

Views: 6802

Answers (1)

lejlot
lejlot

Reputation: 66815

It is implementation independent. Simply compute the sum of squared distances from points to their respective centroids. This is your cost function.

Upvotes: 7

Related Questions