Learn R Programming

FFTrees (version 1.2.3)

grow.FFTrees: Grows fast and frugal trees using an algorithm specified by algorithm.

Description

Grows fast and frugal trees using an algorithm specified by algorithm.

Usage

grow.FFTrees(formula, data, max.levels = 4, algorithm = "m",
  goal = "bacc", sens.w = 0.5, stopping.rule = "exemplars",
  stopping.par = 0.1, verbose = FALSE, rank.method = NULL, ...)

Arguments

formula

formula. A formula

data

dataframe. A dataset

max.levels

integer. The maximum number of levels in the tree(s)

algorithm

character. A string indicating how to rank cues during tree construction. "m" (for marginal) means that cues will only be ranked once with the entire training dataset. "c" (conditional) means that cues will be ranked after each level in the tree with the remaining unclassified training exemplars.

goal

character. A string indicating the statistic to maximize: "acc" = overall accuracy, "bacc" = balanced accuracy, "wacc" = weighted accuracy

sens.w

numeric. A number from 0 to 1 indicating how to weight sensitivity relative to specificity.

stopping.rule

character. A string indicating the method to stop growing trees. "levels" means the tree grows until a certain level. "exemplars" means the tree grows until a certain number of unclassified exemplars remain. "statdelta" means the tree grows until the change in the criterion statistic is less than a specified level.

stopping.par

numeric. A number indicating the parameter for the stopping rule. For stopping.rule == "levels", this is the number of levels. For stopping rule == "exemplars", this is the smallest percentage of examplars allowed in the last level.

verbose

logical. Should tree growing progress be displayed?

rank.method

depricated arguments

...

Currently ignored

Value

A list of length 4. tree.definitions contains definitions of the tree(s). tree.stats contains classification statistics for the tree(s). levelout shows which level in the tree(s) each exemplar is classified. Finally, decision shows the classification decision for each tree for each exemplar

Examples

Run this code

 titanic.trees <- grow.FFTrees(formula = survived ~.,
                               data = titanic)

# Tree definitions are stored in tree.definitions

titanic.trees$tree.definitions

# Tree classification statistics are in tree.stats

titanic.trees$tree.stats

# The level at which each exemplar is classified for each tree is in levelout

titanic.trees$levelout

# The decision for each exemplar for each tree is in decision

titanic.trees$decision



Run the code above in your browser using DataLab