# Diagnosing Various Severity Levels of Congestive Heart Failure Based on Long-Term HRV Signal
## 3 Methods
### Classification  
In order to build models with the best performance, our work applied a variety of classification algorithms, including support vector machine (SVM), linear discriminant analysis (LDA), k-nearest-neighbor (KNN), decision tree (DT), and Bayesian (NB). Relevant principles of classification algorithms can be referred to the previous studies [21; 22; 23; 24; 25; 26; 27]. The kernel function for SVM classifier was a radial basis function. We used the five algorithms mentioned for building model A and B. All features were normalized between 0 and 1 using the min-max method proposed in [22; 32] before classification. The performance of different classifiers was evaluated by the indicators of precision (Prec), sensitivity (Sens), specificity (Spec). The calculation of these three evaluation indicators refers to Equations (1)-(3). Besides, AUC, i.e., the area under the ROC (receiver operating characteristic) curve, was also simply calculated by Equation (4) [5; 40]. To compute these estimators, true positives (TP), true negatives (TN), false positives (FP), and false negatives (FN) should be measured first. For the four-class classification, we divided the problem into four 2-class classifications. In each 2-class problem, we viewed one kind of NYHA scales as a positive case and the other three NYHA scale as negative cases. \[\text{Precision }=\frac{\text{TP}}{\text{TP }+\text{FP}} \tag{1}\]  
\[\text{Sensitivity }=\frac{\text{TP}}{\text{TP }+\text{ FN}} \tag{2}\]  
\[\text{Specificity }=\frac{\text{TN}}{\text{TN }+\text{ FP}} \tag{3}\]  
\[\text{AUC }=\frac{1}{2}\left(\frac{\text{TP }}{\text{TP }+\text{ FN}}+\frac{\text{TN }}{\text{TN }+\text{ FP}}\right) \tag{4}\]  
After building the models, there are usually two ways to validate the performance of the models:  
Cross-subject validation [36; 41]: If the dataset has \(N\) subjects, and one subject provides \(n\) samples, this validation uses all the samples (\(m\times n\) samples for the test set) from \(m\) different subjects as the test set, and uses all the remaining samples (\((N-m)\times n\) samples for training set) to train the classifier. This way one can obtain \(M\) accuracies by training \(M\) models if the \(m\) subjects selected each time are different from each other. Then, the average of \(M\) accuracies as the final accuracy of models is calculated. Table 5 gives the statistical F-test results of the feature \(\alpha_{2}\) with various scales for CHF disease with four severity levels. The F-test is generally used for the significant test between multiple groups. According to the statistical results, the feature \(\alpha_{2}\) was not statistically significantly different in all scales for CHF diseases with different severity levels. The range of scale from 16 to 64 was relatively better than other ranges and was applied for calculating feature \(\alpha_{2}\) when building model B. 2. Different parameters (\(m\) and \(r\)) of sample entropy (SampEn) and fuzzy measure entropy (FuzzyMEn) also lead to different quantification power of HRV signals. In order to find the best combinations of parameters, the parameter \(m\) changed from one to three with a step of one, and \(r\) changed from 0.10 to 0.20 with a step of 0.05. For the normal and CHF groups, Table 6 gives the statistical Kolmogorov-Smirnov (KS) test results of SampEn and FuzzyMEn with a different combination of parameters. For CHF diseases with different severity levels, Table 7 gives the statistical F-test results of SampEn and FuzzyMEn with different combinations of parameters. As shown in Table 6, \(m=1\) and \(r=0.15\) obtained the SampEn values with the most significant statistical difference (\(p=1\times 10^{-3}\) by KS test) between the two groups; \(m=1\) and \(r=0.20\) got the FuzzyMEn values with the most significant statistical difference (\(p=9\times 10^{-7}\) by KS test) between the two groups. Therefore, \(m=1\) and \(r=0.15\) was set for SampEn, and \(m=1\) and \(r=0.20\) for FuzzyMEn in model A.