# Hybrid Oversampling and Undersampling Method (HOUM) via Safe-Level SMOTE and Support Vector Machine
## 3 Preliminaries
### Performance Metrics  
Model selection and model evaluation are two essential processes in machine learning. Therefore, performance measures serve as critical indicators for assessing a classifier's effectiveness and steering its learning process [39]. In classification problems, accuracy is generally used as an evaluation criterion; however, it should not be used as the only criterion in imbalanced datasets. In a dataset with 10% minority and 90% majority, even if all minority classes are predicted incorrectly, the accuracy will be 90%. Thus, further clarification of this ratio may be necessary to truly compute the model's success.  
The complexity matrix is commonly used for evaluation in classification problems (an example is shown in Table 1). The abbreviations in Table 1 represent the following: TP is the number of correctly classified samples belonging to the positive class, TN is the number of correctly classified samples in the negative class, FP is the number of misclassified samples in the negative class, and FN is the number of misclassified samples in the positive class. Using these basic definitions, the following metrics can be calculated to compare the performance of different algorithms.  
Accuracy is the measure of the number of correctly predicted samples among all samples for any classification model. The accuracy rate is shown in Equation (16).  
\[Accuracy\ Rate=\frac{\text{TP}+\text{TN}}{\text{TP}+\text{FN}+\text{FP}+ \text{TN}} \tag{16}\]  
Recall is the measure of positive samples accurately predicted by the model. It is calculated in Equation (17). It is sometimes called the true positive rate (TPR) or sensitivity.  
\[Recall\ (Sensitivity)=\frac{TP}{TP+FN} \tag{17}\]  
Specificity is a measure of negative samples accurately predicted by a model. It is also sometimes referred to as the true negative rate (TNR). It is calculated via Equation (18).  
\[Specificity\ (True\ Negative\ Rate)=\frac{\text{TN}}{\text{TN}+\text{FP}} \tag{18}\]  
Precision is defined as the ratio of true positives (TPs) to the total number of positive samples predicted. It is calculated in Equation (19).  
\[Precision=\frac{TP}{TP+FP} \tag{19}\]  
\begin{table}
\begin{tabular}{c c c} \hline \hline  & **Predicted as Positive** & **Predicted as Negative** \\ \hline Actual positive class & TP & FN \\ Actual negative class & FP & TN \\ \hline \hline \end{tabular}
\end{table}
Table 1: Complexity matrix for the example with 2 class labels.  
Figure 2: Network graph of ANN with one hidden layer and one output neuron.  
The F-score evaluates both the recall and precision and is calculated in Equation (20). The F-score can be interpreted as the harmonic mean of the recall and precision.  
\[F-Score=\frac{2\times Recall\times Precision}{\text{Recall}+\text{Precision}} \tag{20}\]  
G-mean considers both positive class and negative class performance and uses the geometric mean to combine them. It is calculated in Equation (21). A high G-mean value can be obtained when the algorithm has high prediction accuracy for both the positive class and negative class.  
\[G-Mean=\sqrt{\frac{TP}{TP+FN}\times\frac{TN}{TN+FP}} \tag{21}\]