# Predicting Fruit's Sweetness Using Artificial Intelligence--Case Study: Orange
## 3 Results and Discussion  
Based on the results of the RGB values and the use of the rank widget in the different scoring methods, it was found that the trait of the red color had a significant effect on the classification of the sweetness of orange fruits. The rank widget considers class-labeled data sets (classification or regression) and scores the attributes according to their correlation with the class. The following Table 1 shows the classification percentage for the RGB trait. All of the scoring methods indicated that the red color had a significant effect in predicting the sweetness of orange fruits. The association of the red color with sweetness has also been suggested by other researchers [53]. After selecting the most effective color in the prediction model and evaluating the extracted data, an ANOVA F-test was used at a probability level of \(p\) < 0.001. This gave the highest value in the color red in the classification percentage for the RGB traits. Using the  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Traits** & **Info.gain** & **Gain Ratio** & **Gini** & **ANOVA** & **X2** & **ReliefF** & **FCBF** \\ \hline R & 0.819 & 0.41 & 0.293 & 51.85 & 25.276 & 0.142 & 1.009 \\ \hline G & 0.255 & 0.128 & 0.078 & 0.501 & 0.525 & 0.075 & 0.185 \\ \hline B & 0.285 & 0.143 & 0.104 & 0.467 & 4.784 & 0.008 & 0 \\ \hline (R+G+B)/3 & 0.143 & 0.072 resultant box plot, the fruit flavor classification was studied based on the values of the red color (Figure 5). The orange fruits were categorized into very high sweetness fruits, high sweetness fruits and good sweetness fruits, as is shown in Figure 3. A total of 9 fruits were rated as having good sweetness, 33 fruits as having high sweetness and 8 fruits as having very high sweetness. All of the fruits with good sweetness had a red color value that was less than or equal to 231.38 with a mean of 22.89 (\(\pm\)9.26) and a median of 224.52. The fruits with high sweetness had a red color value that was less than or equal to 249.15 with a mean of 240.06 (\(\pm\)5.51) and a median of 239.9. The fruits that were classified as having very high sweetness had a red color value that was greater than 249.15, the mean of which was 251.66 (\(\pm\)1.27) and the median was 251.52. The relationship was broadly positive with the increasing value of the red color (\(p<0.001\)). After determining the color affecting the sour flavor classification of orange fruits, we were able to report the results of the predictions, followed by the algorithms that were used. Logistic regression gave us better results for sweetness prediction, because the accuracy of logistic regression is better than that of the KNN, tree, SVM and neural network methods. Conversely, the other algorithms also make good predictions, but none more so than a logistic regression model. Figure 6 shows the prediction values of the different algorithms. In Figure 6, above, we have compared the results of the different algorithms that we applied to the orange fruit dataset in order to essentially compare the accuracy of the algorithms. We found that logistic regression gave us the best accuracy during prediction. In the KNN model, the classification accuracy was 82%; in the tree model, the classification accuracy was 96%; in the SVM model, the classification accuracy was 93% and in the neural network model, the classification accuracy was 88% (all of which are no more efficient than the logistic regression ratio). In the logistic regression algorithm, the classification accuracy was 97%, which is more efficient than the accuracy of all of the other algorithms. This was demonstrated by [PERSON] et al. in predicting pneumonia, in their research they found that logistic regression had the best predictive accuracy [53]. Next, for a better level of understanding, we attached a confusion matrix of positive and negative results. The blue values in the below figure show the positive or accurate results and the red values indicate the negative or false results (Figure 7).