oob_error: Extract OOB error from a forest model

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Extract Out of box error from a forest model. Supports models of these classes: ranger, randomForest<c3><b8>. The result adds an attribute 'measure' indicating what the result is measuring.

Usage

1
oob_error(model)

Arguments

model

forest model of class: ranger, randomForest

Value

A numerical value with an attribute. See description.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
temp <- ranger::ranger(Species ~., data = iris)
res <- oob_error(temp)
res
attr(res, "measure")

temp <- ranger::ranger(Sepal.Length ~., data = iris)
res <- oob_error(temp)
res
attr(res, "measure")

temp <- randomForest::randomForest(Species ~., data = iris)
res <- oob_error(temp)
res
attr(res, "measure")

temp <- randomForest::randomForest(Sepal.Length ~., data = iris)
res <- oob_error(temp)
res
attr(res, "measure")

talegari/forager documentation built on May 3, 2019, 4:01 p.m.