# Choose the feature that maximizes the evaluation function J()  
b. Evaluate the performance:  
If \(\{\text{Y}_{\text{k}}+\text{x}^{\star}\}>\) J(Y\({}_{\text{k}}\)) then:  
i. Update feature subset: Y\({}_{\text{k+1}}=\) Y\({}_{\text{k}}+\) x*  
ii. Increment counter: k = k + 1  
iii. Go back to step 2a  
3. Return the final feature subset: Y*  
**Algorithm 1**Forward Selection  
By applying forward selection, it is ensured that only the most predictive attributes are included in the final model, reducing dimensionality while maintaining optimal classification performance. This approach minimizes redundancy and enhances the interpretability of the model by focusing on the most informative non-invasive clinical indicators. Logistic regression was used as the test algorithm. On the other hand, as a performance and/or error parameter, the area under the curve (AUC) was used.  
Stage 5 consists of classifying patients using three machine learning algorithms: logistic regression, random forest, and support vector machine. These algorithms are continuously implemented in the health sciences area. Patients were classified according to two conditions (binary classification): high risk (identified in the database with a \"1\") or low risk (identified with a \"0\") of cardiovascular problems. For each algorithm, the K-fold cross-validation technique was used for the distribution of the training and test data.  
The R language was used to develop the three algorithms in its 4.4.2 version [12]. Finally, stage 6 compares the performance of the algorithms. The evaluation is based on the performance during the test, in the classification stage. For the evaluation of the algorithms, four performance parameters are obtained:  
**Accuracy** measures the proportion of correct predictions out of the total predictions. It is defined by Equation (1) as follows:  
\[\textbf{Accuracy}=\frac{TP+TN}{TP+TN+FP+FN} \tag{1}\]  
**Sensitivity** measures the model's ability to correctly identify positive cases. It is defined by Equation (2) as follows:  
\[\textbf{Sensitivity}=\frac{\text{TP}}{\text{TP}+\text{FN}} \tag{2}\]  
where \(TP\) (true positives) are positive cases correctly classified and \(FN\) (false negatives) are positive cases incorrectly classified as negative.  
**Specificity** evaluates the model's ability to correctly detect negative cases. It is defined by Equation (3) as follows:  
\[\textbf{Specificity}=\frac{\text{TN}}{\text{TN}+\text{FP}} \tag{3}\]  
where \(TN\) (true negatives) are negative cases correctly classified and \(FP\) (false positives) are negative cases incorrectly classified as positive.  
**Area under the curve (AUC)** measures the ability of a classifier to distinguish between classes. It is calculated by integrating the receiver operating characteristic (ROC) curve, where \(f(x)\) represents the sensitivity versus the false positive rate. An AUC close to 1.0 indicates a highly accurate model. An AUC of 0.5 represents a model that has no discrimination capability (equivalent to a random classification). An AUC less than 0.5 suggests that the model is classifying worse than random. It is defined by Equation (4) as follows:  
\[\textbf{AUC}=\int_{0}^{1}\text{Sensitivity}(x)\,d(1-\text{Specificity}(x)) \tag{4}\]  
Using these metrics, it is possible to deduce which of the algorithms has the better performance classification. Finally, based on the previous analysis, the algorithm that best classifies the risk of cardiovascular disease was detected. In turn, the attributes that need to be measured in patients were identified.