2
$\begingroup$

I have a dataset of credit customers containing mixed data types (numerical and categorical with several levels). I am trying to perform segmentation so that I can end up with k groups and then build definitions (based on attributes I have).

While there are solutions for clustering data with mixed data types (K-prototypes, hierarchical clustering with Gower's distance), why would it be wrong to cluster numerical attributes and categorical attributes separately and come up with definitions individually?

$\endgroup$
  • $\begingroup$ Question, why do you want to group the variables separately? I don't think it's wrong as long as the variables in k groups are significant (statistically speaking). $\endgroup$ – mnm Mar 18 '19 at 10:04
  • $\begingroup$ It's a task (read challenge) to cluster mixed data. If I can cluster numerical and categorical variables separately and come up with definitions separately, it will make things easy or even possible in some places. I can even have k=x for categorical dataset and k=y for numerical dataset. Surely there must be a problem or constraints here and I want to know what they are. $\endgroup$ – Rohit Gavval Mar 18 '19 at 13:19
  • $\begingroup$ Think about it. Real world data is often mixed in terms of data types and together it makes sense. For example, flight numbers (continuous) and passengers on board the flight. Passengers can be construed as name, sex, meal preference etc (categorical). I think it boils down to the question you want to answer. If you just want to find out about flights OR people then separate the variables, ELSE group them. $\endgroup$ – mnm Mar 18 '19 at 14:58
3
$\begingroup$

There is nothing wrong with not using all attributes. In fact there are subspace clustering approaches that attempt to identify (partially) informative attributes along with clusters (but mostly for continuous variables).

On your data, you will have big data preparation issues, that would need careful weighting and nonlinear transformations. So it probably is a good idea to first try to understand each attribute before you go into any combinations.

Also bear in mind that a clustering never is correct or "optimal". A successful clustering is one that gave you a new insight. Any means that lead to verifiable insights is okay! Just don't assume that you could automate this.

| improve this answer | |
$\endgroup$
  • $\begingroup$ I am already looking at feature selection. Considering I am looking at most informative features, I would like to understand what will I be missing if I separate the two types (numerical and categorical) variables and cluster them individually. $\endgroup$ – Rohit Gavval Mar 19 '19 at 4:43
  • $\begingroup$ Same as if you only select numeric or only categoricial features by feature selection... But you do understand that feature selection best works supervised? Because otherwise you don't really know what you will be missing if you drop a feature? $\endgroup$ – Has QUIT--Anony-Mousse Mar 19 '19 at 6:31
3
$\begingroup$

Generally, clustering on separate categorical and numerical features is wrong since it could lead to merging the otherwise separate clusters. Here is a visual example of why this may fail (drawn by myself):

effect of categorical numerical separation on clustering

If we cluster only on the categorical feature, clusters C1 and C2 would be merged. If we cluster only on the numerical feature, all three clusters would be merged. Therefore, clusters C1 and C2 could not be found separately.

As a side note, this blind separation is different than a careful feature selection (mentioned in this answer) which could end up with both categorical and numerical features.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks for the visual example. The plot seems to represent the distribution of data with both numerical and categorical variables. If I separate the two types of variables, wouldn't the plots also be different? And if that is true, any partition that exists in the data would still show up. Am I missing something here? $\endgroup$ – Rohit Gavval Mar 19 '19 at 4:40
  • $\begingroup$ @RohitGavval I updated the answer $\endgroup$ – Esmailian Mar 19 '19 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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