Is it wrong if I cluster numerical attributes and categorical attributes separately?

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?

• 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).
– mnm
Mar 18, 2019 at 10:04
• 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. Mar 18, 2019 at 13:19
• 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.
– mnm
Mar 18, 2019 at 14:58

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.

• 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. Mar 19, 2019 at 4:43
• 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? Mar 19, 2019 at 6:31

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):

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.

• 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? Mar 19, 2019 at 4:40
• @RohitGavval I updated the answer Mar 19, 2019 at 7:04