Nayana Madhu
Nayana Madhu

Reputation: 1225

How to find degree of fit in Kmeans++ clustering in python

How to find degree of fit in K-means++ clustering such that it shows how much percentage the inputs are aligned to each clusters. For instance, input A is in cluster 1 for 0.4 and in cluster 2 for 0.6.

Upvotes: 0

Views: 167

Answers (2)

desertnaut
desertnaut

Reputation: 60319

The standard k-means is a hard clustering algorithm, i.e. there is no degree of fit; data points belong to one and only one cluster. Here is a quote from a relevant academic paper (emphasis added):

2.3.1. Hard k-means

[...]

In k-means clustering only bivalent membership degrees of object i to cluster k are allowed: λ[i,k]∈{0,1}. If an object i is a member of a cluster it cannot be a member of any other cluster

K-means++ is just an algorithm for choosing the initial values (seeds) for k-means, and it does not change the fundamental character of k-means as a hard clustering algorithm.

Upvotes: 1

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

Reputation: 77454

There are "soft" variants of k-means that allow this.

In particular, fuzzy-c-means (don't ask me why they use c instead of k...)

But beware that the resulting soft assignment is far from a statistical probability. It's just a number that gives some relative weight based on the squared distance, without any strong statistical model.

Upvotes: 0

Related Questions