Machine learningSpatial analysisSpatial machine learningAlgorithm

Geographically Weighted Random Forest

Also known as: Geographical Random Forest, GRF, Spatial Random Forest, Cografi Agirlikli Rastgele Orman

OriginatorStefanos Georganos et al.Year2021Sources1Related methods4

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.

Key highlights

  • 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

Intuition

This section is available to Pro members. Upgrade to Pro

How it works

This section is available to Pro members. Upgrade to Pro

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

Strengths
  • 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
Limitations
  • 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

Common pitfalls

This section is available to Pro members. Upgrade to Pro

Applications

This section is available to Pro members. Upgrade to Pro

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

  1. 1.
    Georganos, S., et al. (2021). Geographical random forests: a spatial extension of the random forest algorithm. Geocarto International, 36(2), 121–136.

You have read it. What now?

Cite this page

ScholarGate. (2026, June 2). Geographically Weighted Random Forest. ScholarGate. https://scholargate.app/spatial-analysis/geographically-weighted-random-forest

Geographically Weighted Random Forest | ScholarGate