# Exploiting Domain Knowledge to Address Class Imbalance in Meteorological Data Mining
## 4 Methodology
Strategies 7 through 10 are newly proposed sampling strategies that take into consideration the nature of the data at hand. More specifically, in the seventh strategy (CU), we applied the k-means clustering algorithm to the entire dataset using WEKA. We set the number of clusters equal to five and chose the \"classes to clusters\" evaluation in WEKA to evaluate each cluster according to the five classes of precipitation (Tables 1 and 2). In the first step, we selected only the majority examples of the 'Fair/Cloudy' and 'Fog' labeled clusters. In this manner, we rejected all the majority examples that clustered in the three clusters that corresponded to the three minority classes. The idea is that these examples are not good majority representatives since they cluster with minority examples and the classifiers would suffer to distinguish between them. Then, we employed the randomized undersampling method to further reduce the number of majority examples in order to achieve a balanced distribution. Finally, we introduced three more strategies to reduce the excessive number of majority examples that comprise the majority class. For each majority example, we added a new attribute that expressed its temporal distance to the closest minority example. Then, we selected only the majority examples that had a temporal distance greater than one day (D1U), or two days (D2U), or four days (D4U). And finally, similarly to strategy CU, we employed in the D1U and D2U strategies the randomized undersampling method to further reduce the number of majority examples and achieve a balanced distribution. In the case of the D4U strategy, the number of the majority examples after the reduction was very close to the number of the minority examples. The idea of the temporal distance arose from the fact that during the precipitation episodes there may be some intervals without precipitation on the ground, while the meteorological factor for the precipitation still exists. It is possible that the classifiers can not distinguish these cases of majority class from a minority one leading to a degradation of their performance. In Section 5, we provide the corresponding number of examples for each strategy and the details regarding the sub-clusters of the precipitation class variable. The training datasets were the input to five classifiers, namely, the Decision tree C4.5, the k-Nearest Neighbor, the Multi-layer Perceptron with back-propagation, the Naive Bayesian and the RIPPER (Repeated Incremental Pruning to Produce Error Reduction) [21]. We evaluated the resulting models on separate test datasets that followed the natural distribution regarding the clusters of precipitation (Tables 1 and 2). The Area Under the ROC Curve, or simply AUC, was the evaluation metric we used. The AUC measures the performance of the classifiers as a single scalar. ROC graphs are two-dimensional graphs \begin{table}
\begin{tabular}{c l l} \hline \hline
**Strategy** & **Acronym** & **Description** \\ \hline
1 & UN & Initial unbalanced dataset \\
2 & U30 & Randomized Undersampling 30\% \\
3 & U50 & Randomized Undersampling 50\% \\
4 & SU30 & SMOTE Oversampling + Randomized Undersampling 30\% \\
5 & SU50 & SMOTE Oversampling + Randomized Undersampling 50\% \\
6 & BW & Balanced between-classes and within subclasses \\
7 & CU & Remove majority examples that cluster with minority ones + Randomized Undersampling \\
8 & D1U & Select only majority examples \textgreater{} 1 day away from minority ones + Randomized Undersampling \\
9 & D2U & Select only majority examples \textgreater{} 2 days away from minority ones + Randomized Undersampling \\
10 & D4U & Select only majority examples \textgreater{} 4 days away from minority ones \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Description of used sampling strategies.