I am having a dataset of customers where each customer is represented as some feature vector and I am applying K-means algorithm to this dataset. On the basis of those features, I can abstract and give names to these clusters. But I want to map demographic features on these clusters to validate my clusters whether they make sense or not.

Now for example I have original data set of 100 customers with 90 females and 10 males.

I suppose find 4 clusters and each is of size 25. In Cluster No: 1,2 and 3, I have all males and no females. In Cluster No: 4, I have 15 males and 10 females.

How to map genders to these clusters to describe clusters as male or female dominating ?

Am I making sense here ?

  • $\begingroup$ Try computing histograms for each cluster... good luck: I don't think k-means works well on such data. $\endgroup$ Feb 17, 2016 at 16:19
  • 1
    $\begingroup$ In this specific example setting, all clusters you found are dominated by males. You might want to add a better example. If you clustered all customers already, you can simply output the average gender (male = 0, female = 1) which gives you the ratio of gender for each cluster.finally, you might want to use an algorithm that does not require the user to define the number of clusters (such as DBSCAN, see sklearn) $\endgroup$ Dec 2, 2016 at 12:17

1 Answer 1


One way would be:

  1. Cluster data.
  2. Within each cluster, count the number of males and females.
  3. Label each cluster with the majority gender.

Repeat steps 2-3 with each demographic feature of iterest.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.