# Heart Disease Prediction Using Concatenated Hybrid Ensemble Classifiers
## 3 Proposed Model
### Ensemble Learning
The decision function of the Support Vector Machine (\(C_{1}(x)\)) can be expressed as follows:  
\[C_{1}(x)=sign(\sum\alpha_{i}y_{i}K(x_{i},x)+b) \tag{4}\]  
where \(C_{1}(x)\) is the decision function, \(sign()\) is the sign function returning \(+1\) for positive values and \(-1\) for negative values, \(\sum\) represents the summation over all support vectors, \(\alpha_{i}\) are the Lagrange multipliers (coefficients obtained during training), \(y_{i}\) is the class label of the \(i\)-th support vector (\(+1\) or \(-1\)), \(K(x_{i},x)\) is the kernel function calculating the similarity between the \(i\)-th support vector \(x_{i}\) and the input feature vector \(x\), and \(b\) is the bias term. The Decision Tree classifier (\(C_{2}(x)\)) for the first ensemble classifier can be expressed as follows:  
\[C_{2}(x)=c_{1}\text{ if }T_{1}(x),c_{2}\text{ if }T_{2}(x),\ \ldots,\ c_{n}\text{ if }T_{n}(x) \tag{5}\]  
where \(C_{2}(x)\) is the decision function of the decision tree, \(c_{1},c_{2},\ldots,c_{n}\) are the class labels associated with the terminal nodes (leaves) of the decision tree, and \(T_{1}(x),T_{2}(x),\ldots,T_{n}(x)\) are the decision conditions or rules based on the input feature vector \(x\) that guide the traversal of the decision tree. The K-Nearest Neighbor classifier (\(C_{3}(x)\)) for the first ensemble classifier can be represented as follows:  
\[C_{3}(x)=mode(C_{1}(x),C_{2}(x),\ldots,C_{k}(x)) \tag{6}\]  
where \(C_{3}(x)\) is the decision function of the KNN classifier, \(mode()\) returns the most frequent class among the \(k\) nearest neighbors, and \(C_{i}(x)\) represents the class label of the \(i\)-th nearest neighbor to the new data point \(x\). For the second ensemble classifier, \(C_{1}(x)\) represents Logistic Regression, \(C_{2}(x)\) is the Adaboost classifier, and \(C_{3}(x)\) is the Naive Bayes classifier. The decision function of Logistic Regression (\(C_{1}(x)\)) can be described as:  
\[C_{1}(x)=\sigma(w\cdot x+b) \tag{7}\]  
where \(C_{1}(x)\) is the decision function of the Logistic Regression classifier, \(\sigma()\) is the logistic function (sigmoid function), \(w\) is the weight vector, \(x\) is the input feature vector, denotes the dot product, and \(b\) is the bias term. The decision function of the Adaboost classifier (\(C_{2}(x)\)) can be expressed as:  
\[C_{2}(x)=\sum a_{i}h_{i}(x) \tag{8}\]  
where \(C_{2}(x)\) is the decision function of the Adaboost classifier, \(\sum\) represents the summation over all weak classifiers, \(a_{i}\) are the weights assigned to each weak classifier, and \(h_{i}(x)\) represents the prediction of the \(i\)-th weak classifier for the input feature vector \(x\). The decision function of the Naive Bayes classifier (\(f(x)\)) can be defined as:  
\[f(x)=\text{argmax}(c)P(c)\prod P(x_{i}|c) \tag{9}\]  
where \(f(x)\) is the decision function of the Naive Bayes classifier, \(\text{argmax}(c)\) returns the class \(c\) that maximizes the expression, \(P(c)\) is the prior probability of class \(c\), \(P(x_{i}|c)\) is the conditional probability of feature \(x_{i}\) given class \(c\), and \(\prod\) represents the product operator, which calculates the product of the conditional probabilities for all features. In the final step, these two ensemble classifiers are merged to create the ensemble classifier:  
\[final(x)=g(C_{1}(x),C_{2}(x),\ldots,C_{N}(x)) \tag{10}\]  
where \(final(x)\) is the decision function of the concatenated classifier, \(C_{1}(x),C_{2}(x),\ldots,\)\(C_{n}(x)\) represent the individual predictions of the base classifiers for the input feature vector \(x\), and \(g()\) is the final classifier that takes the concatenated feature vector as input and makes the final prediction. In the proposed model, \(C_{1}(x)\) represents the first ensemble classifier, and \(C_{2}(x)\) represents the second ensemble classifier.