plot: icrf IMSE rate plot

plotR Documentation

icrf IMSE rate plot

Description

'Plot the error rates or MSE of a randomForest object' (Quoted statements are from randomForest by Liaw and Wiener unless otherwise mentioned.)

Usage

## S3 method for class 'icrf'
plot(x, type = "l", main = deparse(substitute(x)), oob = FALSE, ...)

Arguments

x

an object of icrf class.

type

'type of plot.'

main

'main title of the plot.'

oob

Whether the out-of-bag error should be returned?

...

'other graphical parameters.'

Value

The IMSE (integrated mean squared error) of the icrf object is invisibly returned. 'If the object has a non-null test component, then the returned object is a matrix where the first' (two) column is the IMSE measure (types 1 and 2), 'and the second column is for the test set.' The rows represent the forest iterations.

Note

'If the x has a non-null test component, then the test set errors are also plotted.'

Author(s)

Hunyong Cho, Nicholas P. Jewell, and Michael R. Kosorok.

References

Cho H., Jewell N. J., and Kosorok M. R. (2020+). "Interval censored recursive forests"

Examples

# rats data example
# Note that this is a toy example. Use a larger ntree and nfold in practice.
data(rat2)
set.seed(1)
samp <- sample(1:dim(rat2)[1], 200)
rats.train <- rat2[samp, ]
rats.test <- rat2[-samp, ]
# Note that this is a toy example. Use a larger ntree and nfold in practice.
set.seed(2)


 rats.icrf.small <-
   icrf(~ dose.lvl + weight + male + cage.no, data = rat2,
        data.type = "currentstatus", currentstatus.label = c("survtime", "tumor"),
        returnBest = TRUE, ntree=10, nfold=3)
 plot(rats.icrf.small)


icrf documentation built on Oct. 30, 2022, 1:05 a.m.

Related to plot in icrf...