## 4 Methodology
### Cross Validation  
Overfitting is a modeling error that happens when a function is too closely fit to a limited data set. In such a case, the model tries to cover the data from the sample and even the noise values with a lot of changes. While such a model should reflect the behavior of society. In such cases, if obtained regression model is used to predict another sample, the predicted values will not seem appropriate at all. We used cross validation to overcome the problem of overfitting of ML methods. Cross-validation is model validation technique for assessing how the results of a mathematical analysis will generalize to unseen data set. Cross-validation randomly split the training dataset into \(k\) equal subsets. Then train MI method on \(k\)\(-\)1 of them and measure the prediction error on the \(k\)th subset, and do this in such a way which all \(k\) subsets be used for training and for calculating the prediction error. Then get average of the prediction errors from all \(k\) subset. Leave-one-out cross-validation(LOOCV) is a kind of cross-validation which number of folds will be equal to number of instances in data set. Thus, the learning algorithm is applied once for each instance, using all other instances as a training set and using the selected instance as a single-item test set. Good machine learning models such as SVR, RF, and KNN are the ones which have good prediction accuracy, in other words, small prediction error shows that the method is capable of accurately predicting when faced with unfamiliar data. Validation measures quantify the deviation between the predicted data and the true data [17]. In this study, the accuracy of the machine learning methods for predicting the yield of products was evaluated using the LOOCV technique with MAE, MBE, RMSE, MAPE, and CC as measures. The equations of these measures are given below [15; 17; 26]. Mean absolute error (MAE) is a measure of errors between paired observations, which refers to the real yield of chickpeas obtained from the Statistical Center of Iran and the value predicted by forecasting methods. MAE is calculated as Equation (12) [15; 17; 26]  
\[MAE=\frac{\sum_{i=1}^{n}\lvert\hat{y}_{i}-y_{i}\rvert}{n} \tag{12}\]  
It is thus an arithmetic average of the absolute errors. In these equations, \(y_{i}\) denotes the true values, \(\hat{y}_{i}\) denotes the predicted values. The mean absolute error uses the same scale as the data being measured. Mean bias error (MBE) is mainly used to estimate the average bias in the model and to determine if any steps need to be taken to correct the model bias. MBE captures the average bias in the forecasting. MBE is calculated as Equation (13) [15; 17; 26]  
\[MBE=\frac{\sum_{i=1}^{n}(\hat{y}_{i}-y_{i})}{n} \tag{13}\]  
In these equations, \(y_{i}\) denotes the true values, \(\hat{y}_{i}\) denotes the predicted values and \(n\) is the number of samples. RMSE is a measure of the differences between predicted values and real values or the quadratic mean of these differences. The RMSE serves to aggregate the errors in predictions for various data points into a single measure. In other word, is a measure of accuracy, to compare forecasting errors of different models for a particular data set. RMSE is calculated as Equation (14) [15; 17; 26]  
\[RMSE=\sqrt{\frac{\sum_{i=1}^{n}(\hat{y}_{i}-y_{i})^{2}}{n}} \tag{14}\]  
where, \(y_{i}\) denotes the true values, \(\hat{y}_{i}\) denotes the predicted values and n is the number of samples. Mean absolute percentage error (MAPE) is also a measure of prediction accuracy of a forecasting method and is commonly used as a loss function for regression problems and in model evaluation, because of its very intuitive interpretation. This method expresses the prediction error as a percentage and is easier to express.