## 4 Results
### Feasibility of the ML Classification Approach  
As mentioned, we start the investigation of the capability of the proposed ML-based approach by adopting the kNN algorithm. The primary goal is here to assess whether the foreseen classification and labelling strategy prove feasible. In a specific state space, the kNN algorithm looks for data nearest to a target observation, according to a specific metric. The parameter \(k\) actually represents the number of instances in the dataset nearest to the said observation. To avoid overfitting, a 5-fold cross validation is adopted: hence, the dataset is subdivided into 5 folds, and computations are repeated 5 times for each fold. The accuracy of training and testing reported in the following are thus the average values for the 5 folds. To check the effect of the aforementioned randomization, we compare the kNN with an alternative algorithm, the DT, which is going to be shown to be the best  
Figure 7: Projections on different feature planes of the 5-class representation of the structural performance. in the following comparisons; the algorithmic hyperparameters for the DT algorithm are automatically set by an optimizer. As we deal with a rather small set of geometries, results may turn out to be biased in terms of accuracy depending on the subset of the entire data belonging to the different folds. We have therefore run the kNN algorithm 50 times, each time randomizing the data in each fold. Regarding the algorithmic hyperparameters of kNN, after an heuristic optimization strategy, they are eventually set as: \(k=10\); city lock metric with equal distance weight, see [39] and the discussion in Section 4.2.1. The training and testing accuracies, defined as the ratio between the number of correctly classified instances in each dataset and the total number of instances, are shown in Figure 9; out of the 50 trials, three cases are highlighted in the graph, respectively representative of the maximum (run 16), average (run 47) and minimum (run 21) accuracies. The confusion matrices relevant to the training and testing of run 21 are shown in Figure 10 to get insights into the sources of the reduced accuracy reported. In this specific trial, the training and testing accuracies result to be 85.2% and 72.2%, respectively. Though it is a bit unusual to represent the results of training with a confusion matrix, we adopt this useful tool to easily compare the misclassification errors at the two stages of training and testing. To go more into the detail and figure out why the the classifier sometimes works improperly, Figure 10 shows that for class E there is only one datum or instance in the training set, but that is enough to predict correctly the class for 8 out of 9 data in the test set. For class D, all the few data in the training set are wrongly classified and, similarly, that happens for the testing ones, which are misplaced in class E. All the data in class C are classified correctly during training, and therefore it basically happens the same for the testing instances, with only one exception. For class B, data are evenly misclassified as C or A, both for the training and testing sets. Finally, data relevant to class A are (almost) perfectly classified. The confusion matrices clearly show that the instances are not uniformly distributed among the different classes and, as already stressed, the results get affected: for the classes featuring the highest numbers of instances (A and C), the algorithm is well trained with only marginal errors in the classification; for the classes featuring instead the lowest numbers of instances in the training set (B, D, and E), the ML algorithm is, in the end, not able to learn well the link between the structural performance and the relevant value of the performance index. Figure 8: Exemplary results of the Bayesian optimizer for the SVM classifier, reporting the error for each single iteration.