## 3 Materials and Methods
### Methodology
#### 3.3.3 Classification Using Random Forest  
Random forest (RF) is a combinatorial ensemble learning classification algorithm [5]. It is designed to create multiple decision trees, which are trained on a bootstrapped sample of training data [43]. The algorithm can be described by the following equation [4]:  
\[\{h(x,\theta_{k}),k=1,2,\ldots i\ldots\}, \tag{1}\]  
where \(h\) is the random forest classifier, \(x\) is an input variable, and \(\{\theta_{k}\}\) is the independent identically distributed random predictor variables.  
RF consists of many classifiers, which distinguishes it from traditional classification trees (CTs) and represents a new concept of classifiers [44]. The diversity of trees increases, because RF makes them grow from different subsets of training data through bootstrap aggregation and bagging [45]. In this method of classification, trees are used as base classifiers; thus, some data may be used more than once in classifier training, whereas others may never be used [44]. This makes the algorithm more robust to small changes in input data, increasing classification accuracy and making it more stable [44].  
RF is widely used in remote sensing. It is known to run efficiently on large datasets with a large number of input variables, to estimate which variables are significant in the classification process, and is relatively robust to noise and outliers [44]. Numerous examples of the use of this algorithm can be found in the literature. [PERSON] et al., (2019) [4] proposed a hybrid method using RF and texture analysis to accurately differentiate the land covers of urban vegetated areas and analyze changes in classification precision as a function of the texture window. An RF classifier consisting of 200 decision trees was used for classification in the spectral-textual feature space. Ground truth points were generated based on the information on crop types captured in the field.  
Ground truth polygon data with agricultural fields were split into training and testing datasets. The training dataset consisted of 34.6% of all ground truths from the investigated field. The same training samples were used for each classification experiments. An RF classifier implemented within the European Space Agency open The Sentinel Application Platform SNAP (version 8.0.2) software was used for classification. A total of 5000 samples within the ground true data were used for training the model; 10% of the training samples were used for cross-validation for each classification to estimate model performance. Cross-validation indexes of all classification experiments carried out were at the level of 96-100%. Within RF classification in SNAP, only hyperparameters such as the number of training samples and number of trees can be modified and tuned by the user; other hyperparameters which are usually available for tuning in other software such as Python or R are not available in SNAP. However, in our approach, we performed a number of tests with different parameters and numbers of trees and training samples; in most cases, 100 trees and a 5000 training samples provided the best accuracy metrics. As accuracy metrics, the overall accuracy (\(OA\)) and Kappa coefficient were used. The accuracy metrics were calculated based on 500 ground truth points located in the area of testing.