Description Usage Arguments Value Examples
View source: R/FeatureImportance.R
Computes feature importance of every unique feature used to make a split in the RerF model.
1 | FeatureImportance(forest, num.cores = 0L, type = NULL)
|
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.
|
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.