# Two Majority Voting Classifiers Applied to Heart Disease Prediction
## 3 Methodology
### Model
The details of the MKMVB base estimator algorithm is as follows:```
procedurefit(\(X,y\))\(\triangleright\) Dataset, class labels \(rv\_0\gets fit\_maxwell\_rv(X,y,0)\)\(\triangleright\) Maxwell-Boltzmann random variables for class 0 \(rv\_1\gets fit\_maxwell\_rv(X,y,1)\)\(\triangleright\) Random variables for class 1 \(ks\gets ks(X,y,0)+ks(X,y,1)\)\(\triangleright\) KS test result of each feature return\((rv\_0,rv\_1,ks)\) endprocedureprocedurepredict(\(x,c\_0,c\_1,rv\_0,rv\_1,ks)\)\(\triangleright\)\(rv\_0,rv\_1,\) and \(ks\) are results of the FIT procedure. \(c\_0\) and \(c\_1\) are method parameters. \(s\_0\gets 0\)\(\triangleright\) Initialize votes for class 0. \(s\_1\gets 0\)\(\triangleright\) Initialize votes for class 1. \(i\gets 0\)\(D\gets dim(x)\)\(\triangleright\) Number of dimensions while\(i<D\)do\(val\_0\gets pdf(x[i],rv\_0[i])\)\(\triangleright\) Given random variable, calculate probability density of \(x[i]\). \(val\_1\gets pdf(x[i],rv\_1[i])\)\(\triangleright\) Repeat for class 1 if\(val\_0>val\_1\)then\(\triangleright\) Feature class based densities are compared \(s\_0\gets c\_0+ks[i]\)\(\triangleright\) KS-statistic added else \(s\_1\gets c\_1+ks[i]\) endif \(i\gets i+1\) endwhile \(y\gets 0\)\(\triangleright\) Class of \(x\) if\(s\_0>s\_1\)then \(y\gets 0\)\(\triangleright\) Class of \(x\) to 0. else \(y\gets 1\)\(\triangleright\) Class of \(x\) to 1. endif return\(y\) endprocedure
```

**Algorithm 2** Proposed Base Estimator Method II: Maxwell-Boltzmann Distribution based Majority Voting Classifier

### Training

To be consistent with the state-of-the-art methods, the steps given in [2] are followed: the first 80 instances of Spectf are reserved for training, and the remaining 187 instances are used for testing. The first 90 of Statlog are set to be the training set, and the remaining 180 observations are reserved for the testing set. For Logistic Regression Bagging Classifier, the number of features ratio is 1.0 (i.e., all of the features are used), the number of estimators is 30, and the number of samples ratio is 0.5. For GKMVB, the Bagging Classifier parameters are as follows: the number of features ratio is 0.5, the number of estimators is 20 and the number of samples ratio is 0.37 (MKMVB, our second method, uses the same Bagging Classification parameters). There are two parameters of GKMVB and MKMVB: \(c_{0}\) and \(c_{1}\). \(c_{0}\) is added to the sum associated with class 0 when the considered attribute's probability density function (i.e., the function \(g\) in Equation (2) or \(f\) in Equation (5)) for the class 0 is greater than that of class 1. \(c_{1}\) is defined similarly. \(c_{0}\) and \(c_{1}\) of the GKMVB base classifier are set as \(c_{0}=2\) and \(c_{1}=1\) for the Spectf dataset and \(c_{0}=c_{1}=1\) for the Statlog dataset. On the other hand, the MKMVB base estimator parameters are set as \(c_{0}=2.0\) and \(c_{1}=1.0\). Figure 2 shows the general approach of the bagging classifier used in this study. ### Evaluation and Statistical Analysis

For the performance comparisons, we have used four measures. The first is accuracy:

\[Accuracy=\frac{TP+TN}{TP+TN+FP+FN} \tag{8}\]

where _TP_, _TN_, _FP_, and _FN_ are True Positives, True Negatives, False Positives, and False Negatives, respectively. The second is the sensitivity (\(Sn\));

Figure 1:0

The third is the specificity (\(Sp\));

Figure 1:1

The last one is the Optimized Precision (OP) [53], which is a combination of the accuracy, the sensitivity, and the specificity:

Figure 1:2

Using the \(OP\), one can find the best candidate using all the measurements of accuracy, sensitivity, and specificity. Figure 1:3 GKMVB & MKMVB Setup. ## 4 Results

To test the performance of the GKMVB algorithm, several experiments were conducted. Our experiments were run in the Google Colab [54] environment (Intel(R) Xeon(R) CPU @ 2.20 GHz) with sklearn [55].