# Spatial Prediction of Soil Contaminants Using a Hybrid Random Forest-Ordinary Kriging Model
###### Abstract  
The accurate prediction of soil contamination in abandoned mining areas is necessary to address their environmental risks. This study employed a combined model of machine learning and geostatistics to predict the spatial distribution of soil contamination using heavy metal data collected in an abandoned metal mine. An exploratory data analysis was used to identify patterns in the collected data, the root mean squared error (RMSE) and coefficient of determination (R\({}^{2}\)) were used to verify the predicted values, and the model was validated using K-fold cross-validation. The prediction results were produced as a map by applying hyperparameter tuning to Random Forest (RF) and Ordinary Kriging (OK) through GridSearchCV using optimal parameter selections. Furthermore, the prediction residuals of the RF model were calculated, and the RF prediction map and OK interpolation results of the RF prediction residuals were summarized to construct an RF-OK prediction map. The RMSE and R\({}^{2}\) values for the RF, OK, and RF-OK interpolation models were 66.214, 65.101, and 52.884 mg/kg and 0.867, 0.871, and 0.915, respectively. In addition, the optimization results with the minimum RMSE and maximum R\({}^{2}\) were obtained through hyperparameter tuning. The proposed RF-OK hybrid model demonstrated superior prediction performance compared to the individual models. interpolation; geostatistics; machine learning; Ordinary Kriging; Random Forest +
Footnote †: journal: Applied Sciences  
of data for a predictive map is unclear, making it important to maximize utility while minimizing opportunity costs. Although producing highly reliable predictive maps based on small amounts of sampled distribution data is crucial, the techniques used to create these maps have inherent limitations, thereby necessitating a thorough evaluation and analysis of the influencing factors to minimize errors and generate highly reliable maps [1]. Numerous studies have reported the use of geostatistical techniques [2; 3; 4] to interpolate values at unsampled points from sampling data. Many studies have been conducted in geographic information system (GIS) environments to create predictive maps by applying geostatistics, and many of these studies have employed Ordinary Kriging (OK) [5; 6; 7]. Cross-validation is frequently used to verify Kriging-based estimated values [8; 9; 10]. Additionally, the Kriging application process offers numerous options and parameters that can affect the prediction results. For instance, [PERSON] et al. [11] analyzed the effect of varying the lag distance on the prediction error when creating a semivariogram. However, a comprehensive analysis is lacking on the impact of all available options and parameters in Kriging techniques on prediction errors, preventing the identification of the optimal selections. Recently, machine learning techniques have gained attention for data prediction and analysis [12; 13; 14; 15]. Cross-validation is also commonly performed in machine learning research, and the optimization of models using hyperparameter tuning techniques has been used to optimize the available options and parameters [16; 17; 18]. Recent studies have either compared the prediction performance (error) of geostatistics and machine learning techniques in interpolation [19; 20] or combined both techniques for interpolation [21; 22; 23; 24; 25]. The code for the combined RF-OK model presented in this study is in the Appendix A. [PERSON] et al. [19] applied OK and an Artificial Neural Network (ANN) to predict subsurface profile information from an Unboring region and found that the machine learning results were distributed in a similar pattern, although they performed worse than geostatistics. In the case of [PERSON] et al. [20], OK and Support Vector Machine (SVM) were used for mapping soil attributes.