## 8 Experiments and Discussions
The classification results in the density (0.67,1.03) also give more accurate results than the model of _LDA_, because this area is clustered by the hyperplanes, and it makes the classification more flexible. The classification based on the \(SVM\) model is reliable. However, there are inexact grades for classifying, because intersections of types blend together. Another model can support to solve inexact classification being \(KNN\). It is an algorithm that works and is considered based on predicted points, which affect the classification results and accuracy. The accuracy of the prediction is the proportion inversely neighbors of predicted points. If the number of neighbors are 30, the \(KNN\) model gives grading results shown in Figure 22.  
The classification in density area (0.67,1.03) had more improvement than the \(SVM\) model, but in the remaining area, the \(KNN\) model is less reliable than the \(SVM\) model, because the boundaries of areas are distinct. Therefore, \(KNN\) is suitable for problems having many intersections. Three methods _LDA_, \(SVM\), and \(KNN\) have their own advantages as well as a disadvantage in classifying mangoes or fruits. Figure 12.0 Visualization of training data. Figure 12.1 Classification of LDA model. The final model of \(RF\) overcome the disadvantages of previous models. This model has differing accuracy depending on the number of trees in the forest. If the number of trees increases in number from 80 to 100 trees, the accuracy of the \(RF\) model is between 97 to 98.1%. Therefore, the selected parameters for \(RF\) model is to ensure the stability and training speed of the number of trees (Figure 23). The disadvantages of the previous models are solved in the area of (0,12) explicitly and accurately according to the rules. The accuracy depends on the complex boundaries between types of mango. From experimental performances of four models LDA, SVM, KNN, and RF, the \(RF\) model is selected to grade mangoes' quality. Figure 24 shows the comparison and evaluation of grading results based on four models to give the best model. Besides, Table 5 shows sensitivity, precision, F1 score, and accuracy as well as the differences between models for grading [28]. All models give accuracies of more than 87.9%. The best model is \(RF\) with an accuracy of 98.1%. \(RF\) model performed best with average values of sensitivity, precision, F1 score, and accuracy of 98.1%, 98.0%, 98.0%, and 98.1%, respectively. Figure 12.2 Classification of SVM model. Figure 12.3 Classification of KNN model. The sensitivity and precision values show that 98.1% of three types (\(G_{1}\), \(G_{2}\), and \(G_{3}\)) were correctly classified as corresponding three types and 98.0% correctly predicted types to the total predicted corresponding types. Besides, the lowest performance is _LDA_ model with average values of sensitivity, precision, F1 score, and accuracy of, respectively, 87.8%, 87.9%, 87.8%, and 87.9%. In comparison, the _KNN_ model results yielded average values of sensitivity, precision, F1 score, and accuracy of, respectively, 94.1%, 95.6%, 94.5%, and 94.8%, and corresponding average values for _SVM_ model are 92.6%, 92.0%, 92.3%, and 92.7%. F1 score (98.0%) and accuracy (98.1%) for the RF model are greater than corresponding values for the _KNN_, _SVM_, and _LDA_ models. Overall, the results from Table 5 show that the _RF_ model outclassed the _KNN_, _SVM_, and _LDA_ models in predicting the types of mango in this study. Figure 12.4 The comparison of four models include LDA, SVM, KNN, and RF. Figure 12.5 Classification of RF model.