Learn R Programming

randomForest (version 4.7-1.2)

plot.randomForest: Plot method for randomForest objects

Description

Plot the error rates or MSE of a randomForest object

Usage

# S3 method for randomForest
plot(x, type="l", main=deparse(substitute(x)), ...)

Value

Invisibly, the error rates or MSE of the randomForest object. If the object has a non-null test component, then the returned object is a matrix where the first column is the out-of-bag estimate of error, and the second column is for the test set.

Arguments

x

an object of class randomForest.

type

type of plot.

main

main title of the plot.

...

other graphical parameters.

Author

Andy Liaw

See Also

randomForest

Examples

Run this code
data(mtcars)
plot(randomForest(mpg ~ ., mtcars, keep.forest=FALSE, ntree=100), log="y")

Run the code above in your browser using DataLab