Learn R Programming

permimp (version 1.1-0)

selFreq: Predictor Selection Frequency in Random Forests

Description

counts how many times each predictor variable was selected for splitting in a random forest. Only implemented for cforest form the party package.

Usage

selFreq(object, whichxnames = NULL)

Value

An object of class VarImp, with as $values the mean of the sum of the selection frequencies across the trees.

Arguments

object

an object as returned by cforest.

whichxnames

a character vector containing the predictor variable names that for which the permutation importance should be computed. See section 'Details'.

Details

Function selFreq counts how many times each predictor variable was selected for splitting in a random forest. In the current implementation this selFreq can only be applied to random forests as returned by cforest.

See Also

VarImp,

Examples

Run this code
    
  set.seed(290875)
  readingSkills.cf <- party::cforest(score ~ ., data = party::readingSkills, 
                              control = party::cforest_unbiased(mtry = 2, ntree = 100))
  
  ## Selection Frequency
  selFreq(readingSkills.cf)

Run the code above in your browser using DataLab