Skip to contents

Observed response minus fitted.rf_fit, which for a forest is the out-of-bag prediction: each observation predicted only by the trees that did not see it. These are therefore already held-out residuals, unlike residuals.gwr_fit() and residuals.bayesian_fit(), which are in-sample. Feed them to residual_morans_i() to test whether spatial structure the forest failed to capture is still sitting in the residuals. Out-of-bag is not a substitute for spatial CV: use cv_rf() for an honest map-accuracy figure.

Usage

# S3 method for class 'rf_fit'
residuals(object, ...)

Arguments

object

An rf_fit.

...

Ignored.

Value

Numeric vector of length object$n.