# Complement-Class Harmonized Naive Bayes Classifier
## 6 Conclusions  
This work proposed a discriminative fine-tuning algorithm to alleviate the scant or imbalanced datasets' effects on estimating reliable probability terms of the Naive Bayes classifier. The proposed algorithm (CHNB) determines the size of the update amount (weights) for each attribute value based on the complement classes' harmonic average (predicted vs actual class) of the probability terms. This makes the update size large when rare and common classes have very skewed or scarce data and are small otherwise. We evaluated the performance of the proposed algorithm with respect to F-score, kappa, and MCC metrics on imbalanced benchmark datasets, as well as the accuracy on general datasets. Our empirical \begin{table}
\begin{tabular}{c c c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Attribute**} & \multirow{2}{*}{**Class**} & \multicolumn{8}{c}{**NB**} & \multicolumn{8}{c}{**CHNB**} \\ \cline{3-11}  & & **val 1** & **val 2** & **val 3** & **val 4** & **val 5** & **val 1** & **val 2** & **val 3** & **val 4** & **val 5** \\ \hline \multirow{3}{*}{Att 1} & Normal & 0.53 & 0.25 & 0.11 & 0.06 & 0.05 & 0.46 & 0.34 & 0.10 & 0.07 & 0.03 \\  & Attack & 0.32 & 0.22 & 0.21 & 0.12 & 0.13 & 0.07 & 0.04 & 0.06 & 0.03 & 0.79 \\ \cline{1-1}  & Normal & 0.97 & 0.03 & & & & 0.83 & 0.17 & & & \\ \cline{1-1}  & Attack & 0.08 & 0.92 & & & & 0.09 & 0.91 & & & \\ \cline{1-1}  & Normal & 0.95 & 0.03 & 0.01 & 0.01 & 0.01 & 0.62 & 0.21 & 0.08 & 0.07 & 0.03 \\ \cline{1-1}  & Attack & 0.99 & 0.01 & 0.00 & 0.00 & 0.00 & 1.00 & 0.00 & 0.00 & 0.00 & 0.00 \\ \cline{1-1}  & Normal & 0.83 & 0.16 & 0.01 & 0.00 & 0.00 & 0.64 & 0.31 & 0.04 & 0.01 & 0.00 \\ \cline{1-1}  & Attack & 0.98 & 0.02 & 0.00 & 0.00 & 0.00 & 0.97 & 0.03 & 0.00 & 0.00 & 0.00 \\ \cline{1-1}  & Normal & 1.00 & & & & & 1.00 & & & & \\ \cline{1-1}  & Attack & 1.00 & & & & & 1.00 & & & & \\ \cline{1-1}  & Normal & 0.95 & 0.05 & & & & 0.70 & 0.30 & & & \\ \cline{1-1}  & Attack & 1.00 & 0.00 & & & & 1.00 & 0.00 & & & \\ \cline{1-1}  & Normal & 0.14 & 0.86 & & & & 0.21 & 0.79 & & & \\ \cline{1-1}  & Attack & 0.92 & 0.08 & & & & 0.91 & 0.09 & & & \\ \cline{1-1}  & Normal & 1.00 & 0.00 & 0.00 & 0.00 & & 0.95 & 0.04 & 0.01 & 0.00 & \\ \cline{1-1}  & Attack & 0.76 & 0.19 & 0.05 & 0.00 & & 0.17 & 0.67 & 0.16 & 0.00 & \\ \cline{1-1}  & Normal & 1.00 & 0.00 & 0.00 & 0.00 & & 1.00 & 0.00 & 0.00 & 0.00 & \\ \cline{1-1}  & Attack & 0.67 & 0.24 & 0.05 & 0.03 & & 0.16 & 0.63 & 0.14 & 0.07 & \\ \cline{1-1}  & Normal & 0.18 & 0.82 & & & & 0.24 & 0.76 & & & \\ \cline{1-1}  & Attack & 0.92 & 0.08 & & & & 0.91 & 0.09 & & & \\ \cline{1-1}  & Normal & 0.82 & 0.12 & 0.04 & 0.01 & 0.01 & 0.62 & 0.25 & 0.09 & 0.03 & 0.01 \\ \cline{1-1}  & Attack & 0.97 & 0.02 & 0.01 & 0.00 & 0.00 & 0.95 & 0.03 & 0.02 & 0.01 & 0.00 \\ \cline{1-1}  & Normal & 0.60 & 0.29 & 0.07 & 0.02 & 0.01 & 0.58 & 0.23 & 0.14 & 0.03 & 0.02 \\ \cline{1-1}  & Attack & 0.98 & 0.02 & 0.00 & 0.00 & 0.00 & 0.97 & 0.02 & 0.00 & 0.00 & 0.00 \\ \cline{1-1}  & Normal & 0.91 & 0.04 & 0.02 & 0.02 & 0.01 & 0.45 & 0.22 & 0.12 & 0.14 & 0.06 \\ \cline{1-1}  & Attack & 0.97 & 0.00 & 0.01 & 0.01 & 0.00 & 0.99 & 0.00 & 0.00 & 0.00 & 0.00 \\ \cline{1-1}  & Attack & 0.89 & 0.01 & 0.00 & 0.00 & 0.00 & 0.83 & 0.08 & 0.03 & 0.02 & 0.04 \\ \cline{1-1}  & Attack & 0.87 & 0.03 & 0.02 & 0.01 & 0.06 & 0.19 & 0.01 & 0.02 & 0.01 & 0.77 \\ \cline{1-1}  & Normal & 0.84 & 0.01 & 0.05 & 0.07 & 0.02 & 0.24 & 0.03 & 0.27 & 0.34 & 0.12 \\ \cline{1-1}  & Attack & 0.85 & 0.01 & 0.06 & 0.07 & 0.01 & 0.98 & 0.00 & 0.01 & 0.01 & 0.00 \\ \cline{1-1}  & Normal & 0.55 & 0.34 & 0.09 & 0.02 & 0.01 & 0.66 & 0.20 & 0.10 & 0.02 & 0.02 \\ \cline{1-1}  & Attack & 0.97 & 0.02 & 0.00 & 0.00 & 0.00 & 0.96 & 0.03 & 0.00 & 0.00 & 0.00 \\ \cline{1-1}  & Normal & 1.00 & & & & & 1.00 & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 8: The probability terms for the binary-class dataset before and after fine-tuning.