## 8 Experiments and Discussions
The estimation of accuracy (Figure 17) was implemented 10 times corresponding to 10 folds in the outer layer. The performances of four models with adjusting their parameters were evaluated by validation and testing data. The horizontal axis denotes the evaluating iteration of model performance and the vertical axis denotes the percentage of model performance. The black line in the figure presents the training score and the red line denotes the validation score of models with the best parameters. The training and validation scores were determined by validation and testing data, respectively. Finally, the gray area around the red line shows the standard deviation in the outer layer performance of each fold. The model's performances show that parameter selection in the \(NCV\) method is important for controlling overfitting. The separation of the initial data into training and testing data gives a smaller effect. The accuracy of \(RF\), \(LDA\), \(KNN\), and \(SVM\) increase significantly to 98.1%, 87.2%, 94.8%, and 92.7%, respectively. The \(RF\) model obtains the highest accuracy at 98.1% if (n_estimators) is range from 80 to 100 and the nodes are expanded until all leaves are pure. The accuracy of the \(SVM\) model using Kernel function (rbf) is up 92.7% with \(\gamma\) and \(C\) ranged from 0.3 to 1 and 70 to 100, respectively. Moreover, the \(KNN\) model has a high accuracy of 94.8% in the number of neighbors ranging from 30 to 60. Finally, when reducing the number of features returned to 1, the \(LDA\) model allocates 89.6% accuracy. Figure 16: The accuracy of models based on training set size. The relationship of the features is the linear or nonlinear relationships shown in Figure 18. Therefore, we should not apply the linear model to grade of mango. The data is divided into 3 parts including training data, validation data, testing data. The samples divided into three parts with 3194 training data visualized in Figure 19, remaining data includes 771 validation, and 1035 testing. The distributing data on the boundary clusters obviously. The clusters in the middle of the data field are complex to classify. Besides, the area of density (0,0.67) and (1.03,1.2) are obvious, it is difficult to determine the boundary of the remaining area of density (0.67,1.03). Because the area of density is small or large, it is easy to identify the type of mango. Meanwhile, the mango classification of the region (0.75,1.03) is difficult to decide the types of mango, because these types depend on other grading factors as weight and volume. In the experiments, we used four models for grading and classifying. The first model LDA was applied to grade the mangoes and it gave a relative accuracy of 87.9% shown in Figure 20. The mangoes were clustered well with the density's areas (0,0.67), and (1.03,1.2), where the mangoes are graded exactly. However, the error increased in the region of density (0.67,1.03), because the types of mangoes \(G_{1}\), \(G_{2}\), and \(G_{3}\) have complex distribution in this density area. Thus, a significant difficulty of classification was seen in the created boundary by linear lines of the LDA method. Besides, many mangoes were classified inexactly in the area of density (0.67,1.03), which is the intersection between quality types of mangoes. Figure 17: The evaluation of model performance using the \(NCV\) method. Figure 18: The relationship between the features of mangoes. The second model \(SVM\) is similar to _LDA_: The clusters of mangoes have boundaries of the hyperplanes. The results of grade based on \(SVM\) have an accuracy of 92.7%. The accuracy of the model \(SVM\) depends on the Kernel function. The types of kernel functions considered for this study include _linear_, _polynomial_, _rbf_, and _sigmoid_. The experiments indicate that _rbf_ is the most efficient Kernel function. The results show that the classification of \(SVM\) is better than the _LDA_ model (Figure 21). Similarly, grading results evaluation in field of density (0,0.67), and (1.03,1.2) is exact.