# Topdressing Nitrogen Demand Prediction in Rice Crop Using Machine Learning Systems
## 5 Modelling  
### Background  
Four machine learning algorithms were tested towards yield prediction from the available dataset: Extreme Gradient Boosting (XGBoost), Random Forest (RF), Support Vector Regression (SVR) and Elastic Net (ElasticNet).  
The XGBoost is a decision tree-based algorithm, which gives state-of-the-art results in many machine learning problems, as it uses the gradient boosting framework and also focuses on areas within the dataset of high error for improving the overall initial predictor [11]. This technique is dynamic as it leaves out the data that fit in the weak models and focuses on the development of new models that can better deal with the remaining data [35]. XGBoost can model difficult problems with multiple variables. Ultimately, the aim of XGBoost is to convert a low statistical hypothesis to a stronger statistical hypothesis, providing a predictive model with high prediction accuracy by combining moderately inaccurate models [36]. However, the efficiency of XGBoost relies much on the optimal selection of the hyperparameters. XGBoost is relatively sensitive to overfitting and maximization of variance, as it tries to focus on areas with high error within the dataset. A key technique  
Figure 6: Indicative subset of a yield map from the central sector of the studied rice farm (56 ha; year 2017).  
that must be included in the model for addressing this problem is the dropout technique and more specifically the adjustment of the early stopping rounds parameter.  
Random Forest is also a dynamic technique as it is an improvement of bagged decision trees. The decision trees are constructed by sampling the original training set with replacement in a way that reduces the correlation between the individual trees. This is done by choosing a random sampling of training data when building trees and a random subset of features in each split. Finally, the predictions are made by averaging the predictions of each decision tree [37]. This method aids in dealing with the overfitting problem encountered by simple decision trees algorithms, and finally this technique leads to the minimization of bias, but it is also sensitive to high variance.  
Support Vector Regression (SVR) is a dynamic technique that creates a hyperplane separating the data classes by maximizing the margin between the classes' closest points [38]. There are also two other lines, called boundary lines, which create a margin. This boundary margin separates the data classes in SVR and tries to fit the error within this boundary margin. Finally, the SVR finds the hyperplane that has the maximum observation points within the boundary lines [39].  
ElasticNet is suggested by [PERSON] and [PERSON] 2005 [40] as useful when the number of variables is high, the number of observations is small, and when there are variables strongly correlated to each other. This type of regression is between Ridge Regression and Lasso Regression. If there is a subset of the total number of features that are useful for the prediction, then it is preferable to use Lasso Regression over Ridge Regression. However, as there is a regularization parameter which controls if the Elastic Net Regression works more like a Ridge Regression or Lasso Regression, it is preferred to use Elastic Net Regression over Lasso and Ridge Regression. The strength of the Elastic Net algorithm is that it can work as a mix of these types of regression. Moreover, Elastic Net is still preferred over Lasso if there is collinearity between the features and it also overcomes the problem of overfitting in which the simple linear regression is highly susceptible.