Learn R Programming

rtemis (version 0.79)

distillTreeRules: Distill rules from trained RF and GBM learners

Description

Extract rules from RF or GBM model, prune, and remove unnecessary rules using inTrees

Usage

distillTreeRules(mod, x, y = NULL, n.trees = NULL, maxdepth = 100,
  maxDecay = 0.05, typeDecay = 2, verbose = TRUE)

Arguments

mod

A trained RF or GBM model

x

The training set features

y

The training set outcomes. If NULL, assumed to be last column of x

n.trees

Integer: Number of trees to extract

maxdepth

Integer: Max depth to consider

maxDecay

Float: See inTree=es::pruneRule

typeDecay

Integer: See inTreees::pruneRule

verbose

Logical: If TRUE, print messages to output

Details

Models must be trained with s.RF or s.GBM / s.GBM3