# Cardiac Arrhythmia Classification Based on One-Dimensional Morphological Features
## 3 Results  
The performance of the morphological-feature-based machine learning algorithms is presented in Table 5. Among the machine learning algorithms, XGBoost achieved the best accuracy (90.46%), AUC (0.982), sensitivity (0.892), precision (0.900), and F1-score (0.895). Compared with the wavelet feature results, the morphological features showed relatively high or similar performance metrics for the DT, kNN, NB, RF, LR, and XGB algorithms as described in Table 5.  
There are two hyperparameters to be tuned in the proposed morphological feature: the quantized level \(p\) and the GLCM offset distance \(\delta\). Figure 4 depicts how the accuracy of six ML algorithms changes as the quantization level and GLCM offset distance \(\delta\) vary. Each shade in Figure 4 represents a different quantization level. The first shade represents quantization level 16 (Qnt-16) and the last shade represents quantization level 128 (Qnt-128). As the offset distance changes from 1 to 10 in each shade, the accuracy also varies to a similar pattern in all shades. Based on the pattern, the best accuracy was achieved when the offset distance had a small value, such as 1 or 2, and the accuracy tended to decrease when the offset distance had a large value (close to 10). In the case of the quantization level, unlike the offset distance, the accuracy did not change remarkably even when the quantization level was changed to 16, 32, 64, or 128.  
Figure 5 illustrates the top 10 most important features out of the 366 features when using XGBoost as a classifier. The most important feature for this large ECG database was the dissimilarity feature of the GLCM in the V5 lead. Of the top 10 most important features, six features were obtained from the GLCM, and the remaining four features were obtained from the GLRLM. First-order features were not included in the top 10 most important features. Among the top 10 most important features, five out of the six features obtained from the GLCM were dissimilarity features.  
\begin{table}
\begin{tabular}{c c c} \hline
**Classifier** & **Hyperparameters in Scikit-Learn** & **Hyperparameter Grid** \\ \hline DT & max\_depth & 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, None \\ kNN & n\_neighbors & 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31 \\ NB & - & - \\ RF & n\_estimators & 100, 200, 300, 500, 1000, 2000, 3000, 5000 \\ LR & C & 1 \(\times\) 10\({}^{-4}\), 1 \(\times\) 10\({}^{-3}\), 1 \(\times\) 10\({}^{-2}\), 0.1, 1, 10, 100, \\  & & 1000, 10,000 \\ XGB & max\_depth & 3, 5, 7, 9 \\  & learning\_rate & 0.05, 0.01 \\ \hline \end{tabular}
\end{table}
Table 4: Hyperparameters. DT, decision tree; kNN, k-nearest neighbor; NB, naive Bayes; RF, random forest; LR, logistic regression; XGB: XGBoost. In the naïve Bayes (NB) classifier, no hyperparameter was used.  
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline
**Classifier** & \multicolumn{3}{c}{**Morphological Feature**} & \multicolumn{3}{c}{**Wavelet Feature**} \\ \hline  & ACC & AUC & SENS & PREC & F1 & ACC & AUC & SENS & PREC & F1 \\ DT & **80.12** & 0.923 & 0.774 & 0.787 & 0.779 & 79.11 & 0.912 & 0.761 & 0.773 & 0.767 \\ kNN & **80.69** & 0.943 & 0.782 & 0.800 & 0.788 & 76.98 & 0.930 & 0.730 & 0.770 & 0.743 \\ NB & **71.95** & 0.900 & 0.707 & 0.708 & 0.698 & 64.32 & 0.854 & 0.594 & 0.616 & 0.592 \\ RF & **87.54** & 0.971 & 0.858 & 0.870 & 0.863 & 85.87 & 0.970 & 0.836 & 0.851 & 0.841 \\ LR & **88.00** & 0.973 & 0.867 & 0.872 & 0.870 & **88.00** & 0.975 & 0.865 & 0.873 & 0.868 \\ XGB & **90.46** & 0.982 & 0.892 & 0.900 & 0.895 & 90.26 & 0.984 & 0.888 & 0.898 & 0.892 \\ \hline \end{tabular}
\end{table}
Table 5: Comparison of performance between the morphological feature and the wavelet feature. ACC, accuracy; SENS, sensitivity; PREC, precision; F1, F1-score.