Learn R Programming

⚠️There's a newer version (2.0.0) of this package.Take me there.

FFTrees

An R package to create and visualize Fast and Frugal decision trees (FFTrees) like this one below:

# Create the trees
titanic.fft <- FFTrees(formula = survived ~., 
                       data = titanic)
                       
# Plot the best tree
plot(titanic.fft,
     main = "Surviving the Titanic", 
     decision.names = c("Died", "Survived"))

Package updates

1.2.3

  • Added sens.w argument to allow differential weighting of sensitivities and specificities when selecting and applying trees.

  • Fixed but in calculating importance weightings from FFForest() outputs.

1.2.0

  • Changed wording of statistics throughout package. hr (hit rate) and far (false alarm rate) are now sens for sensitivity, and spec for specificity (1 - false alarm rate)

  • The rank.method argument is now depricated. Use algorithm instead.

  • Added stats argument to plot.FFTrees(). When stats = FALSE, only the tree will be plotted without reference to any statistical output.

  • Grouped all competitive algorithm results (regression, cart, random forests, support vector machines) to the new x.fft$comp slot rather than a separate first level list for each algorithm. Also replaced separate algorithm wrappers with one general comp.pred() wrapper function.

  • Added FFForest(), a function for creating forests of ffts, and plot.FFForest(), for visualizing forests of ffts. This function is very much still in development.

  • Added random forests and support vector machines for comparison in FFTrees() using the randomForest and e1071 packages.

  • Changed logistic regression algorithm from the default glm() version to glmnet() for a regularized version.

  • predict.FFTrees() now returns a vector of predictions for a specific tree rather than creating an entirely new FFTrees object.

  • You can now plot cue accuracies within the plot.FFTrees() function by including the plot.FFTrees(what = 'cues') argument. This replaces the former showcues() function.

  • Many cosmetic changes to plot.FFTrees() (e.g.; gray levels, more distinct classification balls). You can also control whether the results from competing algorithms are displayed or not with the comp argument.

  • Bug-fixes

    • Fixed a bug where levels with no classifications are not plotted correctly.

1.1.7

  • Trees can now use the same cue multiple times within a tree. To do this, set rank.method = "c" and repeat.cues = TRUE.

  • Bug-fixes

    • You can (and should!) now have a column of NAs for the criterion in test datasets to represent data where the criterion is unknown.
    • FFTrees() now supports a single predictor (e.g.; formula = diagnosis ~ age) which previously did not work.

1.1.6

  • Streamlined code to improve cohesion between functions. This may cause issues with FFTrees objects created with earlier versions of the package. They will need to be re-created.

  • Updated, clearer print.FFTrees() method to see important info about an FFTrees object in matrix format.

  • Training and testing statistics are now always in seperate objects (e.g.; data$train, data$test) to avoid confusion.

  • Bug-fixes

    • predict.FFTrees() now works much better by passing a new dataset (data.test) as a test dataset for an existing FFTrees object.

1.1.5

  • Bug-fixes
    • Plotting parameters mar and layout are now reset after running plot.FFTrees()

1.1.4

  • Bug-fixes
    • Plotting no longer fails when there is only one branch in the tree.
    • Changed which.tree argument in plot.FFTrees() to tree to conform to blog posts.
    • predict.FFTrees() now works better with tibble inputs.
  • Changed the fft label to FFTrees throughout the package to avoid confusion with fast fourier transform. Thus, the main tree building function is now FFTrees() and the new tree object class is FFTrees

Copy Link

Version

Install

install.packages('FFTrees')

Monthly Downloads

373

Version

1.2.3

License

CC0

Maintainer

Nathaniel Phillips

Last Published

May 4th, 2017

Functions in FFTrees (1.2.3)

car

Car acceptability data
classtable

Calculates several classification statistics from binary prediction and criterion (e.g.; truth) vectors
auc

Calculates AUC (Area under the Curve) using trapezoidal approximation
bank

A bank marketing dataset
FFTrees.guide

Opens the FFTrees package guide
apply.tree

Applies a fast and frugal tree to a dataset.
comp.pred

Wrapper for classfication algorithms
contraceptive

Contraceptive use data
blood

Blood donation dataset
breastcancer

Dataset: Physiological dataset for 699 patients tested for breast cancer.
creditapproval

Credit approval data
cuerank

Calculate the marginal accuracy of all cues in a dataframe. For each cue, the threshold that maximizes the criterion is selected.
heartdisease

Heart disease dataset
income

Income dataset
iris.v

Iris data set
mushrooms

Mushrooms dataset
forestfires

forestfires
grow.FFTrees

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

Prints summary information from an FFForest x
print.FFTrees

Prints summary information from an FFTrees x
FFForest

Creates a forest of fast and frugal decision trees
FFTrees

Creates a Fast and Frugal Trees (FFTrees) object.
predict.FFForest

Predict outcoms from a test dataset using an FFForest object
predict.FFTrees

Predict new data from an FFTrees x
plot.FFForest

Creates a network plot. Code taken from Dirk Wulff (www.dirkwulff.org)
plot.FFTrees

Draws a FFTrees object.
titanic

Titanic dataset
factclean

Does miscellaneous cleaning of prediction datasets
fertility

Fertility data set
showcues

Visualizes cue accuracies from an FFTrees object in a ROC space
sonar

Sonar data set
voting

Voting data set
wine

Wine tasting dataset
summary.FFTrees

Returns a summary of an fft object