## Appendix A Technical Details on Hyperparameter Optimization  
There are different search techniques for optimizing hyperparameters; the most common are:  
Grid Search: An exhaustive method that explores all possible combinations of a predefined set of hyperparameters. This technique ensures that no potentially optimal combination is overlooked. Random Search: This method randomly explores a set of hyperparameter combinations. While it is less exhaustive than Grid Search, it is more time-efficient. Bayesian Optimization: This approach builds a probabilistic performance model and utilizes Hyperband, which combines Random Search with early stopping to evaluate many hyperparameter configurations quickly. The proposed study selected Grid Search for its comprehensiveness, simplicity, and reliability. It is straightforward to set up and implement, and since the results are not reliant on randomness, it is considered a trustworthy technique. Additionally, it can be used with any machine learning model and hyperparameter type, making it highly versatile. The specific hyperparameters considered in this study were:  
* n_estimators: This refers to the number of trees in the forest. A higher number of trees enhances the model's performance by reducing variance. * max_features: This parameter specifies the number of features to consider when splitting each node. By using'sqrt,' you ensure that each tree is trained on a distinct subset of characteristics, which enhances diversity and minimizes the risk of overfitting. * max_depth: This defines the maximum depth of each tree. A greater depth allows for the capture of more complex patterns, but intense trees can lead to overfitting. It is important to find a balance when selecting the depth. * min_samples_leaf: This parameter sets the minimum number of samples required to form a leaf. It helps prevent the creation of overly specific subdivisions that may contribute to overfitting. * min_samples_split: This indicates the minimum number of samples to split a node. Similarly to min_samples_leaf, this parameter aims to reduce excessive subdivisions. In a Random Forest model, the grid can include various combinations of values for the number of trees (n_estimators), the maximum depth of the trees (max_depth), the minimum number of samples required to split a node (min_samples_split), and other related parameters. Once the grid is defined, every possible combination of parameters is trained and validated using cross-validation. The study used the fit method to train the model on different combinations of hyperparameters as part of the Grid Search process. This method is crucial because it enables the model to learn from the data and adjust its internal parameters to minimize prediction error. During training, the model analyzes the characteristics of the input data and the corresponding labels, seeking to identify patterns and relationships that can be used for accurate predictions on new data. The fit method is essential as it optimizes the model through an iterative learning process. This process involves optimizing model parameters using a loss function, which measures the error between the model's predictions and the actual labels. The goal is to minimize this loss function, thereby improving the model's generalization ability to unseen data. This approach enabled us to identify the combination of hyperparameters that optimizes the model's performance, leading to more accurate and reliable predictions. Thus, the decision to use the fit method was vital to the success of our modeling approach, contributing significantly to enhancing the accuracy of flood risk forecasts. Cross-validation is a technique that divides the dataset into several parts, or 'folds.' The model is trained on one part of the dataset in each iteration and validated on another. This process is repeated for each combination of hyperparameters, ensuring the model is evaluated on different dataset sections.