## 3 Results
### Results for SVM  
The parameters used for training the SVM are as follows:  
* Standardize the predictors: Standardizing the predictors ensures that each feature contributes equally to the model by scaling them to have a mean of zero and a standard deviation of one.
* RBF kernel: The radial basis function (RBF) kernel is used as the kernel function, which helps in handling non-linear data by mapping it into a higher-dimensional space.
* FitPosterior: This option is enabled to estimate posterior probabilities for classification, providing probabilistic outputs for each class.
* onevone: For each binary learner, one class is positive, another is negative, and the software ignores the rest. This design exhausts all combinations of class pair assignments, ensuring comprehensive coverage of all class pairs for multi-class classification.
* Hyperparameter optimization: Bayesian optimization (BoxConstraint = 212.13, KernelScale = 3.5563, coding = onevone, standardize = true)  
The confusion matrix for SVM classification (Figure 4) presents strong performance in differentiating between the three classes: green, yellow, and red. For the green class, the model has a perfect classification with 25 true positives and no false positives or false negatives. This indicates that every instance that was actually green was predicted as green, and no instances of other classes were incorrectly predicted in this case.  
Figure 4: Confusion matrix for SVM. Numbers on the diagonal denote the correctly classified cases. Numbers off the diagonal denote cases that were not correctly classified. The colors used represent the proportions of the examples, and further visualize the number of cases for each case, with lighter values denoting lower counts.  
The yellow class also shows a strong classification performance, with 23 true positives. However, there are two instances where the yellow class was incorrectly predicted as red. This represents a small classification error for yellow, showing that the SVM model occasionally confuses yellow with red.  
The red class has 24 true positives, demonstrating that the SVM model is generally effective in identifying this class as well. There is only a single instance where red was misclassified as yellow, indicating a very high accuracy in classifying red instances as well.  
The SVM model demonstrates excellent performance with a total of 3 misclassifications out of 75 instances, resulting in a high overall accuracy. The model is particularly precise in classifying green, with slightly lower precision for yellow and red due to minimal confusion between these two classes.  
The support vector machine (SVM) classifier demonstrated outstanding performance across various metrics for each class, as summarized in Table 2. For the 'green' class, the SVM achieved perfect scores in all metrics with precision, sensitivity (recall), specificity, F1 score, and accuracy of 100.00%. This indicates the SVM model's exemplary capability to classify the 'green' class without any errors.  
For the 'yellow' class, the classifier also showed high effectiveness with a precision of 95.83%, sensitivity of 92.00%, and specificity of 98.00%. The F1 score for the 'yellow' class was 93.87%, and the accuracy was reported at 96.00%. These results signify a high degree of reliability in classifying the 'yellow' class, with a very small margin of error.  
For the'red' class, the SVM achieved a precision of 92.30%, sensitivity of 96.00%, and specificity of 96.00%. The F1 score was slightly lower at 94.11%, with the accuracy for the'red' class also at 96.00%. This denotes that the classifier was slightly less precise with the'red' class compared to the 'green' class but still maintained high accuracy.  
Overall, the SVM classifier's performance was robust, with an overall accuracy of 96.00% across all classes, showcasing its capability as a reliable model for classification tasks in the given context.