Skip to contents

Geographically weighted random forest for regression. Calls SpatialML::grf() from package SpatialML.

The learner requires a spatial task with coordinates, e.g., a TaskRegrST from package mlr3spatiotempcv.

Predictions are computed with the predict() method of SpatialML using only the local models, i.e., local.w = 1 and global.w = 0.

Initial parameter values

  • print.results is set to FALSE and not exposed as a hyperparameter. This also disables the progress bar controlled by progress.

Custom mlr3 parameters

  • min.node.size, max.depth, replace, and sample.fraction are passed to ranger::ranger().

Dictionary

This Learner can be instantiated via lrn():

lrn("regr.gwrf")

Meta Information

  • Task type: “regr”

  • Predict Types: “response”

  • Feature Types: “integer”, “numeric”, “factor”

  • Required Packages: mlr3, mlr3extralearners, SpatialML

Parameters

IdTypeDefaultLevelsRange
bwnumeric-\([0, \infty)\)
kernelcharacteradaptiveadaptive, fixed-
ntreeinteger500\([1, \infty)\)
mtryinteger-\([1, \infty)\)
importancecharacterimpurityimpurity, permutation-
nthreadsinteger-\([1, \infty)\)
geo.weightedlogicalTRUETRUE, FALSE-
oob.fallbackcharacterlooloo, inbag-
min.node.sizeinteger5\([1, \infty)\)
max.depthinteger-\([0, \infty)\)
replacelogicalTRUETRUE, FALSE-
sample.fractionnumeric-\([0, 1]\)

References

Georganos, Stefanos, Grippa, Tais, Gadiaga N, Assane, Linard, Catherine, Lennert, Moritz, Vanhuysse, Sabine, Mboga, Nicholus, Wolff, Eleonore, Kalogirou, Stamatis (2021). “Geographical random forests: a spatial extension of the random forest algorithm to address spatial heterogeneity in remote sensing and population modelling.” Geocarto International, 36(2), 121–136. doi:10.1080/10106049.2019.1595177 .

See also

Author

Manh Hung LE

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrGWRF

Methods

Inherited methods


LearnerRegrGWRF$new()

Creates a new instance of this R6 class.

Usage


LearnerRegrGWRF$importance()

The importance scores are the column means of the slot Local.Variable.Importance.

Usage

LearnerRegrGWRF$importance()

Returns

Named numeric().


LearnerRegrGWRF$oob_error()

The OOB error is extracted from the global model slot Global.Model$prediction.error.

Usage

LearnerRegrGWRF$oob_error()

Returns

numeric(1).


LearnerRegrGWRF$clone()

The objects of this class are cloneable with this method.

Usage

LearnerRegrGWRF$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.