Introduction
Clustering datasets with "mixed data"—a combination of numerical (e.g., income) and categorical (e.g., occupation) attributes—presents a significant challenge in data science. Traditional methods often struggle with the "apples and oranges" problem, where different data types lack a common basis for comparison. The HARR (Heterogeneous Attribute Reconstruction and Representation) paradigm addresses this by projecting all attributes into a unified, learnable distance space, treating categorical values as points in a "pseudo-numerical" 1D space.
The Mixed Data Challenge
Numerical data typically resides in a well-defined Euclidean space. However, categorical data is often embedded in an implicit space where distances are not inherently clear. As shown in the attribute hierarchy, attributes are broadly divided into numerical and categorical types, with the latter further subdivided into nominal and ordinal categories.
Existing solutions usually rely on one-hot encoding, which can lose semantic relationships, or hybrid metrics like the k-prototypes algorithm, which fails to capture inherent connections between different attribute types. The goal of HARR is to establish a homogeneous basis where all attribute types can be compared and weighted fairly.
The HARR Framework
The HARR framework operates in two primary stages to bridge the gap between these disparate data types:
- Attribute Reconstruction: Instead of simple encoding, the model uses Conditional Probability Distributions (CPDs) to calculate "base distances" between categorical values. These values are then projected onto multiple one-dimensional spaces. For a categorical attribute with $v$ values, it creates $\gamma = v(v-1)/2$ projection spaces, effectively transforming categorical data into "pseudo-numerical" sub-attributes that retain rich structural information.
- Joint Learning & Weighting: The model iteratively updates cluster assignments, prototypes, and attribute weights. It employs a "Discriminative" Weighting Strategy, calculating weights based on the ratio of inter-cluster separation to intra-cluster compactness. This prevents the model from over-weighting attributes that merely have low variance.
By projecting these various types into a shared 1D Euclidean space, the framework treats numerical, nominal, and ordinal attributes as the same species of data, unified by their intrinsic semantic concepts.
Experimental Evaluation
The study evaluated HARR against 10+ state-of-the-art methods across 14 real-world public datasets (e.g., Heart Failure, Mushroom, Australia Credit) and a large-scale synthetic dataset ($n=100,000$).
Key findings include:
- Superior Accuracy: The matrix-based version, HARR-M, consistently achieved the highest Adjusted Rand Index (ARI) and Clustering Accuracy (CA), outperforming vector-based weighting (HARR-V).
- Fine-Grained Clustering: t-SNE visualizations demonstrated that HARR produces tighter, more distinct cluster separations than traditional one-hot encoding.
- Scalability: The algorithm maintains linear time complexity relative to the number of data objects, ensuring viability for large-scale analysis.
Conclusion
HARR provides a parameter-free, adaptive approach to mixed-data clustering. By expanding the "Degree of Learning Freedom" (DoLF) through multi-space projections, it allows optimization algorithms to find the most effective representations for specific clustering tasks. While future work is needed to address noise and streaming data, HARR represents a significant step toward a unified metric for heterogeneous data.
Summary updated