## 2 Materials and Methods
### Methodology
#### 2.2.3 Gully Erosion Susceptibility Modeling  
In this study, we prepared gully susceptibility maps using REPTree as a base classifier and AdaBoost, bagging, and random subspace in ensemble models. The following subsections briefly describe the four ensemble models. Figure 4: Spatial database for gully susceptibility analysis. (**a**) Elevation, (**b**) aspect, (**c**) slope, (**d**) plan curvature, (**e**) profile curvature, (**f**) distance from river, (**g**) drainage density, (**h**) lithology, (**i**) land use, (**j**) NDVI, (**k**) distance from road, (**l**) rainfall. AdaBoost (AB)  
AdaBoost (adaptive boosting) was the first boosting algorithm used for binary classification [111] and is a starting point for understanding the concept of boosting. AdaBoost free users from the complexities involved in detecting and choosing parameters. The steps of the AdaBoost algorithm can be summarized as follows:  
First, each data point is calculated as  
\[w(x_{i},y_{i})=\frac{1}{n},\ i=1,\ldots,n \tag{1}\]  
The obtained weights are updated after each step. Second, a basic classifier \(C_{b}(X_{i})\) is built from a training set and is applied to each training sample. The error of this classifier \(\varepsilon_{b}\) is calculated as  
\[\varepsilon_{b}=\sum_{i=1}^{n}w_{b}(i)\xi_{b}(i)\text{ {where} }\xi_{b}(i)=\left\{ \begin{array}{cc}0&C_{b}(x_{i})=y_{i}\\ 1&C_{b}(x_{i})\
eq y_{i}\end{array} \right. \tag{2}\]  
The new weight for each iteration is  
\[w_{b+1}(i)=w_{b}(i).exp(\alpha_{b}\xi_{b}(i)) \tag{3}\]  
where \(\alpha_{b}\) is a constant that is calculated from the error of the classifier in each iteration  
\[\alpha_{b}=ln((1-\varepsilon_{b})/\varepsilon_{b}) \tag{4}\]  
The calculated weights in each iteration are generally normalized, and their sum is one. This process is repeated in every step for b = 1, 2, 3,..., B, and then the ensemble classifier is built as a linear combination of the single classifiers weighted by the corresponding constant \(\alpha_{b}\):  
\[C(x)=sig\eta\left(\sum_{b-1}^{B}\alpha_{b}C_{b}(x)\right) \tag{5}\]  
Bagging (Bag)  
Bagging is an ensemble learning method introduced by [PERSON] [112]. It creates parallel diverse classifiers that are then coupled. Specifically, each bootstrap sample dataset is generated by randomly drawing, with replacement, \(N\) instances (\(N\) is the size of the original training datasets). Then, a classifier \(C_{i}\) is built from each bootstrap sample \(B_{i}\), and \(C^{*}\) is built from \(C_{1},C_{2},\ \ldots,\ C_{T}\). Bagging output is the class that is most often predicted by its sub-classifiers. This algorithm can be summarized as follows:  
Input: training set \(S\), inducer \(T\), integer \(T\) (number of bootstrap samples)  
(1) for \(i\) = 1 to \(T\) {  
(2) \(S^{i}\) = bootstrap sample from S (sample with replacement)  
(3) \(C_{i}=T\)(\(S^{i}\))  
(4) \(\}\)  
(5) \(C^{*}(x)=\underset{y\in Y}{\operatorname{argmax}}\sum_{i=C_{i}(x)=y}1\)  
(6) Output: classifier Random Subspace  
The random subspace (RS) method [113] is an ensemble classifier technique in which each training sample is defined as a p-dimensional vector \(\mathbf{X}_{i}=(x_{i1},\,x_{i2},\,\ldots,\,x_{ip})\) and r\(<\)p features are randomly selected from the p-dimensional dataset X in each iteration. Classifiers then are built into the random subspaces and aggregated through majority voting. The RS algorithm can be summarized as follows:  
1. Repeat for \(b=1,\,2,\,...,\,B\): 1. Select a r-dimensional random subspace \(\overline{X}^{b}\) from the original p-dimensional feature space. 2. Construct a classifier \(C^{b}(x)\) with a decision boundary \(C^{b}(x)=0\) in \(\overline{X}^{b}\). 2. Combine classifiers \(C^{b}(x),\,\,\,b=1,2,\ldots,B\) by simple majority voting to obtain a final decision rule: \[\beta(x)=\operatorname*{\mathrm{argmax}}_{y\in[-1,1]}\sum_{b}\delta_{sgn} \big{(}C^{b}(x)\big{)}.y\] (6) where \(\delta_{ij}\) is the Kronecker symbol and \(y\in[-1,1]\) is a decision (class label) of the classifier.