Environmental monitoring increasingly relies on flexible, data‑driven methods to model complex spatial processes. Random Forest (RF) algorithms are widely used for capturing nonlinear relationships among numerous predictors, but they assume independent observations and thus fail to account for spatial autocorrelation. Random Forest–Generalized Least Squares (RF–GLS) addresses this limitation by modeling a Gaussian-process covariance structure into each fit. This thesis evaluates the performance of Random Forest Generalized Least Squares (RF–GLS) in comparison to standard Random Forest (RF) through simulation experiments and a real-world case study of lake-water pH across Sweden. The study aims to identify the order of importance of various variables influencing pH levels, providing insights into the most significant environmental factors affecting lake-water acidity. Simulation results show that RF–GLS consistently outperforms standard RF when spatial autocorrelation is strong, but this advantage diminishes as the nugget effect (non-spatial error) becomes comparable in magnitude to the spatial variance component. In the case study, both methods perform similarly in predictive accuracy across four environmentally distinct subregions. Permutation-based importance analysis identifies calcium concentration as the most influential predictor of pH, while geographic variables contribute minimally. These findings indicate that, in practice, RF and RF–GLS yield broadly similar results in both prediction and variable importance, even when moderate spatial dependence is present.