FFTrees (version 1.4.0)

apply.tree: Applies a fast-and-frugal tree to a dataset and generates several accuracy statistics

Description

Applies a fast-and-frugal tree to a dataset and generates several accuracy statistics

Usage

apply.tree(data, formula, tree.definitions, sens.w = 0.5,
  cost.outcomes = list(hi = 0, fa = 1, mi = 1, cr = 0), cost.cues = NULL,
  allNA.pred = FALSE)

Arguments

data

dataframe. A model training dataset. An m x n dataframe containing n cue values for each of the m exemplars.

formula

A formula

tree.definitions

dataframe. Definitions of one or more trees. The dataframe must contain the columns: cues, classes, thresholds, directions, exits.

sens.w

numeric. A number from 0 to 1 indicating how to weight sensitivity relative to specificity. Only used for calculating wacc values.

cost.outcomes

list. A list of length 4 with names 'hi', 'fa', 'mi', and 'cr' specifying the costs of a hit, false alarm, miss, and correct rejection rspectively. E.g.; cost.outcomes = listc("hi" = 0, "fa" = 10, "mi" = 20, "cr" = 0) means that a false alarm and miss cost 10 and 20 respectively while correct decisions have no cost.

cost.cues

dataframe. A dataframe with two columns specifying the cost of each cue. The first column should be a vector of cue names, and the second column should be a numeric vector of costs. Cues in the dataset not present in cost.cues are assume to have 0 cost.

allNA.pred

logical. What should be predicted if all cue values in tree are NA? Default is FALSE

Value

A list of length 4 containing