scikit-learn: Finding the features that contribute to each KMeans cluster

后端 未结 5 540
生来不讨喜
生来不讨喜 2021-01-31 20:19

Say you have 10 features you are using to create 3 clusters. Is there a way to see the level of contribution each of the features have for each of the clusters?

What I w

5条回答
  •  北海茫月
    2021-01-31 20:29

    It might be difficult to talk about feature importance separately for each cluster. Rather, it could be better to talk globally about which features are most important for separating different clusters.

    For this goal, a very simple method is described as follow. Note that the Euclidean distance between two cluster centers is a sum of square difference between individual features. We can then just use the square difference as the weight for each feature.

提交回复
热议问题