Geographically Weighted Random Forest
Geographically Weighted Random Forest (GWRF) · Also known as: Geographical Random Forest, GRF, Spatial Random Forest, Cografi Agirlikli Rastgele Orman
Geographically Weighted Random Forest (GWRF) is a spatially local ensemble learning method that fits an independent Random Forest model at each observation location, weighting nearby training samples more heavily than distant ones through a spatial kernel function. It was introduced by Stefanos Georganos and colleagues in 2019 (published 2021) as an extension of Breiman's Random Forest to handle spatial non-stationarity — the phenomenon where predictor–response relationships vary across geographic space.
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
When to use it
GWRF is appropriate when there is evidence or strong expectation of spatial non-stationarity — that is, when the relationship between predictors and the response variable changes across the study area. It suits moderate to large spatial datasets (typically n > 100) where computational cost is manageable. Assumptions include a continuous, georeferenced response variable and sufficient local sample density relative to the chosen bandwidth. It is not suited for purely temporal or aspatial data. Alternatives include Geographically Weighted Regression for linear settings, or Multi-scale GWR when drivers operate at different spatial scales.
Strengths & limitations
- Captures spatial non-stationarity in predictor–response relationships without imposing linearity
- Produces spatially varying variable importance maps, enabling regional interpretation of driver dominance
- Inherits Random Forest robustness to outliers, multicollinearity, and high-dimensional feature spaces
- Compatible with both Gaussian and adaptive kernel specifications, accommodating irregular spatial sampling
- Computationally expensive: fitting n separate forests and a cross-validation bandwidth search scales poorly with sample size
- Bandwidth selection via leave-one-out cross-validation can be unstable in sparse or clustered spatial datasets
- Local forests at edge locations are trained on fewer neighbours, potentially increasing prediction variance near study-area boundaries
- Lacks a formal statistical inference framework for local importance estimates, making uncertainty quantification ad hoc
Frequently asked
How does GWRF differ from standard Geographically Weighted Regression?
GWR estimates a linear model locally at each point, so it cannot capture non-linear predictor interactions or handle high-dimensional feature spaces without strong overfitting risk. GWRF replaces the linear estimator with a Random Forest, allowing arbitrary non-linear relationships and automatic interaction detection while retaining the geographically weighted localisation principle.
What sample size is needed for GWRF to produce reliable results?
There is no universal threshold, but practitioners commonly recommend at least 200 observations to ensure that each local forest receives enough weighted training samples. Georganos et al. demonstrate the method on datasets ranging from a few hundred to several thousand points; very small datasets risk degenerate local forests, particularly near the study-area boundary where spatial neighbours are sparse.
Can GWRF handle classification tasks or only regression?
The original formulation by Georganos et al. targets continuous response variables (regression). While the underlying Random Forest engine supports classification, the geographically weighted extension and the R package SpatialML are designed primarily for regression. Classification variants can be implemented by replacing the averaging aggregation with majority voting, but such extensions are not formally validated in the published literature as of 2021.
Sources
- Georganos, S., et al. (2021). Geographical random forests: a spatial extension of the random forest algorithm. Geocarto International, 36(2), 121–136. link ↗
How to cite this page
ScholarGate. (2026, June 2). Geographically Weighted Random Forest (GWRF). ScholarGate. https://scholargate.app/en/spatial-analysis/geographically-weighted-random-forest
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- Geographically Weighted RegressionSpatial analysis↔ compare
- Random ForestMachine learning↔ compare
- Spatial Lag ModelSpatial analysis↔ compare