Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

margin

Margins of RRF Classifier


Description

Compute or plot the margin of predictions from a RRF classifier.

Usage

## S3 method for class 'RRF'
margin(x, ...)
## Default S3 method:
margin(x, observed, ...)
## S3 method for class 'margin'
plot(x, sort=TRUE, ...)

Arguments

x

an object of class RRF, whose type is not regression, or a matrix of predicted probabilities, one column per class and one row per observation. For the plot method, x should be an object returned by margin.

observed

the true response corresponding to the data in x.

sort

Should the data be sorted by their class labels?

...

other graphical parameters to be passed to plot.default.

Value

For margin, the margin of observations from the RRF classifier (or whatever classifier that produced the predicted probability matrix given to margin). The margin of a data point is defined as the proportion of votes for the correct class minus maximum proportion of votes for the other classes. Thus under majority votes, positive margin means correct classification, and vice versa.

Author(s)

Robert Gentlemen, with slight modifications by Andy Liaw

See Also

Examples

set.seed(1)
data(iris)
iris.rf <- RRF(Species ~ ., iris, keep.forest=FALSE)
plot(margin(iris.rf))

RRF

Regularized Random Forest

v1.9.1
GPL (>= 2)
Authors
Fortran original by Leo Breiman and Adele Cutler, R port by Andy Liaw and Matthew Wiener, Regularized random forest for classification by Houtao Deng. Regularized random forest for regression by Xin Guan.
Initial release
2018-07-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.