forest_rfe: lightweight implementation of RFE using ranger

Description Usage Arguments Value References Examples

View source: R/forest_rfe.R

Description

For datasets with large number of predictors, this implementation has these modifications to regular recursive feature elimination procedure:

For a comprehensive RFE procedure with resampling, use rfe

Usage

1
2
forest_rfe(dataset, responseVarName, sizes, sampleprop = 0.2,
  nsamples = 10, seed = 1, ...)

Arguments

dataset

(object inheriting data.frame class) A dataframe

responseVarName

(string) Name of the response variable

sizes

(integer vector) Vector of number of variables. When missing, sizes will be sequence of nc/2^i where the sequnce ranges from nc(number of columns) to 2.

sampleprop

(A real number between 0 and 1 or a vector) Proportion of observations. If not a single number and sizes is specified, this vector should have same length as sizes. per sample

nsamples

(positive integer or a vector) Number of samples. If not a single number and sizes is specified, this vector should have same length as sizes.

seed

(positive integer) Seed

...

Arguments to be passed to ranger

Value

A list with:

References

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
temp <- forest_rfe(iris, "Species")
temp

temp <- forest_rfe(iris
                   , "Species"
                   , sizes = c(4,2)
                   , sampleprop = c(0.2, 0.3)
                   , nsamples = c(20, 30)
                   )
temp

temp <- forest_rfe(iris
                   , "Species"
                   , sizes = c(4,2)
                   , sampleprop = 0.1
                   , nsamples = c(20, 30)
                   )
temp

temp <- forest_rfe(iris
                   , "Species"
                   , sizes = c(4,2)
                   , sampleprop = c(0.2, 0.3)
                   , nsamples = 10
                   )
temp

temp <- forest_rfe(iris
                   , "Species"
                   , sizes = c(4,2)
                   , sampleprop = c(0.2, 0.3)
                   , nsamples = 10
                   , mtry = list(3, 2)
                   , num.trees = list(500, 1000)
                   , case.weights = replicate(2, runif(150), simplify = FALSE)
                   )
temp

talegari/forager documentation built on May 3, 2019, 4:01 p.m.