oob_error: Out-of-bag error for a random forest.

View source: R/ppmodel.R

oob_errorR Documentation

Out-of-bag error for a random forest.

Description

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.

See Also

oob_predictions, oob_samples


ppforest2 documentation built on July 21, 2026, 9:07 a.m.