How can people make good decisions based on limited, noisy information?
Nathaniel Phillips, Economic Psychology, University of Basel, Switzerland
SPUDM 2017, Haifa, Israel
How can people make good decisions based on limited, noisy information?
## Warning: package 'FFTrees' was built under R version 3.4.1
Green & Mehr (1997) "What alters physicians' decisions to admit to the coronary care unit?"
Algorithms | Software | |
---|---|---|
Standard Decision Trees | CART, C4.5, CHAID | SPSS, Excel, R, Matlab, ... |
Fast-and-Frugal Trees (FFTs) | Max, Zig-zag (Martignon et al., 2003; 2008) | ? |
Missing: An easy to use toolbox that creates and visualizes FFTs based on data.
Answer: FFTrees
If you don't like things for free (R), you can pay IBM SPSS $680 / year to make standard decision trees.
age | sex | cp | trestbps | chol | fbs | restecg | thalach | exang | oldpeak | slope | ca | thal | diagnosis |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
63 | 1 | ta | 145 | 233 | 1 | hypertrophy | 150 | 0 | 2.3 | down | 0 | fd | 0 |
67 | 1 | a | 160 | 286 | 0 | hypertrophy | 108 | 1 | 1.5 | flat | 3 | normal | 1 |
67 | 1 | a | 120 | 229 | 0 | hypertrophy | 129 | 1 | 2.6 | flat | 2 | rd | 1 |
37 | 1 | np | 130 | 250 | 0 | normal | 187 | 0 | 3.5 | down | 0 | normal | 0 |
41 | 0 | aa | 130 | 204 | 0 | hypertrophy | 172 | 0 | 1.4 | up | 0 | normal | 0 |
56 | 1 | aa | 120 | 236 | 0 | normal | 178 | 0 | 0.8 | up | 0 | normal | 0 |
# Step 1: Install and load FFTrees (v.1.3.2)
install.packages("FFTrees")
library("FFTrees")
# Step 2: Create FFTs
heart.fft <- FFTrees(formula = diagnosis ~., # Formula
data = heart.train, # Training data
data.test = heart.test, # Test data
main = "Heart Disease", # Optional labels
decision.labels = c("Low-Risk", "High-Risk"))
FFTrees
objectheart.fft
Heart Disease
7 FFTs predicting diagnosis (Low-Risk v High-Risk)
FFT #1 uses 3 cues: {thal,cp,ca}
train test
cases :n 150.00 153.00
speed :mcu 1.74 1.73
frugality :pci 0.88 0.88
accuracy :acc 0.80 0.82
weighted :wacc 0.80 0.82
sensitivity :sens 0.82 0.88
specificity :spec 0.79 0.76
pars: algorithm = 'ifan', goal = 'wacc', goal.chase = 'bacc', sens.w = 0.5
plot(heart.fft, what = "cues")
inwords(heart.fft)
[1] "If thal = {rd,fd}, predict High-Risk"
[2] "If cp != {a}, predict Low-Risk"
[3] "If ca <= 0, predict Low-Risk, otherwise, if ca > 0, predict High-Risk"
cue | definition | Possible values |
---|---|---|
thal: thallium scintigraphy | How well blood flows to the heart | normal (n)fixed defect (fd), or reversible defect (rd) |
cp: chest pain type | Type of chest pain | typical angina (ta), atypical angina (aa), non-anginal pain (np), or asymptomatic (a). |
ca: | number of major vessels colored by flourosopy | 0, 1, 2, 3 |
plot(heart.fft, stats = FALSE, data = "test")
plot(heart.fft, data = "test") # Training data
plot(heart.fft, data = "test", tree = 6) # Testing data, tree 6
plot(heart.fft, data = "test", tree = 7) # Testing data, tree 7
my.tree =
'If age > 50, predict FALSE.
If sex = {m}, predict TRUE.
If ca > 1, predict TRUE, otherwise, FALSE')
Incorporate cue costs in evaluating and/or building trees.
Create a 'forest' of FFTs
How well can simple FFTs compete with classical rational models and cutting-edge machine learning algorithms?
mean(sensitivity, specificity)
FFTrees: A toolbox to create, visualize and evaluate fast-and-frugal decision trees. (2017). Judgment and Decision Making, 12(4), 344-368.
install.packages("FFTrees") # Install FFTrees from CRAN
library("FFTrees") # Load FFTrees
FFTrees_guide() # Open the main package guide
randomForest
goal.chase
(default: balanced accuracy)goal.chase
max.levels
(default: 4)goal
(default: balanced accuracy)library("FFTrees")
a
/ \
0 b
/ \
0 1
FFTrees v1.3.2
heart.fff <- FFForest(formula = diagnosis ~., data = heartdisease)