# Classifying Inundation in a Tropical Wetlands Complex with GNSS-R
## 4 Classification Methodology
### Algorithm Training  
Next, we define the algorithm in more detail, as shown in Figure 7, which summarizes the MDTR algorithm scheme that was implemented in MATLAB.  
The input variables correspond to different GNSS-R observables, derived from CYGNSS measurements, and ancillary data (aboveground biomass and elevation), total  
Figure 7: Flowchart showing the MDTR construct to obtain the GNSS-R inundation classification. The top shows the internal structure and training of the MDTR algorithm. The MDTR algorithm trains on 50 grab samples, selected randomly from the reference training samples (cycles 71, 74, 79, 83, 85, and 93 of the PALSAR-2-based inundation reference maps), and 50 combinations of inputs, selected randomly from all possible combination of inputs, creating 2500 decision trees (DT) using a standard classification and regression tree (CART) for machine learning described by [54] for each one of the DT. In the bottom, the validation reference samples (cycles 77 and 91 of the PALSAR-2-based inundation reference maps) are used to obtain the corresponding CYGNSS geolocated observables. Those georeferenced observables are input into the MDTR algorithm. A total of 2500 outputs are evaluated, and the answer with the highest number of votes is selected for each grid cell in order to build the final GNSS-R inundation classification map. This output is then compared to the PALSAR-2 validation reference samples to assess the performance of the GNSS-R inundation classification obtained from the MDTR algorithm.  
variables. PALSAR-2-based inundation reference maps were used as reference to train the algorithm and validate the results (referred as PALSAR-2-based reference inundation maps). The MDTR algorithm training scheme (Figure 7) is built through the following steps:  
1. The reference training samples (cycles 71, 74, 79, 83, 85, and 93 of the PALSAR-2-based inundation reference maps) are randomized in 50 grab samples (each containing 60% of the samples);
2. The inputs (5 GNSS-R observables and 2 ancillary datasets) are randomized by selecting 50 different combinations;
3. The different combinations of inputs are collocated to each one of the grab samples; and
4. The reference grab samples and each combination of collocated inputs are used to train single decision trees (DT).
5. Each single DT is based on a standard classification and regression tree (CART) approach for machine learning [54]. A total of 2500 single DT's are generated, constituting the MDTR algorithm.  
The MDTR algorithm validation scheme (Figure 7) is implemented as: (1) the validation reference samples (cycles 77 and 91 of the PALSAR-2-based inundation reference maps) are used to obtain the corresponding geolocated CYGNSS observables; (2) those georeferenced observables are input into the MDTR algorithm; (3) to classify a given grid cell, a total of 2500 outputs are evaluated; (4) the grid cell is assigned the class that is identified most often by the ensemble of decision trees, generating the final GNSS-R inundation classification map; and (5) the classification outputs are compared to the validation reference samples to assess the performance of the GNSS-R inundation classification obtained from the MDTR algorithm.