# Majority Voting Based Multi-Task Clustering of Air Quality Monitoring Network in Turkey
## 4 Multi-task Clustering
Definition 1: (Single-Task Clusters) Single-task clusters are groups of instances discovered from the data partition \(D_{t}\) of a particular task \(t\), i.e., \(D=\cup_{t=1}^{r}D_{t}\), and denoted by\(C_{t_{i}}=\{c_{1},c_{2},\ldots,c_{k}\}\), where \(k\) is the number of clusters. Definition 2: (Multi-Task Clusters) Given \(r\) tasks \(T=\{t_{i}\}_{i=1}^{r}\) where all the tasks are related but not identical, multi-task clusters, which are denoted by \(C=\{C_{t_{1}},C_{t_{2}},\ldots,C_{t_{r}}\}\), are groups of instances that mostly appear in the same level of the clusters of the tasks. Based on these definitions, it is possible to say that there are two elementary factors for multi-task clustering. The first factor is the definition of task. Many real world problems consist of a number of related subtasks. For instance, PM\({}_{10}\), SO\({}_{2}\), NO\({}_{2}\), NO and O\({}_{3}\) air pollutants can be considered as the tasks of air quality monitoring problem. The second factor is the definition of ensemble method to combine multiple tasks. In our study, we used majority voting mechanism, which selects the cluster that is the one with the most votes. To figure out the rationale behind the algorithm, the example scenario in Tables 4 and 5 explain the process step by step. In the first stage, the dataset \(D\), which is full of instances with only one feature, is given. There are three tasks (\(t_{1}\), \(t_{2}\) and \(t_{3}\)) and the aim is to group the dataset into three clusters by taking the joint decision from each task. The attribute value of instances can change according to different tasks. The next step is applied for clustering instances by one of the clustering algorithms simultaneously for each task. Instances are properly assigned to one of three clusters (\(C_{1}\), \(C_{2}\) or \(C_{3}\)). On the other hand, we need to determine a common decision point on the cluster groups of different tasks to get the final cluster assignments. Therefore, three labels (\(L_{1}\), \(L_{2}\) and \(L_{3}\)) are used to generalize the clusters and mean the same groupings under different tasks according to average intra-cluster weights. In the final part, after instances are labeled with the new label set for every task (\(C_{t_{1}}\), \(C_{t_{2}}\) and \(C_{t_{3}}\)), majority voting scheme is applied to obtain final cluster labels for MV-MTC algorithm. Figure 1 displays the general framework of multi-task clustering algorithm where each \(t_{i}\) shows single task of the task space and \(D\) is the unlabeled data. The main purpose is to ensure that the instances in the clusters that are created before the MV-MTC result remain in the same set in the final step. The number of instances remaining in the same cluster is maximized according to Equation (3) where \(C_{ij}(o_{r})\) means that the instance \(o_{r}\) is the member of cluster \(c_{j}\) of task \(t_{i}\) and MV - MTC\({}_{j}\) indicates the resulting cluster \(c_{j}\) of MV-MTC algorithm. The pseudo code of the proposed algorithm is given in Algorithm 1. \[\max\left\{\sum\
olimits_{i=1}^{r}\sum\
olimits_{j=1}^{k}\sum\
olimits_{r=1 }^{n}1\ :\ C_{ij}(o_{r})\in\text{MV}-\text{MTC}_{j},\ o_{r}\in C_{ij}\right\}, \tag{3}\] \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Ins. ID** & **Task \(t_{1}\)** & **Task \(t_{2}\)** & **Task \(t_{3}\)** \\ \hline
1 & 3 & 23 & 43 \\
2 & 10 & 15 & 30 \\
3 & 21 & 40 & 54 \\
4 & 9 & 32 & 89 \\
5 & 18 & 14 & 72 \\
6 & 12 & 27 & 28 \\
7 & 6 & 24 & 26 \\
8 & 4 & 41 & 22 \\
9 & 17 & 33 & 79 \\
10 & 19 & 28 & 58 \\
11 & 10 & 15 & 47 \\
12 & 3 & 18 & 73 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: An example showing MV-MTC algorithm step by step. Figure 1: The general MV-MTC clustering scheme. As shown in Algorithm 1, the methodology is made up of four steps. In the first step, single-task clusters are generated by taking each individual task into consideration. Step 2 is performed to calculate intra-cluster weights under different tasks.