# Crop Prediction Model Using Machine Learning Algorithms
## 6 Experimental Results
Table 5 shows the results of four scenarios where we selected three to four features and evaluated the accuracy of crop detection for each set. The second set of features (Temperature, Humidity, pH, Rainfall) achieved the highest accuracy, reaching 97.05% with Bayes Net and 97.32% with Random Forest. In contrast, the worst prediction outcome occurred when using the features N, P, and K, where the best accuracy obtained was 68.04% with Random Forest. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Training Set** & **Build Time** **(Seconds)** & **Test Time** **(Seconds)** \\ \hline
10\% & 19.18 & 0.05 \\ \hline
20\% & 17.03 & 0.03 \\ \hline
30\% & 17.47 & 0.01 \\ \hline
40\% & 14.26 & 0.02 \\ \hline
50\% & 14.54 & 0.02 \\ \hline
60\% & 14.12 & 0 \\ \hline
70\% & 14.79 & 0.01 \\ \hline
80\% & 13.81 & 0 \\ \hline \end{tabular}
\end{table} 
Table 4: Build and test times for Multilayer Perception algorithm (training set from 10% to 90%). \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Training Set** & **Accuracy (\%)** & **Kappa (0-1)** & **MAE (0-1)** & **RMSE (0-1)** & **RAE (\%)** & **RRSE (\%)** \\ \hline
10\% & 93.53 & 0.9323 & 0.0166 & 0.0726 & 19.06 & 34.69 \\ \hline
20\% & 95.39 & 0.9518 & 0.0096 & 0.0568 & 11.10 & 27.22 \\ \hline
30\% &  
The results in Table 5 highlight the importance of selecting the appropriate features for achieving high accuracy in crop detection using machine learning algorithms. The set of features (composed of Temperature, Humidity, pH, and Rainfall) we identified can be used as a guide for selecting relevant features for crop determination in future agricultural data analysis. More experiments were conducted to investigate the impact of changing the label on the accuracy of the data analysis algorithm. The results are displayed in Table 5 Instead of predicting the specific crop type, we manually grouped the crops into four more general categories based on their growth characteristics, usage, type, water requirements, and harvest method, as described in Table 6. Then, we tested the accuracy of the algorithm to predict these new general labels one at a time. Table 6 presents a classification of crops based on several class labels. The table includes information on the growth characteristics, usage (food, feed, fiber), type, water requirements, and harvest method for various crops. The crops are classified based on their growth characteristics, such as grass, bush, and tree; their water requirements, such as drought tolerance, drought, and water loving; as well as their harvest method, which can be performed by hand or machine. For example, rice and maize are classified as grasses, with the type being cereal, whereas chickpeas and pigeon peas are classified as bushes, with the type being legumes. This experiment aims to explore whether the algorithm could accurately predict more general categories of crops, which could be helpful in situations where general characteristics of crops are investigated, and specific crop types are not known or easily identifiable. The experiment results are summarized in Table 7, where we compared the accuracies of various classification methods for each general category. Table 7 shows that some classification methods perform better in predicting general categories. For example, the IBK, KSTAR, and KSTAR methods achieved high accuracies for predicting all general categories compared to the type of the crop (first column in the table), while Bayes Net, Naive Bayes Classifier, Logistic, and Multilayer Perception had low accuracies for all categories. The experiment demonstrates the potential usefulness of using more general