## 2 Generation of Information Granules and Design of the Granular Model  
### Context-Based Fuzzy C-Means Clustering  
Context-based Fuzzy C-Means (CFCM) clustering was proposed by [PERSON] [39], and it is an effective method of creating clusters that utilize the correlation of the data in the input and output variables. Furthermore, it is possible to preserve the properties of the output variable by using CFCM clustering; hence, CFCM clustering is more homogeneous than conventional FCM clustering [40]. Equation (1) defines the context created by using the characteristics of the output data. Here, \(D\) denotes the dataset in the output space, and it is assumed that the context has an available value for the given data. \(f_{k}=T(d_{k})\) denotes the degree of membership for the \(k\)-th data in the context of the output variable. The value of \(f_{k}\) is between 0 and 1, which indicates the degree of membership. The requirement of the membership matrix can be expressed by Equation (2) based on these characteristics.  
\[D=T\ \rightarrow\ [0,\ 1] \tag{1}\]  
\[U(f)=\left\{\begin{array}{rl}u_{ik}&\in\ [0,\ 1]|\sum_{i=1}^{c}u_{ik}=f_{k} \ \forall\ k\\ &0<\sum_{k=1}^{N}u_{ik}<N\end{array}\right\} \tag{2}\]  
The modified membership matrix \(U\) can be expressed by Equation (3).  
\[u_{ik}=\frac{f_{k}}{\sum_{j=1}^{c}\left(\left\|\frac{|x_{k}-c_{j}|}{|x_{k}-c_ {j}|}\right)^{\frac{2}{m-1}}\right.} \tag{3}\]  
The fuzzification factor \(m\ \in\ [1,\ \infty]\) generally uses two as the weight exponent. The context is generated by a triangular membership function in the output space to obtain \(f_{k}\), which is the degree of membership. Here, it can be seen that the membership function generates contexts such that they overlap at uniform intervals. Moreover, the interval and shape of the generated contexts can be changed according to the user's settings. Here, we use a method of generating contexts by evenly dividing the data between the output variable and a method of flexibly generating contexts from the Gaussian distribution. The procedure for the CFCM clustering algorithm is as follows:  
1. Set the number of contexts to be generated and the cluster's number to be estimated for each context. In addition, initialize the membership matrix \(U\) having a value between 0 and 1.
2. Generate the contexts via triangular fuzzy sets that are flexibly distributed in the output variable. The generation method of the context can be changed based on the user's settings.
3. Calculate the cluster centers for each context using Equation (4). \[c_{i}=\frac{\sum_{k=1}^{N}u_{ik}^{m}x_{k}}{\sum_{k=1}^{N}u_{ik}^{m}}\] (4)
4. Compute the objective function using the equation below. The above process stops if the value updated through the previous iteration is less than the threshold. \[J=\sum_{i=1}^{c}\sum_{k=1}^{N}u_{ik}^{m}d_{ik}^{2}\] (5) \[\left|J^{p}-J^{p-1}\right|\leq\epsilon\] (6) Here, \(d_{k}\) represents the Euclidean distance between the \(i\)-th cluster center and the \(k\)th data, and \(p\) denotes the number of iterations.
5. Calculate a new membership matrix \(U\) by the equation. Then, go to [Step 3].  
The pseudo-code for the CFCM clustering algorithm see Algorithm 1.  
```
Begin  Fix \(p\), \(2<p<n\);  Fix \(c\), \(2<c<n\);  Fix \(m\), \(1<m<\infty\), (e.g., \(m=2\));  Fix \(maxiteration\), (e.g., \(maxiterations=100\));  Choose the type of context to be created in the output space (e.g., \(type\)\(1=\) uniform, \(type\)\(2=\) flexible);  Create \(p\) contexts;  Randomly initialize v cluster centers; for\(t=1\) to \(maxiterations\)do  Update the membership matrix \(U\);  Calculate the new cluster centers \(V\)  Calculate the new objective function \(j\); if (\(abs(l^{t}-J^{t-1})\)\(<\)\(\in\)) then  break; else \(j^{t-1}=l^{t}\); endif endfor  end for
```  
**Algorithm 1** The context based fuzzy C means clustering algorithm.