# A Decision Support System for Crop Recommendation Using Machine Learning Classification Algorithms
## 4 Results and Discussion

+++  
It has been observed that the confusion matrix provides true positives and true negatives with a good number of values in predictions. But, the false positive value is 48 in logistic regression, as shown in Table 2.  
It is understood that after applying the SMOTE to balance the dataset, prediction is possible and the results shall be determined. We have seen that the values of the confusion matrix after the SMOTE are improved. Here, the false negatives for logistic regression, SVC, and SGDC are 64, 78 and 47, respectively, as shown in Table 3.  
chine learning classifiers along with the SMOTE before and after the SMOTE to see the recommendation. Table 4 shows the performance measuring values of different classifiers before the SMOTE. There are several performance parameters used, like accuracy, precision, recall, F1-score, ROC AUC, sensitivity, and specificity. In Figure 7, the logistic regression obtained 76% accuracy but at the same time obtained a low precision-recall of 42%. That indicates that logistic regression suffers from accurate prediction for certain crops, whereas the other classifiers like SVC, RF, and GB prove the balanced classifier performances throughout the performance metrics. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Classifier Name** & **Accuracy** & **Precision** & **Recall** & **F1-Score** & **ROC AUC** & **Sensitivity** & **Specificity** \\ \hline Logistic Regression & 0.76 & 0.84 & 0.42 & 0.56 & 0.68 & 1.0 & 1.0 \\ \hline Decision Tree & 0.95 & 0.94 & 0.93 & 0.93 & 0.95 & 0.96 & 0.96 \\ \hline K-Neighbors & 0.95 & 0.94 & 0.91 & 0.93 & 0.95 & 0.92 & 0.96 \\ \hline SVC & 1.0 & 1.0 & 1.0 & 1.0 & 1.0 & 0.95 & 1.0 \\ \hline Random Forest & 0.94 & 0.93 & 0.90 & 0.91 & 0.96 & 0.90 & 0.96 \\ \hline Gradient Boosting & 0.95 & 0.95 & 0.91 & 0.93 & 0.94 & 0.97 & 0.90 \\ \hline Bagged Tree & 0.96 & 0.96 & 0.93 & 0.94 & 0.95 & 0.91 & 0.97 \\ \hline XGB Classifier & 0.97 & 0.96 & 0.95 & 0.96 & 0.96 & 0.98 & 0.95 \\ \hline Ada Boost Classifier & 0.92 & 0.93 & 0.83 & 0.98 & 0.98 & 0.83 & 0.97 \\ \hline Cat Boost & 0.98 & 0.98 & 0.95 & 0.96 & 0.99 & 0.95 & 0.99 \\ \hline HGB & 0.96 & 0.95 & 0.95 & 0.84 & 0.95 & 0.97 & 0.94 \\ \hline SGDC & 0.95 & 0.95 & 0.90 & 0.96 & 0.94 & 0.90 & 0.90 \\ \hline MNB & 0.97 & 1.0 & 0.92 & 0.96 & 0.96 & 0.91 & 1.0 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Summary report before the SMOTE. Figure 7: Before the SMOTE. In Figure 8, the heat map representation for crop recommendation after applying the SMOTE exhibits the performance metrics result. Table 5 shows a summary of the performance measuring values of different classifiers after the SMOTE. After applying the SMOTE, the precision-recall of logistic regression increases from 42% to 55%. The performance of the SVC is reduced from 100% to 29% in the recall. The XGB Classifier outperformed, but in some of the cases, improvement was observed after applying the SMOTE. \begin{table}
\begin{tabular}{c c c c c c c c} \hline
**Classifiers Name** & **Accuracy** & **Precision** & **Recall** & **F1-Score** & **ROC AUC** & **Sensitivity** & **Specificity** \\ \hline Logistic Regression & 0.76 & 0.84 & 0.42 & 0.42 & 0.55 & 1.0 & 1.0 \\ \hline Decision Tree & 0.95 & 0.93 & 0.95 & 0.94 & 0.95 & 0.94 & 0.96 \\ \hline K-Nearest Neighbors & 0.94 & 0.94 & 0.91 & 0.93 & 0.97 & 0.94 & 1.00 \\ \hline SVC & 0.74 & 0.94 & 0.29 & 0.44 & 0.92 & 0.91 & 0.71 \\ \hline Random Forest & 0.95 & 0.94 & 0.92 & 0.93 & 0.98 & 0.92 & 0.57 \\ \hline Gradient Boosting & 0.94 & 0.91 & 0.93 & 0.92 & 0.99 & 0.90 & 0.84 \\ \hline Bagged Tree & 0.96 & 0.94 & 0.95 & 0.95 & 0.98 & 0.90 & 0.95 \\ \hline XGB Classifier & 0.97 & 0.95 & 0.97 & 0.96 & 1.00 & 0.92 & 8.45 \\ \hline Ada Boost Classifier & 0.90 & 0.85 & 0.9 & 0.87 & 0.97 & 0.89 & 0.79 \\ \hline Cat Boost & 0.96 & 0.97 & 0.94 & 0.95 & 0.95 & 0.92 & 0.95 \\ \hline HGB & 0.96 & 0.95 & 0.95 & 0.95 & 1.0 & 0.87 & 0.86 \\ \hline SGDC & 1.00 & 1.00 & 1.00 & 1.00 & 1.00 & 0.91 & 0.54 \\ \hline MNB & 0.96 & 0.90 & 0.91 & 0.95 & 0.95 & 0.9 & 1.0 \\ \hline \end{tabular}
\end{table}