Learn R Programming

FFTrees (version 1.2.3)

plot.FFTrees: Draws a FFTrees object.

Description

The primary purpose of this function is to visualize a Fast and Frugal Tree (FFT) for data that has already been classified using the FFTrees() function. However, if the data have not yet been classified, the function can also implement a tree specified by the user. Inputs with the (M) header are manditory. If the tree has already been implimented, then only inputs with the (A) header should be entered. If the tree has not been implimented, then only inputs with the (B) header should be entered.

Usage

# S3 method for FFTrees
plot(x = NULL, data = "train", what = "tree",
  tree = "best.train", main = "Data", decision.names = c("Noise",
  "Signal"), cue.cex = NULL, threshold.cex = NULL, comp = TRUE,
  stats = TRUE, n.per.icon = NULL, which.tree = NULL, ...)

Arguments

x

A FFTrees object created from "FFTrees()"

data

Either a dataframe of new data, or one of two strings 'train' or 'test'. In this case, the corresponding dataset in the x object will be used.

what

string. What should be plotted? 'tree' (the default) shows one tree (specified by 'tree'). 'cues' shows the marginal accuracy of cues in an ROC space.

tree

integer. An integer indicating which tree to plot (only valid when the tree argument is non-empty). To plot the best training (or test) tree with respect to v (sens - spec), use "best.train" or "best.test"

main

character. The main plot label.

decision.names

character. A string vector of length 2 indicating the content-specific name for noise and signal cases.

cue.cex

numeric. A numeric vector specifying the size of the cue labels.

threshold.cex

numeric. A numeric vector specifying the size of the decision thresholds.

comp

logical. Should the performance of competitive algorithms (e.g.; logistic regression, random forests etc.) be shown in the ROC plot (if available?)

stats

logical. Should statistical information be plotted? If FALSE, then only the tree (without any reference to statistics) will be plotted.

n.per.icon

Number of exemplars per icon

which.tree

depreciated argument, only for backwards compatibility, use "tree" instead.

...

Currently ignored.

Examples

Run this code

# Create FFTrees of the heart disease data
heart.fft <- FFTrees(formula = diagnosis ~.,
data = heartdisease)

# Visualise the tree
plot(heart.fft,
     main = "Heart Disease Diagnosis",
     decision.names = c("Absent", "Present"))


# See the vignette for more details
vignette("FFTrees_plot", package = "FFTrees")



Run the code above in your browser using DataLab