margin: Margins of snpRF Classifier

Description Usage Arguments Value Author(s) See Also Examples

View source: R/margin.R

Description

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

Usage

1
2
3
4
5
6
## S3 method for class 'snpRF'
margin(x, ...)
## Default S3 method:
margin(x, observed, ...)
## S3 method for class 'margin'
plot(x, sort=TRUE, ...)

Arguments

x

an object of class snpRF, 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 snpRF 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 (copied from randomForest package by Greg Jenkins)

See Also

snpRF

Examples

1
2
3
4
5
6
set.seed(1)
data(snpRFexample)
eg.rf<-snpRF(x.autosome=autosome.snps,x.xchrom=xchrom.snps,
             xchrom.names=xchrom.snps.names,x.covar=covariates,
             y=phenotype,keep.forest=FALSE)
plot(margin(eg.rf))

snpRF documentation built on May 29, 2017, 8:36 p.m.

Related to margin in snpRF...