# Multi-Label Classification for Predicting Antimicrobial Resistance on _E. coli_
## 3 Experimentation
### Evaluation Metrics  
The performance of the metrics was evaluated by applying metrics for classification such as accuracy (ACC), precision (PRE), recall (REC), F1-score, and hamming loss (HAM). Accuracy measures how accurately the model distinguishes between resistant and susceptible strains, determining the correct predictions among all the samples. It is calculated as shown in Equation (8) [36]. \[Accuracy=\frac{TP+TN}{TP+TN+FP+FN} \tag{8}\]  
\(TP\) means that the resistant strains detected are correctly detected, and \(TN\) means that the strains detected as susceptible are susceptible. \(FP\) means that non-resistant strains were wrongly detected as resistant, and \(FN\) means that resistant strains were wrongly detected as susceptible. \begin{table}
\begin{tabular}{c c c c} \hline
**Models** & **Parameters** & **Description** & **Value** \\ \hline DT & Max\_depth & Maximum depth of the tree & 0.1 \\  & Min\_samples\_split & Minimum number of samples required to split a node & 6 \\  & Min\_samples\_leaf & Minimum number of samples required to be at a leaf node & 100 \\ \hline RF & N\_estimators & Number of trees in the forest & 100 \\  & Max\_depth & Maximum depth of the tree & None \\ \hline XGBoost & Learning rate & Step size shrinkage used in updating the weights & 0.1 \\  & Depth & Maximum depth of a tree & 6 \\  & N\_estimators & Number of trees in the forest & 100 \\ \hline CatBoost & Iterations & Number of boosting rounds & 100 \\  & Learning rate & Step size shrinkage used in updating the weight. & 0.1 \\  & Depth & Maximum depth of a tree & 6 \\ \hline AdaBoost & Learning rate & Step size shrinkage used in updating the weights & 0.1 \\ \hline GBC & Learning rate & Step size shrinkage used in updating the weights & 0.1 \\ \hline ETC & N\_estimators & Number of trees in the forest & 100 \\  & Max\_depth & Maximum depth of the tree & None \\  & Min\_samples\_split & Minimum number of samples required to split a node & 2 \\  & Min\_samples\_leaf & Minimum number of samples required to be at a leaf node & Auto \\ \hline k-NN & Solver & Optimization algorithm used for training. & Adam \\ \hline SVM & C & Regularization parameter & 1 \\  & kernel & Specifies the kernel type used in the algorithm & rbf \\  & gamma & Kernel coefficient for rbf to determine influence range of a & scale \\ \hline LR & Max\_iter & Maximum number of iterations for solvers to converge & 1000 \\ \hline MNB & Learning rate & Step size shrinkage used in updating the weights & 0.1 \\ \hline \end{tabular}
\end{table} 
Table 1: Hyperparameter settings used in the experiment. Precision compares the correct, true positives to the predicted ones, determining how accurately the models perform. This indicates how many of the strains predicted by the model to be resistant are resistant and is computed using Equation (9) [37]. \[Precision=\frac{TP}{TP+FP} \tag{9}\]  
Recall shows the proportion of resistant strains that the models properly detect. Thus, the number of resistant strains the model can successfully predict from actual resistant strains is calculated using Equation (10) [37]. \[Recall=\frac{TP}{TP+FN} \tag{10}\]  
F1-score is the weighted average of precision and recall. This shows the balance between precision and recall with a single value. F1-score is calculated using Equation (11) [37]. \[F1-score=2*\frac{Precision*Recall}{Precision+Recall} \tag{11}\]  
Hamming loss measures the fraction of the strains that are incorrectly predicted across all classes for each sample. The result is a value between 0 and 1, where 0 denotes correct labeling with no errors, and 1 denotes (labels) that the strains were incorrectly predicted. It is computed as shown in Equation (12) [38]. \[HAM=\frac{1}{m}\sum_{i=1}^{m}\frac{\left|Y_{i}\,\Delta\,Z_{i}\right|}{\left|L \right|} \tag{12}\]  
where \(m\) is the total number of samples, \(Y_{i}\) is the true label of the \(i\)-th sample, \(Z_{i}\) is the predicted label of the \(i\)-th sample, \(\Delta\) is the indicator function, and \(\left|L\right|\) corresponds to the total number of labels.