importance: Extract variable importance measure

Description Usage Arguments Details Value See Also Examples

Description

This is the extractor function for variable importance measures as produced by snpRF.

Usage

1
2
## S3 method for class 'snpRF'
importance(x, type=NULL, class=NULL, scale=TRUE, ...)

Arguments

x

an object of class snpRF

.

type

either 1 or 2, specifying the type of importance measure (1=mean decrease in accuracy, 2=mean decrease in node impurity).

class

which class-specific measure to return.

scale

For permutation based measures, should the measures be divided their “standard errors”?

...

not used.

Details

Two importance measures are extracted using this function. The first measure is computed by permuting OOB data: For each tree, the prediction error on the out-of-bag portion of the data is recorded (error rate for classification). Then the same is done after permuting each predictor variable. The differences between the two are then averaged over all trees, and normalized by the standard deviation of the differences. If the standard deviation of the difference is equal to 0 for a variable, the division is not done (but the average is almost always equal to 0 in that case).

The second measure is the total decrease in node impurities (measured by the Gini index) from splitting on the variable, averaged over all trees.

Value

A matrix of importance measure(s), one row for each predictor variable. The column(s) are different importance measures.

See Also

snpRF, varImpPlot

Examples

1
2
3
4
5
6
7
8
9
set.seed(4543)
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,importance=TRUE)

importance(eg.rf)
importance(eg.rf, type=1)

snpRF documentation built on May 2, 2019, 6:51 a.m.

Related to importance in snpRF...