aberger
aberger

Reputation: 2397

Can I get "inertia" for sklearn Birch clusters?

Scikit-learn MiniBatchKMeans has an inertia field that can be used to see how tight clusters are. Does the Birch clustering algorithm have an equivalent? There does not seem to be in the documentation.

If there is no built in way to check this measurement, does it make sense to find the average euclidian distance for each point's closest neighbor in each cluster., then find the mean of those average distances?

Upvotes: 0

Views: 1256

Answers (1)

Has QUIT--Anony-Mousse
Has QUIT--Anony-Mousse

Reputation: 77454

Nothing is free, and you don't want algorithms to perform unnecessary computations.

Inertia is only sensible for k-means (and even then, do not compare different values of k), and it's simply the variance sum of the data. I.e. compute the mean of every cluster, then the squared deviations from it. Don't compute distances, the equation is simply ((x-mu)**2).sum()

Upvotes: 1

Related Questions