# Create a fast-and-frugal tree (FFT) predicting heart disease
heart.fft <- FFTrees(formula = diagnosis ~.,
data = heart.train,
data.test = heart.test,
main = "Heart Disease",
decision.labels = c("Low-Risk", "High-Risk"))
# Visualize the best training tree applied to the test data
plot(heart.fft, data = "test")
A fast-and-frugal tree (FFT) to predict heart disease risk. Read the Heart Disease Tutorial vignette to learn more about how to create this FFT.
A fast-and-frugal tree (FFT) (Martignon, Vitouch, Takezawa, & Forster, 2003) is a set of hierarchical rules for making decisions based on very little information (usually 4 or fewer). Soecifically, it is a decision tree where each node has exactly two branches, where one (or in the cast of the final node, both) branches is an exit branch.
FFTs are simple, transparent decision strategies that use minimal information to make decisions (see Gigerenzer & Todd, 1999; Gigerenzer, Czerlinski, & Martignon, 1999). They are frequently preferable to more complex decision strategies (such as logistic regression) because they rarely over-fit data (Gigerenzer & Brighton, 2009) and are easy to interpret and implement in real-world decision tasks (Marewski & Gigerenzer, 2012). They have been used in real world tasks from detecting depression (Jenny, Pachur, Williams, Becker, & Margraf, 2013), to making fast decisions in emergency rooms (Green & Mehr, 1997).
The purpose of the FFTrees package is to make it easy to produce, display, and evaluate FFTs. The main function in the package is FFTrees()
which takes formula formula
and dataset data
arguments and returns several FFTs which attempt to classify training cases into criterion classes.
To get started with FFTrees, we recommend looking at the Heart Disease Tutorial. This tutorial will take you through all of the basics steps of creating, visualising, and evaluating fast-and-frugal trees.
Here is a complete list of the vignettes
Vignette Link | Description | |
---|---|---|
1 | Heart Disease Tutorial | A complete example of using FFTrees to model heart disease diagnosis |
Accuracy statistics | Definitions of accuracy statistics used throughout the package | |
2 | Creating FFTs with FFTrees() | Description of the main function FFTrees() |
FFT construction algorithms | Description of the algorithm(s) used to grow FFTs | |
Specifying FFTs directly | How to create FFTs directly using my.tree without using one of the built-in algorithms |
|
3 | Visualizing FFTs with plot() | Plotting FFTrees objects, from full trees to icon arrays |
4 | Examples of FFTs | Lots of examples of FFTs from different datasets contained in the package |
We have an article in press introducing the package in the journal Judgment and Decision Making. We encourage you to read the article to learn more about the history of FFTs and how the FFTrees package creates them.
We had a lot of fun creating FFTrees and hope you like it too! If you use FFTrees in your work, please spread the word and cite us so we can continue developing the package. You can cite the package as follows
# Cite the package
citation("FFTrees")
##
## To cite package 'FFTrees' in publications use:
##
## Nathaniel Phillips, Hansjoerg Neth, Jan Woike and Wolfgang
## Gaissmaer (2017). FFTrees: Generate, Visualise, and Evaluate
## Fast-and-Frugal Decision Trees. R package version 1.3.3.
##
## A BibTeX entry for LaTeX users is
##
## @Manual{,
## title = {FFTrees: Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees},
## author = {Nathaniel Phillips and Hansjoerg Neth and Jan Woike and Wolfgang Gaissmaer},
## year = {2017},
## note = {R package version 1.3.3},
## }
You can cite our article as follows:
Phillips, Nathaniel D., Neth, Hansjoerg, Woike, Jan K., & Gaissmaier, W. (in press). FFTrees: A toolbox to create, visualize, and evaluate fast-and-frugal decision trees. Judgment and Decision Making.
# Cite the article
@article{phillips2017FFTrees,
title={FFTrees: A toolbox to create, visualize, and evaluate fast-and-frugal decision trees},
author={Phillips, Nathaniel D. and Neth, Hansjoerg and Woike, Jan and Wolfgang, Gaissmaier},
journal={Judgment and Decision Making},
year={2017}
}
The package contains several datasets taken from the UCI Machine Learning Repository that you can use to play around with FFTrees
heartdisease
– Patients suspected of having heart disease sourcebreastcancer
– Patients suspected of having breast cancer sourcetitanic
– Passengers on the Titanicforestfires
– Forest fire statistics sourcewine
– Ratings of wine quality sourceincome
– Census data from > 30,000 US residents sourcevoting
– 1984 US congressional voting records sourceThe latest developer version of FFTrees is always at https://github.com/ndphillips/FFTrees. For comments, tips, and bug reports, please post an issue at https://github.com/ndphillips/FFTrees/issues or email me at Nathaniel.D.Phillips.is@gmail.com.
Gigerenzer, G., & Brighton, H. (2009). Homo heuristicus: Why biased minds make better inferences. Topics in Cognitive Science, 1(1), 107–143.
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.
Gigerenzer, G., Czerlinski, J., & Martignon, L. (1999). How good are fast and frugal heuristics? In Decision science and technology (pp. 81–103). Springer.
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.
Marewski, J. N., & Gigerenzer, G. (2012). Heuristic decision making in medicine. Dialogues Clin Neurosci, 14(1), 77–89.
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.