SpatialML implements a spatial extension of the Random Forest
algorithm. The main functions are grf for fitting a
Geographically Weighted Random Forest (GRF), grf.bw for
selecting an optimal bandwidth, predict.grf (the S3
method dispatched by predict()) for generating spatial
predictions, and rf.mtry.optim for tuning the global
mtry parameter through cross-validation. The package also ships a
small synthetic-data generator random.test.data and a real
data set Income.
Stamatis Kalogirou stamatis.science@gmail.com (maintainer, https://stamatisgeoai.eu/), Stefanos Georganos stefanos.georganos@kau.se.
GRF fits one Random Forest per observation in space, using a local neighbourhood defined by an adaptive kernel (the \(k\) nearest neighbours) or a fixed kernel (a Euclidean radius). Observations within the neighbourhood are optionally weighted by the bi-square kernel \(w_{ij} = (1 - (d_{ij} / h)^2)^2\), where \(d_{ij}\) is the distance between observations \(i\) and \(j\) and \(h\) is the local bandwidth. The approach combines the flexibility and high predictive accuracy of Random Forests with a treatment of spatial non-stationarity inspired by Geographically Weighted Regression.
The package uses ranger as its random-forest
back-end. Undefined local OOB predictions are handled with a quiet
leave-one-out fallback. See
vignette("SpatialML") for a complete walk-through of a
mtry tuning -> bandwidth search -> GRF fit -> prediction
workflow.
For tutorials, related publications and contact information visit the maintainer's website at https://stamatisgeoai.eu/.
Georganos, S., Grippa, T., Niang Gadiaga, A., Linard, C., Lennert, M., Vanhuysse, S., Mboga, N., Wolff, E., Kalogirou, S. (2019) Geographical Random Forests: A Spatial Extension of the Random Forest Algorithm to Address Spatial Heterogeneity in Remote Sensing and Population Modelling. Geocarto International, tools:::Rd_expr_doi("10.1080/10106049.2019.1595177").
Georganos, S. and Kalogirou, S. (2022) A Forest of Forests: A Spatially Weighted and Computationally Efficient Formulation of Geographical Random Forests. ISPRS International Journal of Geo-Information, 11(9), 471. tools:::Rd_expr_doi("10.3390/ijgi11090471").
grf, grf.bw, predict.grf,
rf.mtry.optim, random.test.data,
Income, ranger.