## 1 Introduction
### Similarity Measurement for Numerical Attributes  
Since the entropy-based weighting strategy proposed in Section 2.2 is not applicable to numerical attributes, we made numerical data discrete at first. Then, the similarity measurement was used for the discretized data which are categorical data now. Discretization of numerical data is gaining more attention from the machine learning community [22]. Discretization of a given continuous attribute is also called quantization, which divides the range of attributes into intervals. Then, an interval label marks each interval. As a result, interval labels replace the original continuous data. Obviously, discretization can reduce the number of continuous attribute values [23], thereby simplifying the original data. Discretization also makes it possible for methods of categorical data clustering to be applied to cluster numerical or mixed datasets. There are many methods for numerical dataset discretization, such as discretization by intuitive division, histogram analysis, cluster analysis and entropy-based discretization. This section defines a smart way to automatically discretize numerical data by cluster analysis so that numerical data are transformed into categorical data. This method also provides a measure to find the optimal clusters to discretize the original data. In order to transform numerical data into categorical data, we transformed numerical data by each attribute. Formally, let \(X^{l}=[x^{u}_{1,l},x^{u}_{2,l},\ldots,  
each center of the \(q\) clusters and the center of data, and \(S_{b}^{l}(q)\) of a good cluster result should be of a large value. It is clear that \(S^{l}=S_{w}^{l}(q)+S_{b}^{l}(q)\); thus, the total sum of squares equals the sum of the within-cluster sum of squares and the between-cluster sum of squares. The Calinski-Harabasz index is adopted to evaluate the clustering validity, which is defined as \(S_{q,m}^{l}=\frac{(m-q)S_{q,m}^{l}(q)}{(q-1)S_{w}^{l}(q)}\). The proof of the effectiveness of the Calinski-Harabasz index is shown in [13]. We applied a clustering method \(f_{q}\) to the data \(X^{l}\) and calculated the corresponding Calinski-Harabasz index \(S_{q,m}^{l}\) of clusters, \(q=2,3,\ldots\). When the validity index \(S_{q,m}^{l}\) achieved the first local maximum, we chose the corresponding \(q\) as the optimal number of categories, denoted as \(q_{best}^{l}\). To demonstrate the automatic categorization process, an example of the Calinski-Harabasz index calculation results is shown as Figure 1. In this example, the k-means method was chosen as \(f_{q}\). When \(q=2,3,\ldots,100\), the k-means method was applied to the data and the validity index of the corresponding cluster result was calculated. When \(q=8\), the first local maxima of the Calinski-Harabasz index is found; therefore, \(q_{best}^{l}=8\). The automatic categorization process can be summarized as Algorithm 1. ```
0:\(X^{l}=[x_{1,l^{\prime}}^{u},x_{2,l^{\prime}}^{u},\ldots,x_{m,l^{\prime}}^{u}]\): the \(l\)th numerical attribute in the dataset \(X\); \(f_{q}\): a clustering function that partitions \(X^{l}\) into \(q\) clusters and returns the corresponding assignments; \(q_{max}\): maxxnum number of categories to examine; \(\hat{X}^{l}=[\xi_{1,l^{\prime}}^{u},\xi_{2,l^{\prime}}^{u},\ldots,\xi_{m,l^{ \prime}}^{u}]\): the categorical values of \(X^{l}\);
1:for\(q=2\) to \(q_{max}\)do
2:\(S(q)=CalliskiHarabasz(f_{q}(X^{l}),X^{l})\) (the Calinski-Harabasz index of the clustering result);
3:\(q_{best}=min_{q\in\{2,3,\ldots,q_{max}\}}\{localMax(S(q))=True\}\) (the first \(q\) for which \(S(q)\) achieves a local maximum)
4:\(\hat{X}^{l}=f_{q_{best}}(X^{l})\)
5:return\(\hat{X}^{l}\)
```  
**Algorithm 1** Automatic categorization for numerical attributes.