# Crop Prediction Model Using Machine Learning Algorithms
## 6 Experimental Results

Table 1: Accuracy and error values for each classification algorithm. Table 2 shows each algorithm's build and test time. It can be noticed that the Multilayer Perception algorithm build time is greater than other algorithms because this algorithm is an Artificial Neural Network algorithm, including several hidden layers in addition to the input and output layer. The MLP algorithm runs with several iterations to find the best model for the given input and output set, which increases the build time. KSTAR and LWL algorithms have higher testing times than others. The NBC algorithm is the most efficient algorithm in classifying crop data based on accuracy and process time. Table 3 demonstrates accuracy and error measurement in the Multilayer Perception algorithm with different sample sizes of training data. When 10% of the data is used in training, accuracy with MLP is 93.53%; however, when 90% of data is used, accuracy is 97.72%. In the MLP algorithm, reaching high accuracy and efficient time complexity is important. The MLP algorithm can be very efficient in numeric-based data; however, it will be slow if collected data are images or videos. Table 4 presents the build and test times for the Multilayer Perception (MLP) algorithm under different scenarios involving modifications to the training and testing data percentage. It is worth noting that the MLP algorithm has longer build times than other algorithms [59; 60]. The results indicate that the lowest build time is observed when the training set is at 40%, while the highest build time occurs when the training set is at 10%. On the other hand, test times are consistently low across all scenarios, with the highest being at 0.05 when the training set is at 10%. Experiments show that the MLP algorithm has higher build times than the other ML algorithms, but testing time is very efficient. \begin{table}
\begin{tabular}{l l l l l l} \hline \hline
**Method** & **Accuracy (\%)** & **Kappa (0-1)** & **MAE (0-1)** & **RMSE (0-1)** & **RAE (\%)** & **RRSE (\%)** \\ \hline Random Forest & 99.46 & 0.994 & 0.0032 & 0.024 & 3.63 & 11.75 \\ \hline Random Tree & 98.12 & 0.980 & 0.0017 & 0.041 & 1.96 & 19.79 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: _Cont._ \begin{table}
\begin{tabular}{l l l} \hline \hline
**Method** & **Build Time (Seconds)** & **Test Time (Seconds)** \\ \hline Bayes Net & 0.48 & 0.25 \\ \hline Naive Bayes Classifier & 0.03 & 0.67 \\ \hline Logistic & 4.83 & 0.06 \\ \hline Multilayer Perception & 17.39 & 0.05 \\ \hline Simple Logistic & 3.86 & 0.02 \\ \hline IBK & 0.03 & 0.69 \\ \hline KSTAR & 0 & 6.9 \\ \hline LWL & 0 & 9.56 \\ \hline Ada BoostM1 & 0.04 & 0 \\ \hline Regression & 2.4 & 0.05 \\ \hline Decision Table & 0.75 & 0.01 \\ \hline Hoeffding Tree & 0.41 & 0.06 \\ \hline J48 & 0.27 & 0.03 \\ \hline Random Forest & 1.57 & 0.13 \\ \hline Random Tree & 0.02 & 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Build and test times for classification algorithms. After performing machine learning classification on a dataset with seven features and one label representing the crop type and recording the accuracies of different algorithms in Table 1, further simulations were conducted to determine the minimum number of features required to achieve high accuracy in algorithm learning and prediction. In this work, our primary focus is to determine the meaningfulness and correlation of the numerous features used for predicting crop outcomes. To achieve this, we utilized the Variance Inflation Factor (VIF), a statistical measure in machine learning, to assess multicollinearity [61]. By calculating the VIF for each variable, we gained valuable insights into potential correlations among predictor variables in the model. This crucial step allowed us to identify the best VIF values, indicating collinearity, and values below 10, signifying non-collinearity. As a result of this preparation, we were able to select the most suitable combination of features for our dataset.