[Paper Review] How to out-perform default random forest regression: choosing hyperparameters for applications in large-sample hydrology
This study identifies optimized hyperparameters for random forest and XGBoost regression models in large-sample hydrology, significantly outperforming default settings. Using 151 global catchment datasets and meta-learning, it provides data-driven defaults that improve predictive accuracy—especially for KGE and NSE metrics—making advanced machine learning accessible to hydrologists without expert tuning knowledge.
Predictions are a central part of water resources research. Historically, physically-based models have been preferred; however, they have largely failed at modeling hydrological processes at a catchment scale and there are some important prediction problems that cannot be modeled physically. As such, machine learning (ML) models have been seen as a valid alternative in recent years. In spite of their availability, well-optimized state-of-the-art ML strategies are not being widely used in water resources research. This is because using state-of-the-art ML models and optimizing hyperparameters requires expert mathematical and statistical knowledge. Further, some analyses require many model trainings, so sometimes even expert statisticians cannot properly optimize hyperparameters. To leverage data and use it effectively to drive scientific advances in the field, it is essential to make ML models accessible to subject matter experts by improving automated machine learning resources. ML models such as XGBoost have been recently shown to outperform random forest (RF) models which are traditionally used in water resources research. In this study, based on over 150 water-related datasets, we extensively compare XGBoost and RF. This study provides water scientists with access to quick user-friendly RF and XGBoost model optimization.
Motivation & Objective
- Address the widespread use of default hyperparameters in random forest and XGBoost models despite their suboptimal performance in hydrological regression.
- Overcome the barrier of expert knowledge in hyperparameter optimization (HPO) that limits adoption of state-of-the-art machine learning in hydrology.
- Develop a meta-model trained on 151 large-sample hydrology datasets to predict optimal hyperparameters for new datasets based on meta-features.
- Systematically compare XGBoost and random forest performance under different evaluation metrics (KGE and NSE) and HPO strategies.
- Provide practical, user-friendly, and data-driven hyperparameter defaults that outperform standard configurations in real-world hydrological applications.
Proposed method
- Collected and processed 151 large-sample hydrology datasets from the CAMELS and related benchmark datasets, covering diverse climatic and hydrological conditions.
- Applied systematic hyperparameter optimization using random search across a defined hyperparameter space for both XGBoost and random forest models.
- Used KGE and NSE as primary evaluation metrics to assess model performance across all datasets and hyperparameter configurations.
- Extracted meta-features (e.g., number of predictors, data range, skewness) from each dataset to train a meta-learner that predicts optimal hyperparameters for new datasets.
- Trained a meta-model using the relationship between dataset meta-features and optimal hyperparameter configurations to generalize across unseen catchments.
- Validated the performance of the new hyperparameter defaults against default settings and prior optimal defaults, using cross-validation across all datasets.
Experimental results
Research questions
- RQ1Can hyperparameter optimization significantly improve the predictive performance of random forest and XGBoost models in large-sample hydrology?
- RQ2How do optimal hyperparameters for XGBoost and random forest differ when evaluated using KGE versus NSE metrics?
- RQ3Can a meta-learner trained on dataset meta-features reliably predict optimal hyperparameters for new, unseen hydrological catchments?
- RQ4Do the optimal hyperparameters identified in this study consistently outperform default settings across diverse hydrological conditions and data characteristics?
- RQ5What are the most influential hyperparameters for improving model performance in hydrological regression, and how do they vary with evaluation metric?
Key findings
- The new optimal default hyperparameters for random forest with KGE as the evaluation metric are: mtry=0.885, numtrees=780, replace=True, min_node_size=0.14, and sample_fraction=0.900, significantly outperforming default settings.
- For NSE evaluation, the optimal random forest defaults are: mtry=0.650, numtrees=49, replace=False, min_nodesize=0.37, and sample_fraction=0.854, showing a strong metric-dependent shift in optimal settings.
- XGBoost outperforms random forest when KGE is the evaluation metric, with optimal hyperparameters including numrounds=2945, eta=0.018, and subsample=0.483 for KGE.
- For NSE, XGBoost’s optimal settings are numrounds=4942, eta=0.029, subsample=0.765, max_depth=6, and lambda=1019.458, indicating higher regularization and deeper trees than default.
- The new optimal defaults for both models consistently outperform the original defaults from Probst et al. (2019), especially in mtry, number of trees, and sample fraction, which are set higher than prior recommendations.
- XGBoost is consistently faster than random forest but slower than the ranger implementation, and the new hyperparameter settings significantly improve predictive accuracy across diverse catchment types.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.