Regression Geographically Weighted Random Forest Learner
Source:R/learner_SpatialML_regr_gwrf.R
mlr_learners_regr.gwrf.RdGeographically 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.resultsis set toFALSEand not exposed as a hyperparameter. This also disables the progress bar controlled byprogress.
Custom mlr3 parameters
min.node.size,max.depth,replace, andsample.fractionare passed toranger::ranger().
Meta Information
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, SpatialML
Parameters
| Id | Type | Default | Levels | Range |
| bw | numeric | - | \([0, \infty)\) | |
| kernel | character | adaptive | adaptive, fixed | - |
| ntree | integer | 500 | \([1, \infty)\) | |
| mtry | integer | - | \([1, \infty)\) | |
| importance | character | impurity | impurity, permutation | - |
| nthreads | integer | - | \([1, \infty)\) | |
| geo.weighted | logical | TRUE | TRUE, FALSE | - |
| oob.fallback | character | loo | loo, inbag | - |
| min.node.size | integer | 5 | \([1, \infty)\) | |
| max.depth | integer | - | \([0, \infty)\) | |
| replace | logical | TRUE | TRUE, FALSE | - |
| sample.fraction | numeric | - | \([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
as.data.table(mlr_learners)for a table of available Learners in the running session (depending on the loaded packages).Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Super classes
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrGWRF
Methods
Inherited methods
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()
LearnerRegrGWRF$importance()
The importance scores are the column means of the slot Local.Variable.Importance.
Returns
Named numeric().
LearnerRegrGWRF$oob_error()
The OOB error is extracted from the global model slot Global.Model$prediction.error.