Skip to contents

Computes (or returns the cached) OOB error using the training data stored on the model. For classification, this is the misclassification rate in `[0, 1]`. For regression, it is the mean squared error against the continuous response.

Usage

oob_error(model)

Arguments

model

A pprf forest model.

Value

A numeric scalar in `[0, 1]` for classification or `[0, Inf)` for regression. Returns `NA_real_` when no observation has any out-of-bag tree (e.g. a degenerate forest where every tree saw every row). Callers should check with `is.na()` rather than comparing against a sentinel value; in earlier versions this condition was signalled as `-1`, which was not distinguishable from a (mathematically impossible but representable) error rate.