# A-Tuning Ensemble Machine Learning Technique for Cerebral Stroke Prediction
## 4 Implementation and Evaluation
### Evaluation Metrics  
The Kaggle environment was used to implement and evaluate the three ML models and the proposed tuning ensemble RXLM. Data scientists and developers can host their datasets, share their code, and compete in ML competitions with Kaggle. The three ML models and the suggested tuning ensemble RXLM were assessed by applying the different predictions of the confusion matrix, as follows [23,24]:  
* The true positive \((TP_{x})\) of class \(x\) means that the observed value output and predicted value output for class \(x\) are true or correct. * The true negative \((TN_{x})\) of class \(x\) means that the output of the testing dataset is negative compared to the predicted output of class \(x\). * The false positive \((FP_{x})\) of class \(x\) means that the output of the testing dataset is positive, whereas the predicted output of the experiments is false. * The false negative \((FN_{x})\) of class \(x\) means that the observed value output and predicted value output for class \(x\) are false or incorrect. In addition, various evaluation metrics are used to evaluate the overall performance of the experimental results, as follows [23]:  
* Accuracy is the degree to which the result matches the required value. It is calculated by measuring the overall number of correct expectations or predictions on the dataset by the total number of expectations. \[\text{Accuracy}=\frac{(TP_{x}+TN_{x})}{(TP_{x}+FP_{x}+TN_{x}+FN_{x})}\] (2)
* Precision is the percentage of positive samples that the model properly predicted. \[\text{Precision}=\frac{TP_{x}}{(TP_{x}+FP_{x})}\] (3) \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter** & **Meaning** & **Best Value** \\ \hline Max depth & The leaf and root nodes are measured by the maximum number of levels in the tree. & 6 \\ \hline Min child weight & Minimum required child weight. & 1 \\ \hline N estimators & How many boosted trees can fit? & 100 \\ \hline N jobs & The number of active jobs at once. & \(-1\) \\ \hline Num parallel tree & The number of parallel trees that are built in each iteration. & 1 \\ \hline Predictor & Which predictor algorithm to employ? It allows the use of a GPU or CPU but & auto \\ \hline Eval metric & Metrics for evaluation of validation data. & None \\ \hline Random state & Random number seed. & 123 \\ \hline Reg alpha & Represents L\({}_{1}\) regularization parameter on weight. & 0 \\ \hline Reg lambda & Represents L\({}_{1}\) regularization parameter on weight. & 1 \\ \hline Sampling method & How to sample the training scenarios using this method. & Uniform \\ \hline Tree method & The XGBoost tree construction algorithm. & Auto \\ \hline Scale Pos weight & Adjust the balance between positive and negative weights, which is helpful for & 1 \\ \hline Subsample & The ratio of the training instances’ subsamples. & 1 \\ \hline \multirow{2}{*}{Validate parameters} & XGBoost will validate input parameters to determine whether a given & 1 \\  & parameter is utilized when the value is True. & \\ \hline \hline \end{tabular}
\end{table} 
Table 6: _Cont._* The recall is the percentage that correctly identifies the positive samples from the overall number of samples. \[\text{Recall}=\frac{TP_{x}}{\left(TP_{x}+FN_{x}\right)}\] (4)
* Sensitivity is the proportion of true positives to actual positive values of the samples. \[\text{Sensitivity}=\frac{TP_{x}}{\left(TP_{x}+FN_{x}\right)}\] (5)
* Specificity is the ratio of the number of actual negatives to the number of true negative values. \[\text{Specificity}=\frac{TN_{x}}{\left(TN_{x}+FP_{x}\right)}\] (6)
* F1-score is the harmonic average of precision and sensitivity. \[\text{F1-score}=\frac{2\times Precision\times Recall}{Precision+Recall}\] (7)
* AUC is a number used to summarize a classifier's performance by determining the total area beneath the receiver operating characteristic (ROC) curve. The Mathew correlation coefficient (MCC) is a statistical method for assessing models.