# A Design of CGK-Based Granular Model Using Hierarchical Structure
## 3 IG Creation and Granular Model Design
### CGK Clustering  
CGK clustering is a clustering method that considers the output space. It creates clusters based on the correlations between the data in the input and output spaces by considering the output space in conventional GK clustering. It is assumed that there are data with two features. The data above can be depicted in red and blue according to the dependent variable. Figure 7. Presents the data with two features. Figure 8a presents clusters created via normal GK clustering. In Figure 8a, it can be observed that the features of the data in the input space were considered when creating the clusters; however, the features of the output space were not considered. Figure 8b presents clusters created via CGK clustering that consider the output space. As illustrated in this figure, clusters are created by considering both the input and output spaces; hence, the features of the data in the output space can be preserved, and more efficient clusters can be created than in normal GK clustering. Figure 9. Illustrates the concept of CGK that considers the output space. Figure 8: Comparison of clusters created in GK and CGK clustering: (**a**) general GK clustering; (**b**) context-based GK clustering. Figure 7: Data set with two features in the output space. The context regarding the data in the output space can be expressed as expressed in Equation (22). Here, \(D\) denotes the data in the output space. If it is assumed that a context-shaped IG is adopted for the given data in the output space, \(f_{k}=T(d_{k})\) represents the degree to which the context created in the output space belongs to the \(k\)th data. \[D:T\;\rightarrow\;[0,\;1] \tag{22}\]  
Fuzzy clustering adopts Euclidean distance to create clusters, while GK clustering improves upon this by creating clusters with Mahalanobis distance using Equation (11). Where \(A_{i}\) is a matrix with \(det(A_{i})\;=\rho_{i}\), which is a fixed constant for each i. Because fuzzy clustering uses Euclidean distance, it exhibits excellent performance for only problems that create circle-shaped clusters. To circumvent this disadvantage, GK clustering adopts \(d_{GK}{}^{2}(x_{k},\;v_{i})\) to extend the Euclidean distance of fuzzy clustering, such that clusters with various geometric shapes can be created, and it allows the distance standard to adapt to local areas. The objective functions are expressed in Equations (23)-(25). \[J_{m}{}^{GK}(\mu,\;v)\;=\sum_{k=1}^{n}{\sum_{i=1}^{n}{\mu_{ik}}^{m}{d_{GK}}^{2 }(x_{k},\;v_{i})} \tag{23}\]  
\[v_{i}=\frac{\sum_{k=1}^{n}{\mu_{ik}}^{m}{x_{k}}}{\sum_{k=1}^{n}{\mu_{ik}}^{m}} \tag{24}\]  
\[\mu_{ik}=\frac{\parallel\;x_{k}-v_{i}\parallel_{A_{i}}^{\frac{-2}{(m-1)}}}{ \sum_{j=1}^{c}\parallel\;x_{k}-v_{j}\parallel_{A_{j}}^{\frac{-2}{(m-1)}}} \tag{25}\]  
Equations (23)-(25) are repeated in each context generated in the output space to create geometrically-shaped clusters. Below is the sequence in which context-based GK clustering is performed. **[Step 1]** The number of contexts that can be expressed linguistically and the number of clusters that are created in each context are selected, as well as \(c\). Here, \(c\) sets the degree of the geometric shape, and a value greater than zero must be selected. The membership function U is initialized with values between zero and one. The numbers of contexts and clusters can be set to be the same, or they can be set differently. Figure 9: CGK clustering concept. **[Step 2]** Context-shaped IGs with fixed sizes can be created by uniformly dividing the output space, while context-shaped IGs with different sizes can be created by via a Gaussian probability distribution. **[Step 3]** Equation (24) is adopted to calculate the centers of the clusters in the contexts in the output space and a membership matrix. **[Step 4]** Equations (23) and (26) are adopted to calculate an objective function, and the aforementioned process is repeated if the calculated value is greater than the previous objective-function value.