A Unified Framework for Random Forest Prediction Error Estimation
Overview
Estimates the conditional error distributions of random forest predictions and common parameters of those distributions, including conditional misclassification rates, conditional mean squared prediction errors, conditional biases, and conditional quantiles, by out-of-bag weighting of out-of-bag prediction errors as proposed by Lu and Hardin (2021). This package is compatible with several existing packages that implement random forests in R.
Version 1.1.0 makes two changes. First, it enables estimation of the conditional misclassification rate of predictions by classification random forests as proposed by Lu and Hardin (2021). Second, it compartmentalizes a costly step in the quantForestError algorithm: The identification of each training observation's out-of-bag terminal nodes.
Conditional Misclassification Rate Estimation
The conditional misclassification rate of predictions by classification random forests can now be estimated. To estimate it, simply set the what argument in the quantForestError function to "mcr". what will default to this if the provided forest is a classification random forest. See the example code in the README for a toy demonstration of the performance of this estimator.
Compartmentalization
The identification of each training observation's out-of-bag terminal nodes is now compartmentalized from the main quantForestError function. By isolating this step from the main quantForestError function, Version 1.1.0 allows users to more efficiently iterate the algorithm. Users may wish to feed quantForestError batches of test observations iteratively if they have streaming data or a large test set that cannot be processed in one go due to memory constraints. In previous versions of this package, doing so would require the algorithm to recompute each training observation's out-of-bag terminal nodes in each iteration. This was redundant and costly. By separating this computation from the rest of the quantForestError algorithm, Version 1.1.0 allows the user to perform this computation only once.
As part of this modularization, the quantForestError function now has two additional arguments. If set to TRUE, return_train_nodes will return a data.table identifying each training observation's out-of-bag terminal nodes. This data.table can then be fed back into quantForestError via the argument train_nodes to avoid the redundant recomputation.
Version 1.1.0 also exports the function that produces the data.table identifying each training observation's out-of-bag terminal nodes. It is called findOOBErrors. Assuming the same inputs, findOOBErrors will produce the same output that is returned by setting return_train_nodes to TRUE in the quantForestError function.
See the documentation on quantForestError and findOOBErrors for examples.
Neither of these changes affects code that relied on Version 1.0.0 of this package, as the changes consist solely of a newly exported function, two optional arguments to quantForestError that by default do nothing new, and a new possible input for the what argument.
From NEWS.md in the release
Install
Health
NOTECRAN incoming feasibilityr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc
Maintainer: ‘Benjamin Lu <b.lu@berkeley.edu>’
No Authors@R field in DESCRIPTION.
Please add one, modifying
Authors@R: c(person(given = "Benjamin",
family = "Lu",
role = c("aut", "cre"),
email = "b.lu@berkeley.edu"),
person(given = "Johanna",
family = "Hardin",
role = "aut"))
as necessary.
Package CITATION file contains call(s) to old-style personList() or
as.personList(). Please use c() on person objects instead.
Package CITATION file contains call(s) to old-style citEntry(). Please
use bibentry() instead.- NOTE11 OK, 2 NOTE2026-05-10
- WARNING11 OK, 1 NOTE, 1 WARNING2026-05-09
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
- Help pages
- 6 (2 internal)
- Examples that run
- 100%4 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 77%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Dependencies
Installing forestError adds 8 packages (7 with compiled code, 8.8 MB of source tarballs). Heaviest: data.table 5.7 MB, vctrs 1.0 MB, rlang 766 KB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- 1.1.0Latest
- RR 4.1.0 released · 2021-05-18
- 1.0.02021-02-11 · diff ↗
- RR 4.0.0 released · 2020-04-24
- 0.2.02020-04-02 · diff ↗
- 0.1.12020-01-31 · diff ↗
- 0.1.02020-01-14
- RR 3.6.0 released · 2019-04-26
Package metadata
- First published
- 2020-01-14
- Total releases
- 5 / 6 yrs
- License
- GPL-3 OSI
- Download size
- 14 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("forestError")The package provides a citation file, so citation() returns the authors' own entry.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-20, which the citation names so these numbers can be found later. More on citing and the projects behind them.