When I run random forest in R package and use plot function, there have many curves including out of bag error rate curve (black colour) and the misclassification error rate curves (other colours). However, I only would like to show on the plot only the out of bag error rate curve. How can I do that?
The curves can be subsetted using the $ symbol in R.
So, this is how you single out the error rate curve.
You might also want to look at the documentation of the random forest plot by: (
More in detail:
confusion Matrix contains a variable, called
err.rate which you access with the
$ sign. The
err.rate is stored as a matrix where the first column is the
OOB Error. Each class gets its own column. Try
To access the
err.rate do this
$err.rate[,1], for plotting simply
The other columns in your
matrix are the error rates of your classes!