FeatureImportance: Compute Feature Importance of a RerF model

Description Usage Arguments Value Examples

View source: R/FeatureImportance.R

Description

Computes feature importance of every unique feature used to make a split in the RerF model.

Usage

1
FeatureImportance(forest, num.cores = 0L, type = NULL)

Arguments

forest

a forest trained using the RerF function with argument store.impurity = TRUE

num.cores

number of cores to use. If num.cores = 0, then 1 less than the number of cores reported by the OS are used. (num.cores = 0)

type

character string specifying which method to use in calculating feature importance.

'C'

specifies that unique combinations of features should be *c*ounted across trees.

'R'

feature importance will be calculated as in *R*andomForest.

'E'

calculates the unique projections up to *e*quivalence if the vector of projection weights parametrizes the same line in R^p.

Value

a list with 3 elements,

imp

The vector of scores/counts, corresponding to each feature.

features

The features/projections used.

type

The code for the method used.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(rerf)
num.cores <- 1L
forest <- RerF(as.matrix(iris[, 1:4]), iris[[5L]], num.cores = 1L, store.impurity = TRUE)

imp.C <- FeatureImportance(forest, num.cores, "C")
imp.R <- FeatureImportance(forest, num.cores, "R")
imp.E <- FeatureImportance(forest, num.cores, "E")

fRF <- RerF(as.matrix(iris[, 1:4]), iris[[5L]],
            FUN = RandMatRF, num.cores = 1L, store.impurity = TRUE)

fRF.imp <- FeatureImportance(forest = fRF, num.cores = num.cores)

rerf documentation built on May 2, 2019, 8:16 a.m.