The R package FFTrees (Phillips, Neth, Woike, & Gaissmaier, 2017) makes it easy to create, visualize, and evaluate fast-and-frugal decision trees (FFTs) for solving binary classification problems in an efficient, effective, and transparent fashion.
A fast-and-frugal tree (FFT) (Martignon, Vitouch, Takezawa, & Forster, 2003) is a set of hierarchical rules for solving binary classification tasks based on very little pieces of information (usually 4 or fewer cues). In contrast to more complex decision trees, each node of an FFT has exactly two branches, where at least one branch is an exit branch (and both branches of the final nodes are exits).
FFTs are simple and effective decision strategies that use minimal information for making decisions in binary classification problems (see Gigerenzer & Todd, 1999; Gigerenzer et al., 1999). FFTs are often preferable to more complex decision strategies (such as logistic regression, LR) because they rarely over-fit data (Gigerenzer & Brighton, 2009) and are easy to interpret, implement, and communicate in real-world settings (Marewski & Gigerenzer, 2012). FFTs have been designed to tackle many real world tasks from making fast decisions in emergency rooms (Green & Mehr, 1997) to detecting depression (Jenny, Pachur, Williams, Becker, & Margraf, 2013).
Whereas their performance and success are empirical questions, a key theoretical advantage of FFTs is their transparency to decision makers and anyone aiming to understand and evaluate the details of an algorithm. In the words of Burton, Stein, & Jensen (2020), “human users could interpret, justify, control, and interact with a fast-and-frugal decision aid” (p. 229).
The FFTrees package makes it easy to produce, display, and evaluate FFTs (Phillips et al., 2017). The package’s main function is FFTrees()
which takes formula formula
and dataset data
arguments and returns several FFTs that attempt to classify training cases into criterion classes. The FFTs created can then be used to predict new data to cross-validate their performance.
Here is an example of using the main FFTrees()
function to fit FFTs to heart.train
data:
# Create a fast-and-frugal tree (FFT) predicting heart disease:
FFTrees(formula = diagnosis ~.,
heart.fft <-data = heart.train,
data.test = heart.test,
main = "Heart Disease",
decision.labels = c("Healthy", "Diseased"))
The resulting FFTrees
object heart.fft
contains 7 FFTs that were fitted to the heart.test
data. To evaluate a tree’s predictive performance, we compare its predictions for the un-trained heart.test
data with their true criterion values. Here is how we can apply the best training FFT to the heart.test
data:
# Visualize predictive performance:
plot(heart.fft, data = "test")
To begin using the FFTrees package, we recommend studying the Heart Disease Tutorial. This tutorial will take you through all of the basics steps of creating, visualizing, and evaluating fast-and-frugal trees (FFTs). The scientific background of FFTs and the development of FFTrees are described in Phillips et al. (2017) (in html | PDF). The following vignettes provide additional details and examples on specific topics.
Here is a complete list of the vignettes available in the FFTrees package:
Vignette | Description | |
---|---|---|
Main guide | An overview of the FFTrees package | |
1 | Heart Disease Tutorial | An example of using FFTrees() to model heart disease diagnosis |
2 | Accuracy statistics | Definitions of accuracy statistics used throughout the package |
3 | Creating FFTs with FFTrees() | Details on the main function FFTrees() |
4 | Specifying FFTs directly | How to directly create FFTs with my.tree without using the built-in algorithms |
5 | Visualizing FFTs with plot() | Plotting FFTrees objects, from full trees to icon arrays |
6 | Examples of FFTs | Examples of FFTs from different datasets contained in the package |
The FFTrees package contains several datasets — mostly from the UCI Machine Learning Repository — that allow you to address interesting questions when exploring FFTs:
heartdisease
– Which patients suffer from heart disease? sourcebreastcancer
– Which patients suffer from breast cancer? sourcefertility
– Which factors predict a fertile sperm concentration? sourceforestfires
– Which environmental conditions predict forest fires? sourcemushrooms
– Which features predict poisonous mushrooms? sourcetitanic
– Which passengers survived the Titanic? sourcevoting
– How did U.S. congressmen vote in 1984? sourcewine
– What determines ratings of wine quality? sourceWe had a lot of fun creating FFTrees and hope you like it too! As a comprehensive, but accessible introduction to FFTs, we recommend reading our article in the journal Judgment and Decision Making (2017, volume 12, issue 4), entitled FFTrees: A toolbox to create, visualize,and evaluate fast-and-frugal decision trees (available in html | PDF ).
Citation (in APA format):
If you use FFTrees in your own work, please cite the article and spread the word, so that we can continue developing the package.
BibTeX Citation:
@article{FFTrees,
title = {FFTrees: A toolbox to create, visualize, and evaluate fast-and-frugal decision trees},
author = {Phillips, Nathaniel D and Neth, Hansjörg and Woike, Jan K and Gaissmaier, Wolfgang},
year = 2017,
journal = {Judgment and Decision Making},
volume = 12,
number = 4,
pages = {344--368},
url = {https://journal.sjdm.org/17/17217/jdm17217.pdf}
}
The latest release of FFTrees is available at https://CRAN.R-project.org/package=FFTrees.
The latest developer version is available at https://github.com/ndphillips/FFTrees.
For comments, tips, and bug reports, please post at https://github.com/ndphillips/FFTrees/issues or contact Nathaniel at Nathaniel.D.Phillips.is@gmail.com or https://www.linkedin.com/in/nathanieldphillips/.
Burton, J. W., Stein, M.-K., & Jensen, T. B. (2020). A systematic review of algorithm aversion in augmented decision making. Journal of Behavioral Decision Making, 33(2), 220–239. https://doi.org/10.1002/bdm.2155
Gigerenzer, G., & Brighton, H. (2009). Homo heuristicus: Why biased minds make better inferences. Topics in Cognitive Science, 1(1), 107–143. https://doi.org/10.1111/j.1756-8765.2008.01006.x
Gigerenzer, G., Czerlinski, J., & Martignon, L. (1999). How good are fast and frugal heuristics? In Decision science and technology (pp. 81–103). Springer.
Gigerenzer, G., & Todd, P. M. (1999). Fast and frugal heuristics: The adaptive toolbox. In Simple heuristics that make us smart (pp. 3–34). Oxford University Press.
Green, L., & Mehr, D. R. (1997). What alters physicians’ decisions to admit to the coronary care unit? Journal of Family Practice, 45(3), 219–226.
Jenny, M. A., Pachur, T., Williams, S. L., Becker, E., & Margraf, J. (2013). Simple rules for detecting depression. Journal of Applied Research in Memory and Cognition, 2(3), 149–157. https://doi.org/10.1037/h0101797
Marewski, J. N., & Gigerenzer, G. (2012). Heuristic decision making in medicine. Dialogues Clin Neurosci, 14(1), 77–89. https://doi.org/10.31887/DCNS.2012.14.1/jmarewski
Martignon, L., Vitouch, O., Takezawa, M., & Forster, M. R. (2003). Naive and yet enlightened: From natural frequencies to fast and frugal decision trees. Thinking: Psychological Perspective on Reasoning, Judgment, and Decision Making, 189–211. https://doi.org/10.1002/047001332X.ch10
Phillips, N. D., Neth, H., Woike, J. K., & Gaissmaier, W. (2017). FFTrees: A toolbox to create, visualize, and evaluate fast-and-frugal decision trees. Judgment and Decision Making, 12(4), 344–368. Retrieved from https://journal.sjdm.org/17/17217/jdm17217.pdf