## 3 Experiment
### Performance Matrix  
Various measures are used to evaluate the effectiveness of classification-algorithm-generated models to determine the optimal model. One of these measures is the creation of a confusion matrix. In the fields of machine learning and statistics, a confusion matrix is a valuable instrument for assessing the classification models' efficiency [48]. The 2 \(\times\) 2 grid presented in this matrix displays four unique combinations resulting from the comparison of actual and predicted class values, as depicted in Table 6.  
Each cell in the matrix depicts a unique classification outcome, facilitating the assessment of the model's accuracy and efficacy. The investigation employed performance indicators such as accuracy, precision, recall, and F-measure scores.  
Accuracy, the primary metric used for evaluating models, signifies the number of correct predictions out of all predictions. An algorithm for classification is deemed accurate when it correctly identifies a certain percentage of the sample. As shown formulaically below, accuracy is determined by dividing the sum of true positives (TP) and true negatives (TN) by the total number of samples (TP, TN, false positives (FP), and false negatives (FN).  
\[Accuracy=\frac{(TP+TN)}{(TP+TN+FP+FN)} \tag{1}\]  
The precision measures the proportion of accurately classified samples in a given category, specifically the percentage that are true positives. The precision is calculated using the following formula:  
\[Precision=\frac{TP}{(TP+FP)} \tag{2}\]  
Recall indicates the accuracy of classifying a specific category. It shows how precisely a class was categorized. Recall is computed as  
\[Recall=\frac{TP}{(TP+FN)} \tag{3}\]  
The F1-Score is a statistical measure that combines precision and recall. It is commonly defined as the harmonic mean of the two values. F1-score is calculated with the following formula:  
\begin{table}
\begin{tabular}{l l l} \hline \hline  & **Predicted Positive** & **Predicted Negative** \\ \hline
**Actual Positive** & True Positive (TP) & False Negative (FN) \\
**Actual Negative** & False Positive (FP) & True Negative (TN) \\ \hline \hline \end{tabular}
\end{table}
Table 6: Confusion matrix [48].  
\begin{table}
\begin{tabular}{c c c c} \hline \hline \multicolumn{2}{c}{**DT**} & \multicolumn{2}{c}{**k-NN**} \\ \hline
**Hyperparameter** & **Value** & **Hyperparameter** & **Value** \\ max\_depth & 3, 5, 7, None & n\_neighbors & 3, 5, 7, 9, 11 \\ min\_samples\_split & 2, 5, 10 & weights & uniform, distance \\ min\_samples\_leaf & 1, 2, 4 & p & 1, 2, 3 \\ \hline \multicolumn{2}{c}{**RF**} & \multicolumn{2}{c}{**SVM**} \\ \hline
**Hyperparameter** & **Value** & **Hyperparameter** & **Value** \\ n\_estimators & 50, 100, 200 & C & 0.1, 1, 10 \\ max\_depth & None, 5, 10 & kernel & linear, poly, rbf \\ min\_samples\_split & 2, 5 & degree & 2, 3 \\ min\_samples\_leaf & 1, 2, 4 & & \\ \hline \hline \end{tabular}
\end{table}
Table 5: Parameters of the GridSearchCV algorithm.  
\[F1-Score=2*\frac{(Precision*Recall)}{(Precision+Recall)} \tag{4}\]  
Matthews correlation coefficient (MCC) is a measure used to evaluate the performance of classification models. MCC is computed as  
\[MCC=\frac{(TP*TN-FP*FN)}{\sqrt{(TP+FP)(TP+FN)(TN+FP)(TN+FN)}} \tag{5}\]