diff --git a/dev/articles/FFTrees_accuracy_statistics.html b/dev/articles/FFTrees_accuracy_statistics.html index 6a3b6aba..ec600303 100644 --- a/dev/articles/FFTrees_accuracy_statistics.html +++ b/dev/articles/FFTrees_accuracy_statistics.html @@ -72,7 +72,7 @@

Nathaniel Phillips and Hansjörg Neth

-

2024-09-04

+

2024-09-05

Source: vignettes/FFTrees_accuracy_statistics.Rmd
FFTrees_accuracy_statistics.Rmd
diff --git a/dev/articles/FFTrees_accuracy_statistics_files/figure-html/fft-plot-1-1.png b/dev/articles/FFTrees_accuracy_statistics_files/figure-html/fft-plot-1-1.png index c4efda9b..98c86366 100644 Binary files a/dev/articles/FFTrees_accuracy_statistics_files/figure-html/fft-plot-1-1.png and b/dev/articles/FFTrees_accuracy_statistics_files/figure-html/fft-plot-1-1.png differ diff --git a/dev/articles/FFTrees_examples.html b/dev/articles/FFTrees_examples.html index 8aee1bd4..9adb27b9 100644 --- a/dev/articles/FFTrees_examples.html +++ b/dev/articles/FFTrees_examples.html @@ -72,7 +72,7 @@

Nathaniel Phillips and Hansjörg Neth

-

2024-09-04

+

2024-09-05

Source: vignettes/FFTrees_examples.Rmd
FFTrees_examples.Rmd
diff --git a/dev/articles/FFTrees_examples_files/figure-html/fft-mushrooms-1-plot-1.png b/dev/articles/FFTrees_examples_files/figure-html/fft-mushrooms-1-plot-1.png index 17dc7759..e1b8b929 100644 Binary files a/dev/articles/FFTrees_examples_files/figure-html/fft-mushrooms-1-plot-1.png and b/dev/articles/FFTrees_examples_files/figure-html/fft-mushrooms-1-plot-1.png differ diff --git a/dev/articles/FFTrees_examples_files/figure-html/fft-mushrooms-2-plot-1.png b/dev/articles/FFTrees_examples_files/figure-html/fft-mushrooms-2-plot-1.png index 56fea853..84c11a04 100644 Binary files a/dev/articles/FFTrees_examples_files/figure-html/fft-mushrooms-2-plot-1.png and b/dev/articles/FFTrees_examples_files/figure-html/fft-mushrooms-2-plot-1.png differ diff --git a/dev/articles/FFTrees_examples_files/figure-html/iris-plot-fft-1.png b/dev/articles/FFTrees_examples_files/figure-html/iris-plot-fft-1.png index 9641480a..b2e7a596 100644 Binary files a/dev/articles/FFTrees_examples_files/figure-html/iris-plot-fft-1.png and b/dev/articles/FFTrees_examples_files/figure-html/iris-plot-fft-1.png differ diff --git a/dev/articles/FFTrees_examples_files/figure-html/iris-plot-fft-2-1.png b/dev/articles/FFTrees_examples_files/figure-html/iris-plot-fft-2-1.png index 1d63e7bf..4a22802e 100644 Binary files a/dev/articles/FFTrees_examples_files/figure-html/iris-plot-fft-2-1.png and b/dev/articles/FFTrees_examples_files/figure-html/iris-plot-fft-2-1.png differ diff --git a/dev/articles/FFTrees_function.html b/dev/articles/FFTrees_function.html index 90c2c115..4a79f39e 100644 --- a/dev/articles/FFTrees_function.html +++ b/dev/articles/FFTrees_function.html @@ -72,7 +72,7 @@

Nathaniel Phillips and Hansjörg Neth

-

2024-09-04

+

2024-09-05

Source: vignettes/FFTrees_function.Rmd
FFTrees_function.Rmd
diff --git a/dev/articles/FFTrees_function_files/figure-html/fft-my-tree-plot-1.png b/dev/articles/FFTrees_function_files/figure-html/fft-my-tree-plot-1.png index 3eb9bfe7..0a8a8a32 100644 Binary files a/dev/articles/FFTrees_function_files/figure-html/fft-my-tree-plot-1.png and b/dev/articles/FFTrees_function_files/figure-html/fft-my-tree-plot-1.png differ diff --git a/dev/articles/FFTrees_function_files/figure-html/fft-plot-1.png b/dev/articles/FFTrees_function_files/figure-html/fft-plot-1.png index c7d15f0b..1fba3aee 100644 Binary files a/dev/articles/FFTrees_function_files/figure-html/fft-plot-1.png and b/dev/articles/FFTrees_function_files/figure-html/fft-plot-1.png differ diff --git a/dev/articles/FFTrees_heart.html b/dev/articles/FFTrees_heart.html index e6d911fb..605d97fa 100644 --- a/dev/articles/FFTrees_heart.html +++ b/dev/articles/FFTrees_heart.html @@ -72,7 +72,7 @@

Nathaniel Phillips and Hansjörg Neth

-

2024-09-04

+

2024-09-05

Source: vignettes/FFTrees_heart.Rmd
FFTrees_heart.Rmd
diff --git a/dev/articles/FFTrees_heart_files/figure-html/fft-plot-1.png b/dev/articles/FFTrees_heart_files/figure-html/fft-plot-1.png index 94e534c3..e3211cd8 100644 Binary files a/dev/articles/FFTrees_heart_files/figure-html/fft-plot-1.png and b/dev/articles/FFTrees_heart_files/figure-html/fft-plot-1.png differ diff --git a/dev/articles/FFTrees_mytree.html b/dev/articles/FFTrees_mytree.html index 44e4d575..8ed7adc5 100644 --- a/dev/articles/FFTrees_mytree.html +++ b/dev/articles/FFTrees_mytree.html @@ -72,7 +72,7 @@

Hansjörg Neth and Nathaniel Phillips

-

2024-09-04

+

2024-09-05

Source: vignettes/FFTrees_mytree.Rmd
FFTrees_mytree.Rmd
diff --git a/dev/articles/FFTrees_mytree_files/figure-html/my-tree-plot-1-1.png b/dev/articles/FFTrees_mytree_files/figure-html/my-tree-plot-1-1.png index 5aadd7dc..9b1e8dfa 100644 Binary files a/dev/articles/FFTrees_mytree_files/figure-html/my-tree-plot-1-1.png and b/dev/articles/FFTrees_mytree_files/figure-html/my-tree-plot-1-1.png differ diff --git a/dev/articles/FFTrees_mytree_files/figure-html/my-tree-plot-fft-2-1.png b/dev/articles/FFTrees_mytree_files/figure-html/my-tree-plot-fft-2-1.png index 592562d1..a9e4fc90 100644 Binary files a/dev/articles/FFTrees_mytree_files/figure-html/my-tree-plot-fft-2-1.png and b/dev/articles/FFTrees_mytree_files/figure-html/my-tree-plot-fft-2-1.png differ diff --git a/dev/articles/FFTrees_plot.html b/dev/articles/FFTrees_plot.html index a18ab6fa..8d4a9c48 100644 --- a/dev/articles/FFTrees_plot.html +++ b/dev/articles/FFTrees_plot.html @@ -72,7 +72,7 @@

Nathaniel Phillips and Hansjörg Neth

-

2024-09-04

+

2024-09-05

Source: vignettes/FFTrees_plot.Rmd
FFTrees_plot.Rmd
diff --git a/dev/articles/FFTrees_plot_files/figure-html/titanic-args-1.png b/dev/articles/FFTrees_plot_files/figure-html/titanic-args-1.png index fc6f3656..da847ca6 100644 Binary files a/dev/articles/FFTrees_plot_files/figure-html/titanic-args-1.png and b/dev/articles/FFTrees_plot_files/figure-html/titanic-args-1.png differ diff --git a/dev/articles/FFTrees_plot_files/figure-html/titanic-plot-1.png b/dev/articles/FFTrees_plot_files/figure-html/titanic-plot-1.png index 885659bf..3b561300 100644 Binary files a/dev/articles/FFTrees_plot_files/figure-html/titanic-plot-1.png and b/dev/articles/FFTrees_plot_files/figure-html/titanic-plot-1.png differ diff --git a/dev/articles/FFTrees_plot_files/figure-html/titanic-test-1.png b/dev/articles/FFTrees_plot_files/figure-html/titanic-test-1.png index 2a8cc7a7..b36a4b4a 100644 Binary files a/dev/articles/FFTrees_plot_files/figure-html/titanic-test-1.png and b/dev/articles/FFTrees_plot_files/figure-html/titanic-test-1.png differ diff --git a/dev/articles/FFTrees_plot_files/figure-html/titanic-train-1.png b/dev/articles/FFTrees_plot_files/figure-html/titanic-train-1.png index 4493a6a1..813c2a1f 100644 Binary files a/dev/articles/FFTrees_plot_files/figure-html/titanic-train-1.png and b/dev/articles/FFTrees_plot_files/figure-html/titanic-train-1.png differ diff --git a/dev/articles/FFTrees_plot_files/figure-html/titanic-viz-2-1.png b/dev/articles/FFTrees_plot_files/figure-html/titanic-viz-2-1.png index c7dd080a..3b35927e 100644 Binary files a/dev/articles/FFTrees_plot_files/figure-html/titanic-viz-2-1.png and b/dev/articles/FFTrees_plot_files/figure-html/titanic-viz-2-1.png differ diff --git a/dev/articles/guide.html b/dev/articles/guide.html index 393723a0..6bef2fb6 100644 --- a/dev/articles/guide.html +++ b/dev/articles/guide.html @@ -72,7 +72,7 @@

Nathaniel D. Phillips and Hansjörg Neth

-

2024-09-04

+

2024-09-05

Source: vignettes/guide.Rmd
guide.Rmd
diff --git a/dev/articles/guide_files/figure-html/fig-1-1.png b/dev/articles/guide_files/figure-html/fig-1-1.png index c7ce0cde..dc2e399e 100644 Binary files a/dev/articles/guide_files/figure-html/fig-1-1.png and b/dev/articles/guide_files/figure-html/fig-1-1.png differ diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index 68c48484..8959f0c2 100644 --- a/dev/pkgdown.yml +++ b/dev/pkgdown.yml @@ -9,7 +9,7 @@ articles: FFTrees_mytree: FFTrees_mytree.html FFTrees_plot: FFTrees_plot.html guide: guide.html -last_built: 2024-09-04T10:28Z +last_built: 2024-09-05T08:27Z urls: reference: https://ndphillips.github.io/FFTrees/reference article: https://ndphillips.github.io/FFTrees/articles diff --git a/dev/reference/FFTrees-1.png b/dev/reference/FFTrees-1.png index 9c6fe56a..447873fe 100644 Binary files a/dev/reference/FFTrees-1.png and b/dev/reference/FFTrees-1.png differ diff --git a/dev/reference/FFTrees-2.png b/dev/reference/FFTrees-2.png index bb6fb379..64629d8a 100644 Binary files a/dev/reference/FFTrees-2.png and b/dev/reference/FFTrees-2.png differ diff --git a/dev/reference/FFTrees-3.png b/dev/reference/FFTrees-3.png index 06bc2fec..4e7f1dc8 100644 Binary files a/dev/reference/FFTrees-3.png and b/dev/reference/FFTrees-3.png differ diff --git a/dev/reference/FFTrees-4.png b/dev/reference/FFTrees-4.png index 483b63e0..fb48b8f1 100644 Binary files a/dev/reference/FFTrees-4.png and b/dev/reference/FFTrees-4.png differ diff --git a/dev/reference/Rplot005.png b/dev/reference/Rplot005.png index abd5cb8e..db87e0d5 100644 Binary files a/dev/reference/Rplot005.png and b/dev/reference/Rplot005.png differ diff --git a/dev/reference/plot.FFTrees-1.png b/dev/reference/plot.FFTrees-1.png index b364f42c..3774c4ec 100644 Binary files a/dev/reference/plot.FFTrees-1.png and b/dev/reference/plot.FFTrees-1.png differ diff --git a/dev/reference/plot.FFTrees-5.png b/dev/reference/plot.FFTrees-5.png index e1a5eb66..04a04aac 100644 Binary files a/dev/reference/plot.FFTrees-5.png and b/dev/reference/plot.FFTrees-5.png differ diff --git a/dev/reference/plot.FFTrees.html b/dev/reference/plot.FFTrees.html index e29ac500..6468ea90 100644 --- a/dev/reference/plot.FFTrees.html +++ b/dev/reference/plot.FFTrees.html @@ -289,7 +289,7 @@

Examples data = heart.train) #> Created an FFTrees object. #> Ranking 13 cues: ■■■■■■■■ 23% | ETA: 1s -#> Ranking 13 cues: ■■■■■■■■■■■■■■■■■■■ 62% | ETA: 0s +#> Ranking 13 cues: ■■■■■■■■■■■■■■■■■■■■■■■■■■ 85% | ETA: 0s #> Ranking 13 cues: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s #> #> Ranked 13 cues (optimizing 'bacc'). diff --git a/dev/reference/predict.FFTrees.html b/dev/reference/predict.FFTrees.html index c318b728..9ca436ea 100644 --- a/dev/reference/predict.FFTrees.html +++ b/dev/reference/predict.FFTrees.html @@ -123,9 +123,6 @@

Examples data = breast.train ) #> Created an FFTrees object. -#> Ranking 9 cues: ■■■■■■■■■■■■■■■■■■■■■■■■ 78% | ETA: 0s -#> Ranking 9 cues: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s -#> #> Ranked 9 cues (optimizing 'bacc'). #> Created 6 FFTs with 'ifan' algorithm (chasing 'bacc'). #> Defined 6 FFTs. diff --git a/dev/reference/showcues.html b/dev/reference/showcues.html index 1bf9f0bf..64921b42 100644 --- a/dev/reference/showcues.html +++ b/dev/reference/showcues.html @@ -131,6 +131,9 @@

Examples decision.labels = c("Healthy", "Diseased") ) #> Created an FFTrees object. +#> Ranking 13 cues: ■■■■■■■■ 23% | ETA: 1s +#> Ranking 13 cues: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s +#> #> Ranked 13 cues (optimizing 'bacc'). #> Created 7 FFTs with 'ifan' algorithm (chasing 'bacc'). #> Defined 7 FFTs. diff --git a/dev/search.json b/dev/search.json index cb6e9bb6..28495533 100644 --- a/dev/search.json +++ b/dev/search.json @@ -1 +1 @@ -[{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_accuracy_statistics.html","id":"accuracy-statistics-in-fftrees","dir":"Articles","previous_headings":"","what":"Accuracy Statistics in FFTrees","title":"Accuracy statistics in FFTrees","text":"vignette, cover accuracy statistics calculated FFTs FFTrees package (described Phillips et al., 2017). measures specific FFTs can used classification algorithm. First, let’s examine accuracy statistics FFT predicting heart disease: Running FFTrees() function call yields new FFTrees object heart.fft. printing plotting object particular dataset tree yields corresponding accuracy frugality statistics. now, simply plot best training tree: Figure 1: Example FFT heartdisease data. notice 2x2 table bottom-left corner plot: 2 x 2 matrix confusion table (see Wikipedia Neth et al., 2021 details). wide range accuracy measures can derived seemingly simple matrix. generic version confusion table: Figure 2: 2x2 matrix illustrating frequency counts 4 possible outcomes. 2 x 2 matrix cross-tabulates decisions algorithm (rows) actual criterion values (columns) contains counts observations four resulting cells. Counts cells  d refer correct decisions due match predicted criterion values, whereas counts cells b  c refer errors due mismatch predicted criterion values. correct decisions errors come two types: Correct decisions cell hi represent hits, positive criterion values correctly predicted positive, cell cr represents correct rejections, negative criterion values correctly predicted negative. errors, cell fa represents false alarms, negative criterion values erroneously predicted positive, cell mi represents misses, positive criterion values erroneously predicted negative. Given structure, accurate decision algorithm aims maximize frequencies cells hi  cr minimizing cells fa  mi. Table 1: Definitions frequency counts 2x2 confusion table. notation N()N() means number cases (frequency counts).","code":"# Create an FFTrees object predicting heart disease: heart.fft <- FFTrees(formula = diagnosis ~., data = heartdisease) plot(heart.fft, tree = \"best.train\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_accuracy_statistics.html","id":"conditional-accuracy-statistics","dir":"Articles","previous_headings":"Accuracy Statistics in FFTrees","what":"Conditional accuracy statistics","title":"Accuracy statistics in FFTrees","text":"first set accuracy statistics based subsets data. subsets result focusing particular cases interest computing conditional probabilities based . Given 2x2 structure confusion table, measures can conditional either algorithm decisions (positive predictive vs. negative predictive values) criterion values (sensitivity vs. specificity). words, measures conditional probabilities based either rows columns confusion table: Table 2: Conditional accuracy statistics based either rows columns 2x2 confusion table. sensitivity (aka. hit-rate) defined sens=hi/(hi+mi)sens = hi/(hi + mi) represents percentage cases positive criterion values correctly predicted algorithm. Similarly, specificity (aka. correct rejection rate, complement false alarm rate) defined spec=cr/(fa+cr)spec = cr/(fa + cr) represents percentage cases negative criterion values correctly predicted algorithm. positive-predictive value ppvppv negative predictive value npvnpv flip-sides  senssens specspec, conditional accuracies based decision outcomes (rather true criterion values).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_accuracy_statistics.html","id":"aggregate-accuracy-statistics","dir":"Articles","previous_headings":"Accuracy Statistics in FFTrees","what":"Aggregate accuracy statistics","title":"Accuracy statistics in FFTrees","text":"Additional accuracy statistics based four cells confusion table: Table 3: Aggregate accuracy statistics based four cells 2x2 confusion table. Overall accuracy (acc) defined overall percentage correct decisions ignoring difference hits correct rejections. specific measures baccbacc  waccwacc averages sensitivity specificity,  bpvbpv average predictive values. dprimedprime measure difference standardized (zz-score) transformed senssens  farfar(see Luan et al., 2011 relation FFTs signal detection theory, SDT).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_accuracy_statistics.html","id":"speed-and-frugality-statistics","dir":"Articles","previous_headings":"Accuracy Statistics in FFTrees","what":"Speed and frugality statistics","title":"Accuracy statistics in FFTrees","text":"next two statistics measure speed frugality fast--frugal tree (FFT). Unlike accuracy statistics , based confusion table. Rather, depend much information FFTs use make predictions decisions. Table 4: Measures quantify speed frugality FFTs. see exactly statistics come , let’s look results heart.fft (Tree #1): According output, Tree #1 mcu = 1.73 pci = 0.87. can easily calculate measures directly x$levelout output FFTrees object. object contains tree level (.e., node) case classified: Now, calculate mcu (mean number cues used), simply take mean vector: Now know  mcu comes , computing pci (.e., percentage cues ignored) just simple — ’s just total number cues dataset minus mcu, divided total number cues data:","code":"heart.fft #> FFTrees #> - Trees: 7 fast-and-frugal trees predicting diagnosis #> - Cost of outcomes: hi = 0, fa = 1, mi = 1, cr = 0 #> - Cost of cues: #> age sex cp trestbps chol fbs restecg thalach #> 1 1 1 1 1 1 1 1 #> exang oldpeak slope ca thal #> 1 1 1 1 1 #> #> FFT #1: Definition #> [1] If thal = {rd,fd}, decide True. #> [2] If cp != {a}, decide False. #> [3] If ca > 0, decide True, otherwise, decide False. #> #> FFT #1: Training Accuracy #> Training data: N = 303, Pos (+) = 139 (46%) #> #> | | True + | True - | Totals: #> |----------|--------|--------| #> | Decide + | hi 118 | fa 37 | 155 #> | Decide - | mi 21 | cr 127 | 148 #> |----------|--------|--------| #> Totals: 139 164 N = 303 #> #> acc = 80.9% ppv = 76.1% npv = 85.8% #> bacc = 81.2% sens = 84.9% spec = 77.4% #> #> FFT #1: Training Speed, Frugality, and Cost #> mcu = 1.73, pci = 0.87 #> cost_dec = 0.191, cost_cue = 1.733, cost = 1.924 # A vector of levels/nodes at which each case was classified: heart.fft$trees$decisions$train$tree_1$levelout #> [1] 1 3 1 2 2 2 3 3 1 1 1 2 1 1 1 2 1 3 2 2 2 2 2 1 1 2 2 2 3 1 2 1 2 1 2 3 1 #> [38] 1 1 2 1 1 2 2 3 1 2 1 2 2 2 1 3 2 1 1 1 1 2 2 1 2 1 2 1 1 2 1 1 2 2 1 1 1 #> [75] 3 2 1 2 2 1 3 3 2 1 2 2 2 2 3 2 3 1 1 2 2 1 1 1 2 3 3 2 3 2 1 1 1 1 1 1 1 #> [112] 3 1 1 1 1 2 3 1 1 1 1 2 1 2 2 1 1 2 3 1 1 2 3 2 2 1 1 1 2 2 1 2 1 1 2 1 2 #> [149] 2 2 1 3 1 1 3 3 1 1 1 1 1 3 2 3 2 1 2 2 1 2 1 1 3 3 1 1 1 1 2 2 1 1 2 1 3 #> [186] 2 1 1 1 1 2 1 1 3 2 3 2 3 2 2 3 3 1 1 1 1 1 1 2 3 2 1 2 1 3 1 2 3 3 3 2 2 #> [223] 2 1 3 2 3 2 3 3 2 3 2 2 2 3 1 1 2 2 2 2 3 2 2 3 1 3 1 2 1 1 1 2 3 2 3 2 2 #> [260] 1 2 2 2 2 3 1 3 1 1 2 1 1 1 3 2 1 2 2 2 3 1 2 1 2 1 1 1 1 1 2 1 2 1 1 3 2 #> [297] 1 1 1 1 1 2 2 # Calculate the mean number or cues used (mcu): mean(heart.fft$trees$decisions$train$tree_1$levelout) #> [1] 1.732673 # Calculate pci (percentage of cues ignored) as # (n.cues - mcu) / n.cues): n.cues <- ncol(heartdisease) (n.cues - heart.fft$trees$stats$train$mcu[1]) / n.cues #> [1] 0.8762376"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_accuracy_statistics.html","id":"additional-measures","dir":"Articles","previous_headings":"Accuracy Statistics in FFTrees","what":"Additional measures","title":"Accuracy statistics in FFTrees","text":"wide range additional measures can used quantify classification performance. can easily computed numerical information provided FFTrees object. alternative measures based frequency counts 2x2 matrix, see Table 3 Neth et al. (2021).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_accuracy_statistics.html","id":"vignettes","dir":"Articles","previous_headings":"","what":"Vignettes","title":"Accuracy statistics in FFTrees","text":"complete list vignettes available FFTrees package:","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"examples-of-ffts-with-fftrees","dir":"Articles","previous_headings":"","what":"Examples of FFTs with FFTrees","title":"Examples of FFTrees","text":"vignette illustrates construct fast--frugal trees (FFTs) additional datasets included FFTrees package. (See Phillips et al., 2017, comparison across 10 real-world datasets.)","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"mushrooms-data","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees","what":"Mushrooms data","title":"Examples of FFTrees","text":"mushrooms dataset contains data mushrooms (see ?mushrooms details). goal model predict mushrooms poisonous based 22 cues ranging mushroom’s odor, color, etc. first rows subset 10 potential predictors mushrooms data: Table 1: Binary criterion variable poisonous 10 potential predictors mushrooms data.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"creating-ffts","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees > Mushrooms data","what":"Creating FFTs","title":"Examples of FFTrees","text":"Let’s create trees using FFTrees()! ’ll use train.p = .50 argument split original data 5050% training set 5050% testing set: ’s basic information best performing FFT (Tree #1): Cool beans.","code":"# Create FFTs from the mushrooms data: set.seed(1) # for replicability of the training / test data split mushrooms_fft <- FFTrees(formula = poisonous ~., data = mushrooms, train.p = .50, # split data into 50:50 training/test subsets main = \"Mushrooms\", decision.labels = c(\"Safe\", \"Poison\")) # Print information about the best tree (during training): print(mushrooms_fft) #> Mushrooms #> FFTrees #> - Trees: 6 fast-and-frugal trees predicting poisonous #> - Cost of outcomes: hi = 0, fa = 1, mi = 1, cr = 0 #> - Cost of cues: #> cshape csurface ccolor bruises odor gattach gspace #> 1 1 1 1 1 1 1 #> gsize gcolor sshape sroot ssaring ssbring scaring #> 1 1 1 1 1 1 1 #> scbring vtype vcolor ringnum ringtype sporepc population #> 1 1 1 1 1 1 1 #> habitat #> 1 #> #> FFT #1: Definition #> [1] If odor != {f,s,y,p,c,m}, decide Safe. #> [2] If sporepc = {h,w,r}, decide Poison, otherwise, decide Safe. #> #> FFT #1: Training Accuracy #> Training data: N = 4,062, Pos (+) = 1,958 (48%) #> #> | | True + | True - | Totals: #> |----------|----------|----------| #> | Decide + | hi 1,683 | fa 0 | 1,683 #> | Decide - | mi 275 | cr 2,104 | 2,379 #> |----------|----------|----------| #> Totals: 1,958 2,104 N = 4,062 #> #> acc = 93.2% ppv = 100.0% npv = 88.4% #> bacc = 93.0% sens = 86.0% spec = 100.0% #> #> FFT #1: Training Speed, Frugality, and Cost #> mcu = 1.47, pci = 0.93 #> cost_dec = 0.068, cost_cue = 1.469, cost = 1.537"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"visualizing-cue-accuracies","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees > Mushrooms data","what":"Visualizing cue accuracies","title":"Examples of FFTrees","text":"Let’s look individual cue training accuracies plot(fft, = \"cues\"): looks like cues oder sporepc best predictors. fact, single cue odor hit rate  9797% false alarm rate nearly 00%! Based , expect final trees use just cues.","code":"# Plot the cue accuracies of an FFTrees object: plot(mushrooms_fft, what = \"cues\") #> Plotting cue training statistics: #> — Cue accuracies ranked by bacc #>"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"visualizing-fft-performance","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees > Mushrooms data","what":"Visualizing FFT performance","title":"Examples of FFTrees","text":"Now let’s plot performance best training tree applied test data: Indeed, looks like best tree uses  odor  sporepc cues. test dataset, tree false alarm rate  00% (1−1 - specificity), sensitivity (aka. hit rate)  8585%.","code":"# Plot the best FFT (for test data): plot(mushrooms_fft, data = \"test\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"trading-off-prediction-errors","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees > Mushrooms data","what":"Trading off prediction errors","title":"Examples of FFTrees","text":"considering implications predictions, fact FFT incurs many misses, false alarms, problematic: Given current task, failing detect poisonous mushrooms usually serious consequences falsely classifying poisonous. change balance possible errors, can select another tree set FFTs. case, FFT #2 use two cues, alter exit structure prediction incurs false alarms, misses. Alternatively, re-generate new set FFTs higher sensitivity weight value (e.g., increase default value  sens.w = .50  sens.w = .67) optimize FFTs’ weighted accuracy wacc.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"an-alternative-fft","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees > Mushrooms data","what":"An alternative FFT","title":"Examples of FFTrees","text":"Let’s assume famous mushroom expert insists FFT using wrong cues. According , best predictors poisonous mushrooms  ringtype  ringnum. test , build set FFTs cues check perform relative initial tree: , plot best training tree, predicting cases test dataset: can see, tree (mushrooms_ring_fft) sensitivity specificity values around 8080%, perform well earlier one (mushrooms_fft). suggests discard expert’s advice primarily rely  odor  sporepc cues.","code":"# Create trees using only the ringtype and ringnum cues: mushrooms_ring_fft <- FFTrees(formula = poisonous ~ ringtype + ringnum, data = mushrooms, train.p = .50, main = \"Mushrooms (ring cues)\", decision.labels = c(\"Safe\", \"Poison\")) # Plotting the best training FFT (for test data): plot(mushrooms_ring_fft, data = \"test\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"iris-v-data","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees","what":"Iris.v data","title":"Examples of FFTrees","text":"iris.v dataset contains data 150 flowers (see ?iris.v). goal predict flowers class Virginica. example, ’ll create trees using entire dataset (without splitting available data explicit training vs. test subsets), really fitting data, rather engaging genuine prediction: FFTrees package provides various functions inspect FFTrees object iris_fft. summary information best training tree, can print FTrees object (evaluating iris_fft print(iris_fft)). Alternatively, visualize tree (via plot(iris_fft)) summarize FFTrees object (via summary(iris_fft)): However, let’s first take look individual training cue accuracies…","code":"# Create FFTrees object for iris data: iris_fft <- FFTrees(formula = virginica ~., data = iris.v, main = \"Iris viginica\", decision.labels = c(\"Not-Vir\", \"Vir\")) # Inspect resulting FFTs: print(iris_fft) # summarize best training tree plot(iris_fft) # visualize best training tree summary(iris_fft) # summarize FFTrees object"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"visualizing-cue-accuracies-1","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees > Iris.v data","what":"Visualizing cue accuracies","title":"Examples of FFTrees","text":"can plot training cue accuracies training specifying = \"cues\": looks like two cues pet.len  pet.wid best predictors dataset. Based insight, expect final trees likely use one cues.","code":"# Plot cue values: plot(iris_fft, what = \"cues\") #> Plotting cue training statistics: #> — Cue accuracies ranked by bacc #>"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"visualizing-fft-performance-1","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees > Iris.v data","what":"Visualizing FFT performance","title":"Examples of FFTrees","text":"Now let’s visualize best tree: Indeed, turns best tree uses  pet.len  pet.wid cues (order). data, fitted tree exhibits performance sensitivity  100% specificity  94%.","code":"# Plot best FFT: plot(iris_fft)"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"viewing-alternative-ffts","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees > Iris.v data","what":"Viewing alternative FFTs","title":"Examples of FFTrees","text":"Now, tree quite well, someone wanted tree lowest possible false alarm rate? inspect ROC plot bottom right corner figure, see Tree #2 specificity close  100%. Let’s plot tree: can see, tree indeed higher specificity ( 98%), increase comes cost lower sensitivity ( 90%). trade-offs conflicting measures inevitable fitting predicting real-world data. Importantly, using FFTs FFTrees package help us render trade-offs transparent.","code":"# Plot FFT #2: plot(iris_fft, tree = 2)"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"titanic-data","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees","what":"Titanic data","title":"Examples of FFTrees","text":"examples predict people’s survival Titanic disaster (growing FFTs titanic data), see Visualizing FFTs vignette.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"vignettes","dir":"Articles","previous_headings":"","what":"Vignettes","title":"Examples of FFTrees","text":"complete list vignettes available FFTrees package:","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"details-on-the-fftrees-function","dir":"Articles","previous_headings":"","what":"Details on the FFTrees() function","title":"Creating FFTs with FFTrees()","text":"vignette starts building fast--frugal tree (FFT) heartdisease data — also used Tutorial: FFTs heart disease Phillips et al. (2017) — explores additional aspects FFTrees() function. goal FFTrees() function create FFTs data record details problem specification, tree definitions, classification process, performance measures FFTrees object. FFTrees() can handle two sets data (training vs. testing) creates range FFTs, distinct process performance characteristics, evaluating function may take time (typically seconds) structure resulting FFTrees object quite complex. FFTrees() heart FFTrees package, pays understand arguments structure  FFTrees object.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"example-predicting-heart-disease","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Example: Predicting heart disease","title":"Creating FFTs with FFTrees()","text":"FFT generally addresses binary classification problems: attempts classify outcomes criterion variable one two classes (.e., True False) based range potential predictor variables (aka. cues features). corresponding problem domain clinical diagnostics : patient heart disease, given data patients’ general health diagnostic symptoms? address problem, FFTrees package includes heartdisease data. rather using full dataset fit FFTs, split data training set (heart.train), test set (heart.test). peak corresponding data frames: critical dependent variable (binary criterion variable) diagnosis. variable indicates whether patient heart disease (diagnosis = TRUE) (diagnosis = FALSE). variables dataset (e.g., sex, age, several biological measurements) can used predictors (aka. cues).","code":"# Training data: head(heart.train) #> # A tibble: 6 × 14 #> diagnosis age sex cp trestbps chol fbs restecg thalach exang oldpeak #> #> 1 FALSE 44 0 np 108 141 0 normal 175 0 0.6 #> 2 FALSE 51 0 np 140 308 0 hypert… 142 0 1.5 #> 3 FALSE 52 1 np 138 223 0 normal 169 0 0 #> 4 TRUE 48 1 aa 110 229 0 normal 168 0 1 #> 5 FALSE 59 1 aa 140 221 0 normal 164 1 0 #> 6 FALSE 58 1 np 105 240 0 hypert… 154 1 0.6 #> # ℹ 3 more variables: slope , ca , thal # Testing data: head(heart.test) #> # A tibble: 6 × 14 #> diagnosis age sex cp trestbps chol fbs restecg thalach exang oldpeak #> #> 1 FALSE 51 0 np 120 295 0 hypert… 157 0 0.6 #> 2 TRUE 45 1 ta 110 264 0 normal 132 0 1.2 #> 3 TRUE 53 1 a 123 282 0 normal 95 1 2 #> 4 TRUE 45 1 a 142 309 0 hypert… 147 1 0 #> 5 FALSE 66 1 a 120 302 0 hypert… 151 0 0.4 #> 6 TRUE 48 1 a 130 256 1 hypert… 150 1 0 #> # ℹ 3 more variables: slope , ca , thal "},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"creating-trees-with-fftrees","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Creating trees with FFTrees()","title":"Creating FFTs with FFTrees()","text":"illustrate difference fitting prediction, train FFTs heart.train, test prediction performance heart.test. Note can also automate training / test split using train.p argument FFTrees(). Setting train.p randomly split train.p% original data training set. create set FFTs, use FFTrees() function create new FFTrees object called heart.fft. , specify diagnosis binary criterion (dependent variable), include (independent) variables formula = diagnosis ~ .: wanted consider specific variables, like sex  age, trees, specify formula = diagnosis ~ age + sex.","code":"# Create an FFTrees object called heart.fft predicting diagnosis: heart.fft <- FFTrees(formula = diagnosis ~., data = heart.train, data.test = heart.test)"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"elements-of-an-fftrees-object","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Elements of an FFTrees object","title":"Creating FFTs with FFTrees()","text":"FFTrees() function returns object FFTrees class. many elements FFTrees object. can obtain elements printing names: Inspecting elements provides wealth information range FFTs contained current FFTrees object: criterion_name: name (predicted) binary criterion variable. cue_names: names potential cue variables (predictors) data. formula: formula used create FFTrees object. trees: Information trees contained object, list elements specify number n, best tree, well tree definitions, verbal descriptions (inwords), decisions, performance characteristics (stats level_stats) FFT. data: datasets used train test FFTs (applicable). params: parameters used constructing FFTs (currently 19 parameters). competition: Models statistics alternative classification algorithms (test, train, models). cues: Information cue variables (predictors), list elements specify thresholds performance stats training FFTs.","code":"# See the elements of an FFTrees object: names(heart.fft) #> [1] \"criterion_name\" \"cue_names\" \"formula\" \"trees\" #> [5] \"data\" \"params\" \"competition\" \"cues\""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"basic-performance-characteristics-of-ffts","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Basic performance characteristics of FFTs","title":"Creating FFTs with FFTrees()","text":"can view basic information FFTrees object printing name. default tree construction algorithm ifan creates multiple trees different exit structures, FFTrees object typically contains many FFTs. printing FFTrees object, automatically see performance training data (.e., fitting, rather prediction) obtain information tree highest value goal statistic. default, goal set weighed accuracy wacc: interpreting model output, need carefully distinguish FFT’s “Training” (fitting training data) “Prediction” performance (new test data). Unless explicitly ask print(heart.fft, data = \"test\"), output printing heart.fft report fitting phase (.e., data = \"train\" default). see corresponding prediction performance, alternatively ask : evaluating FFT either training test data, obtain wide range measures. general information FFTrees object, see verbal Definition best FFT (FFT #1). Key information evaluating FFT’s performance contained Accuracy panel (either training prediction). description frequency counts corresponding statistics provided: Table 1: Description FFTs’ basic frequencies corresponding accuracy speed/frugality statistics. obtain information another FFT  FFTrees object, can call print() numeric tree parameter. instance, following expression provide basic performance characteristics Tree 3: Alternatively, visualize tree performance characteristics calling plot(heart.fft, tree = 3, data = \"test\"). See Accuracy statistics vignette details accuracy statistics used throughout FFTrees package.","code":"# Training performance of the best tree (on \"train\" data, given current goal): heart.fft # same as: print(heart.fft, data = \"train\") #> FFTrees #> - Trees: 7 fast-and-frugal trees predicting diagnosis #> - Cost of outcomes: hi = 0, fa = 1, mi = 1, cr = 0 #> - Cost of cues: #> age sex cp trestbps chol fbs restecg thalach #> 1 1 1 1 1 1 1 1 #> exang oldpeak slope ca thal #> 1 1 1 1 1 #> #> FFT #1: Definition #> [1] If thal = {rd,fd}, decide True. #> [2] If cp != {a}, decide False. #> [3] If ca > 0, decide True, otherwise, decide False. #> #> FFT #1: Training Accuracy #> Training data: N = 150, Pos (+) = 66 (44%) #> #> | | True + | True - | Totals: #> |----------|--------|--------| #> | Decide + | hi 54 | fa 18 | 72 #> | Decide - | mi 12 | cr 66 | 78 #> |----------|--------|--------| #> Totals: 66 84 N = 150 #> #> acc = 80.0% ppv = 75.0% npv = 84.6% #> bacc = 80.2% sens = 81.8% spec = 78.6% #> #> FFT #1: Training Speed, Frugality, and Cost #> mcu = 1.74, pci = 0.87 #> cost_dec = 0.200, cost_cue = 1.740, cost = 1.940 # Prediction performance of the best training tree (on \"test\" data): print(heart.fft, data = \"test\") # Performance of alternative FFTs (Tree 3) in an FFTrees object: print(heart.fft, tree = 3, data = \"test\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"cue-performance-information","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Cue performance information","title":"Creating FFTs with FFTrees()","text":"FFT decision threshold cue (regardless whether actually used tree) maximizes goal value cue applied entire training dataset. can obtain cue accuracy statistics using calculated decision thresholds cue.accuracies list. object test data, can see marginal cue accuracies test data (using thresholds calculated training data): can also visualize cue accuracies training data (ROC space, .e., showing cue’s hit rate false alarm rate) calling plot() = \"cues\" argument. show sensitivities specificities cue, top five cues highlighted listed: See Plotting FFTrees objects vignette details visualizing cue accuracies FFTs.","code":"# Decision thresholds and marginal classification training accuracies for each cue: heart.fft$cues$stats$train #> cue class threshold direction n hi fa mi cr sens #> 1 age numeric 57 > 150 38 22 28 62 0.5757576 #> 2 sex numeric 0 > 150 53 48 13 36 0.8030303 #> 3 cp character a = 150 48 18 18 66 0.7272727 #> 4 trestbps numeric 148 > 150 15 9 51 75 0.2272727 #> 5 chol numeric 273 > 150 22 17 44 67 0.3333333 #> 6 fbs numeric 0 > 150 10 9 56 75 0.1515152 #> 7 restecg character hypertrophy,abnormal = 150 40 34 26 50 0.6060606 #> 8 thalach numeric 154 <= 150 44 29 22 55 0.6666667 #> 9 exang numeric 0 > 150 31 14 35 70 0.4696970 #> 10 oldpeak numeric 0.8 > 150 41 22 25 62 0.6212121 #> 11 slope character flat,down = 150 45 27 21 57 0.6818182 #> 12 ca numeric 0 > 150 47 19 19 65 0.7121212 #> 13 thal character rd,fd = 150 47 16 19 68 0.7121212 #> spec ppv npv acc bacc wacc dprime #> 1 0.7380952 0.6333333 0.6888889 0.6666667 0.6569264 0.6569264 0.8227611 #> 2 0.4285714 0.5247525 0.7346939 0.5933333 0.6158009 0.6158009 0.6653742 #> 3 0.7857143 0.7272727 0.7857143 0.7600000 0.7564935 0.7564935 1.3853056 #> 4 0.8928571 0.6250000 0.5952381 0.6000000 0.5600649 0.5600649 0.4882880 #> 5 0.7976190 0.5641026 0.6036036 0.5933333 0.5654762 0.5654762 0.3996338 #> 6 0.8928571 0.5263158 0.5725191 0.5666667 0.5221861 0.5221861 0.2105078 #> 7 0.5952381 0.5405405 0.6578947 0.6000000 0.6006494 0.6006494 0.5065806 #> 8 0.6547619 0.6027397 0.7142857 0.6600000 0.6607143 0.6607143 0.8230087 #> 9 0.8333333 0.6888889 0.6666667 0.6733333 0.6515152 0.6515152 0.8840984 #> 10 0.7380952 0.6507937 0.7126437 0.6866667 0.6796537 0.6796537 0.9394337 #> 11 0.6785714 0.6250000 0.7307692 0.6800000 0.6801948 0.6801948 0.9297212 #> 12 0.7738095 0.7121212 0.7738095 0.7466667 0.7429654 0.7429654 1.3009993 #> 13 0.8095238 0.7460317 0.7816092 0.7666667 0.7608225 0.7608225 1.4243467 #> cost_dec cost cost_cue #> 1 -0.3333333 -1.333333 1 #> 2 -0.4066667 -1.406667 1 #> 3 -0.2400000 -1.240000 1 #> 4 -0.4000000 -1.400000 1 #> 5 -0.4066667 -1.406667 1 #> 6 -0.4333333 -1.433333 1 #> 7 -0.4000000 -1.400000 1 #> 8 -0.3400000 -1.340000 1 #> 9 -0.3266667 -1.326667 1 #> 10 -0.3133333 -1.313333 1 #> 11 -0.3200000 -1.320000 1 #> 12 -0.2533333 -1.253333 1 #> 13 -0.2333333 -1.233333 1 # Visualize individual cue accuracies: plot(heart.fft, what = \"cues\", main = \"Cue accuracy for heartdisease\") #> Plotting cue training statistics: #> — Cue accuracies ranked by bacc #>"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"tree-definitions","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Tree definitions","title":"Creating FFTs with FFTrees()","text":"tree.definitions data frame contains definitions (cues, classes, exits, thresholds, directions) trees  FFTrees object. combination five pieces information (well order), define describe tree makes decisions: Separate levels tree definitions separated colons (;). understand read definitions, let’s start understanding Tree 1, tree highest weighted accuracy training: Nodes, classes, cues: Tree 1 three cues order thal, cp, ca. classes cues  c (character), c  n (numeric). Exits, directions, thresholds: decision exits cues 1 (positive), 0 (negative),  0.5 (positive negative). means first cue makes positive decisions, second cue makes negative decisions, third cue makes positive negative decisions. decision thresholds rd fd first cue, second cue,  0 third cue. cue directions predicting criterion variable   = first cue, = second cue,   > third cue, respectively. Importantly, cue directions indicate tree make positive decisions positive exit (.e., predicted Signal) cue. tree positive exit given cue, cases satisfy threshold direction classified positive criterion value. However, tree negative exit given cue, cases satisfy given thresholds classified negative. Thus, directions cues negative exits need negated (e.g., = becomes !=, > becomes <=, etc.). information, can understand verbalize Tree 1 follows: thal equal either rd  fd, predict positive criterion value. Otherwise, cp equal  , predict negative value. Otherwise, ca greater  0, predict positive value, else predict negative value. Note heart.fft$trees$definitions also reveals Tree 3 Tree 5 use cues cue directions Tree 1. However, differ exit structures first second cues (nodes). Applying inwords() function FFTrees object returns verbal description tree. instance, obtain verbal description tree highest training accuracy (.e., Tree #1), can ask :","code":"# See the definitions of all trees: heart.fft$trees$definitions #> # A tibble: 7 × 7 #> tree nodes classes cues directions thresholds exits #> #> 1 1 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 1;0;0.5 #> 2 2 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;0;1;0.5 #> 3 3 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 0;1;0.5 #> 4 4 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;1;0;0.5 #> 5 5 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 0;0;0.5 #> 6 6 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 0;0;0;0.5 #> 7 7 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;1;1;0.5 # Describe the best training tree (i.e., Tree #1): inwords(heart.fft, tree = 1) #> [1] \"If thal = {rd,fd}, decide True.\" #> [2] \"If cp != {a}, decide False.\" #> [3] \"If ca > 0, decide True, otherwise, decide False.\""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"accuracy-statistics-of-ffts","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Accuracy statistics of FFTs","title":"Creating FFTs with FFTrees()","text":"performance FFT specific dataset characterized range accuracy statistics. training statistics trees heart.fft: corresponding statistics testing : See Accuracy statistics vignette definitions accuracy statistics used throughout FFTrees package.","code":"# Training statistics for all trees: heart.fft$trees$stats$train #> # A tibble: 7 × 20 #> tree n hi fa mi cr sens spec far ppv npv dprime #> #> 1 1 150 54 18 12 66 0.818 0.786 0.214 0.75 0.846 1.69 #> 2 2 150 57 22 9 62 0.864 0.738 0.262 0.722 0.873 1.72 #> 3 3 150 44 7 22 77 0.667 0.917 0.0833 0.863 0.778 1.79 #> 4 4 150 60 31 6 53 0.909 0.631 0.369 0.659 0.898 1.65 #> 5 5 150 28 2 38 82 0.424 0.976 0.0238 0.933 0.683 1.74 #> 6 6 150 21 1 45 83 0.318 0.988 0.0119 0.955 0.648 1.71 #> 7 7 150 64 56 2 28 0.970 0.333 0.667 0.533 0.933 1.40 #> # ℹ 8 more variables: acc , bacc , wacc , cost_dec , #> # cost_cue , cost , pci , mcu # Testing statistics for all trees: heart.fft$trees$stats$test #> # A tibble: 7 × 20 #> tree n hi fa mi cr sens spec far ppv npv dprime acc #> #> 1 1 153 64 19 9 61 0.877 0.762 0.238 0.771 0.871 1.86 0.817 #> 2 2 153 67 26 6 54 0.918 0.675 0.325 0.720 0.9 1.82 0.791 #> 3 3 153 49 8 24 72 0.671 0.9 0.1 0.860 0.75 1.71 0.791 #> 4 4 153 69 36 4 44 0.945 0.55 0.45 0.657 0.917 1.70 0.739 #> 5 5 153 28 0 45 80 0.384 1 0 1 0.64 2.44 0.706 #> 6 6 153 22 0 51 80 0.301 1 0 1 0.611 2.22 0.667 #> 7 7 153 72 56 1 24 0.986 0.3 0.7 0.562 0.96 1.60 0.627 #> # ℹ 7 more variables: bacc , wacc , cost_dec , cost_cue , #> # cost , pci , mcu "},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"classification-decisions","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Classification decisions","title":"Creating FFTs with FFTrees()","text":"decision list contains raw classification decisions tree case, well detailed information costs classification. instance, decisions made Tree 1 training data:","code":"# Inspect the decisions of Tree 1: heart.fft$trees$decisions$train$tree_1 #> # A tibble: 150 × 6 #> criterion decision levelout cost_cue cost_dec cost #> #> 1 FALSE FALSE 2 2 0 2 #> 2 FALSE FALSE 2 2 0 2 #> 3 FALSE FALSE 2 2 0 2 #> 4 TRUE TRUE 1 1 0 1 #> 5 FALSE FALSE 2 2 0 2 #> 6 FALSE TRUE 1 1 1 2 #> 7 FALSE FALSE 2 2 0 2 #> 8 TRUE TRUE 1 1 0 1 #> 9 TRUE TRUE 3 3 0 3 #> 10 FALSE FALSE 2 2 0 2 #> # ℹ 140 more rows"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"predicting-new-cases-with-predict","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Predicting new cases with predict()","title":"Creating FFTs with FFTrees()","text":"created FFTrees object, can use predict new data using predict(). First, ’ll use heart.fft object make predictions cases 1  10 heartdisease dataset. default, tree best training wacc values used predict value binary criterion variable: wanted use alternative FFT FFTrees object predicting criterion outcomes new data, specify number tree argument predict() function. predict class probabilities, can include type = \"prob\" argument. return matrix class predictions, first column indicates probabilities case classified  0 / FALSE, second column indicates probability case classified  1 / TRUE: Use type = \"\" get classification probability predictions cases:","code":"# Predict classes for new data from the best training tree: predict(heart.fft, newdata = heartdisease[1:10, ]) #> [1] TRUE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE TRUE # Predict class probabilities for new data from the best training tree: predict(heart.fft, newdata = heartdisease, type = \"prob\") #> # A tibble: 303 × 2 #> prob_0 prob_1 #> #> 1 0.262 0.738 #> 2 0.273 0.727 #> 3 0.262 0.738 #> 4 0.862 0.138 #> 5 0.862 0.138 #> 6 0.862 0.138 #> 7 0.273 0.727 #> 8 0.706 0.294 #> 9 0.262 0.738 #> 10 0.262 0.738 #> # ℹ 293 more rows # Predict both classes and probabilities: predict(heart.fft, newdata = heartdisease, type = \"both\") #> # A tibble: 303 × 3 #> class prob_0 prob_1 #> #> 1 TRUE 0.262 0.738 #> 2 TRUE 0.273 0.727 #> 3 TRUE 0.262 0.738 #> 4 FALSE 0.862 0.138 #> 5 FALSE 0.862 0.138 #> 6 FALSE 0.862 0.138 #> 7 TRUE 0.273 0.727 #> 8 FALSE 0.706 0.294 #> 9 TRUE 0.262 0.738 #> 10 TRUE 0.262 0.738 #> # ℹ 293 more rows"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"visualising-trees","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Visualising trees","title":"Creating FFTs with FFTrees()","text":"created FFTrees object using FFTrees() function can visualize tree (ROC curves) using plot() function. following code visualize best training tree applied test data: See Plotting FFTrees objects vignette details visualizing trees.","code":"plot(heart.fft, main = \"Heart Disease\", decision.labels = c(\"Healthy\", \"Disease\"))"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"manually-defining-an-fft","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Manually defining an FFT","title":"Creating FFTs with FFTrees()","text":"can also design specific FFT apply dataset using .tree argument FFTrees(). , specify FFT sentence, making sure correctly spell cue names appear data. Sets factor cues can specified using (curly) brackets. example, can manually define FFT using sentence: \"chol > 300, predict True. thal = {fd,rd}, predict False. Otherwise, predict True\" plot resulting FFT: can see, performance particular tree pretty terrible — motivate build better FFTs ! addition defining FFT verbal description, can edit define sets FFT definitions evaluate data. See Manually specifying FFTs vignette details editing, modifying, evaluating specific FFTs.","code":"# Manually define a tree using the my.tree argument: myheart_fft <- FFTrees(diagnosis ~., data = heartdisease, my.tree = \"If chol > 300, predict True. If thal = {fd,rd}, predict False. Otherwise, predict True\") plot(myheart_fft, main = \"Specifying a manual FFT\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"vignettes","dir":"Articles","previous_headings":"","what":"Vignettes","title":"Creating FFTs with FFTrees()","text":"complete list vignettes available FFTrees package:","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"tutorial-creating-ffts-for-heart-disease","dir":"Articles","previous_headings":"","what":"Tutorial: Creating FFTs for heart disease","title":"Tutorial: Creating FFTs for heart disease","text":"tutorial using FFTrees package follows examples presented Phillips et al. (2017) (freely available html | PDF): Phillips, N. D., Neth, H., Woike, J. K. & Gaissmaier, W. (2017). FFTrees: toolbox create, visualize, evaluate fast--frugal decision trees. Judgment Decision Making, 12 (4), 344–368. following, explain use FFTrees create, evaluate visualize FFTs four simple steps.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"step-1-install-and-load-the-fftrees-package","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease","what":"Step 1: Install and load the FFTrees package","title":"Tutorial: Creating FFTs for heart disease","text":"can install FFTrees CRAN using install.packages(). (need .) use package, first need load current R session. load package using library(): FFTrees package contains several vignettes guide package’s functionality (like one). open main guide, run FFTrees.guide():","code":"# Install the package from CRAN: install.packages(\"FFTrees\") # Load the package: library(FFTrees) # Open the main package guide: FFTrees.guide()"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"step-2-create-ffts-from-training-data-and-test-on-testing-data","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease","what":"Step 2: Create FFTs from training data (and test on testing data)","title":"Tutorial: Creating FFTs for heart disease","text":"example, create FFTs heart disease data set. training data object called heart.train, testing data object called heart.test. data, predict diagnosis, binary criterion indicates whether patient heart disease (.e., high-risk low-risk). create FFTrees object, use function FFTrees() two main arguments: formula expects formula indicating binary criterion variable function one predictor variable(s) considered tree. shorthand formula = diagnosis ~ . means include predictor variables. data specifies training data used construct FFTs (must include criterion variable). can construct first FFTs: Evaluating expression runs code examines data, optimizes thresholds based current goals cue, creates evaluates 7 FFTs. resulting FFTrees object contains tree definitions, decisions, performance statistics, assigned heart.fft object.","code":"# Create an FFTrees object: heart.fft <- FFTrees(formula = diagnosis ~ ., # Criterion and (all) predictors data = heart.train, # Training data data.test = heart.test, # Testing data main = \"Heart Disease\", # General label decision.labels = c(\"Low-Risk\", \"High-Risk\") # Decision labels (False/True) )"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"other-arguments","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease > Step 2: Create FFTs from training data (and test on testing data)","what":"Other arguments","title":"Tutorial: Creating FFTs for heart disease","text":"algorithm: two different algorithms available build FFTs \"ifan\" (Phillips et al., 2017) \"dfan\" (Phillips et al., 2017). (\"max\" (Martignon et al., 2008), \"zigzag\" (Martignon et al., 2008) longer supported). max.levels: Changes maximum number levels allowed tree. following arguments apply using “ifan” “dfan” algorithms creating new FFTs: goal.chase: goal.chase argument changes statistic maximized tree construction (\"ifan\" \"dfan\" algorithms). Possible arguments include \"acc\", \"bacc\", \"wacc\", \"dprime\", \"cost\". default \"wacc\" sensitivity weight  0.50 (renders identical \"bacc\"). goal: goal argument changes statistic maximized selecting trees construction (\"ifan\" \"dfan\" algorithms). Possible arguments include \"acc\", \"bacc\", \"wacc\", \"dprime\", \"cost\". .tree tree.definitions: can define new tree verbal description (set sentences), manually specify sets FFTs data frame (appropriate format). See Manually specifying FFTs vignette details.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"step-3-inspect-and-summarize-ffts","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease","what":"Step 3: Inspect and summarize FFTs","title":"Tutorial: Creating FFTs for heart disease","text":"Now can inspect summarize generated decision trees. start printing FFTrees object return basic information console: output tells us several pieces information: tree highest weighted sensitivity wacc sensitivity weight  0.5 selected best tree. , best tree, FFT #1 uses three cues: thal, cp, ca. Several summary statistics tree training test data summarized. statistics evaluate tree can derived 2 x 2 confusion table: Table 1: 2x2 confusion table illustrating types frequency counts 4 possible outcomes. definitions accuracy statistics, see accuracy statistics vignette.","code":"# Print an FFTrees object: heart.fft #> Heart Disease #> FFTrees #> - Trees: 7 fast-and-frugal trees predicting diagnosis #> - Cost of outcomes: hi = 0, fa = 1, mi = 1, cr = 0 #> - Cost of cues: #> age sex cp trestbps chol fbs restecg thalach #> 1 1 1 1 1 1 1 1 #> exang oldpeak slope ca thal #> 1 1 1 1 1 #> #> FFT #1: Definition #> [1] If thal = {rd,fd}, decide High-Risk. #> [2] If cp != {a}, decide Low-Risk. #> [3] If ca > 0, decide High-Risk, otherwise, decide Low-Risk. #> #> FFT #1: Training Accuracy #> Training data: N = 150, Pos (+) = 66 (44%) #> #> | | True + | True - | Totals: #> |----------|--------|--------| #> | Decide + | hi 54 | fa 18 | 72 #> | Decide - | mi 12 | cr 66 | 78 #> |----------|--------|--------| #> Totals: 66 84 N = 150 #> #> acc = 80.0% ppv = 75.0% npv = 84.6% #> bacc = 80.2% sens = 81.8% spec = 78.6% #> #> FFT #1: Training Speed, Frugality, and Cost #> mcu = 1.74, pci = 0.87 #> cost_dec = 0.200, cost_cue = 1.740, cost = 1.940"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"step-4-visualise-the-final-fft","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease","what":"Step 4: Visualise the final FFT","title":"Tutorial: Creating FFTs for heart disease","text":"use plot(x) visualize FFT ( FFTrees object x). Using data = \"train\" evaluates  FFT training data (fitting), whereas data = \"test\" predicts performance  FFT different dataset:","code":"# Plot predictions of the best FFT when applied to test data: plot(heart.fft, # An FFTrees object data = \"test\") # data to use (i.e., either \"train\" or \"test\")?"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"other-arguments-1","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease > Step 4: Visualise the final FFT","what":"Other arguments","title":"Tutorial: Creating FFTs for heart disease","text":"plot() function FFTrees object tree: tree object beplotted? plot tree best fitting tree (FFT #1), just specify another tree integer (e.g.; plot(heart.fft, tree = 2)). data: dataset statistics shown? Either data = \"train\" (showing fitting “Training” performance default), data = \"test\" (showing prediction “Testing” performance). stats: accuracy statistics shown tree? show tree, without performance statistics, include argument stats = FALSE. comp: statistics competitive algorithms shown ROC curve? remove performance statistics competitive algorithms (e.g.; regression, random forests), include argument comp = FALSE. : parts FFTrees object visualized (e.g., , icontree tree). Using = \"roc\" plots tree performance ROC curve. show individual cue accuracies (ROC space), specify = \"cues\": See Plotting FFTrees vignette details plotting FFTs.","code":"# Plot only the tree, without accuracy statistics: plot(heart.fft, what = \"tree\") # plot(heart.fft, stats = FALSE) # The 'stats' argument has been deprecated. # Plot cue accuracies (for training data) in ROC space: plot(heart.fft, what = \"cues\") #> Plotting cue training statistics: #> — Cue accuracies ranked by bacc #>"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"advanced-functions","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease","what":"Advanced functions","title":"Tutorial: Creating FFTs for heart disease","text":"Creating sets FFTs evaluating data printing plotting individual FFTs provides core functionality FFTrees. However, package also provides advanced functions accessing, defining, using evaluating FFTs.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"accessing-outputs","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease > Advanced functions","what":"Accessing outputs","title":"Tutorial: Creating FFTs for heart disease","text":"FFTrees object contains many different outputs. Basic performance information current data set FFTs available summary() function. see access parts FFTrees object, use str() names(): Key elements FFTrees object explained vignette Creating FFTs FFTrees().","code":"# Show the names of all outputs in heart.fft: names(heart.fft) #> [1] \"criterion_name\" \"cue_names\" \"formula\" \"trees\" #> [5] \"data\" \"params\" \"competition\" \"cues\""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"predicting-for-new-data","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease > Advanced functions","what":"Predicting for new data","title":"Tutorial: Creating FFTs for heart disease","text":"predict classification outcomes new data, use standard predict() function. example, ’s predict classifications data heartdisease object (actually just combination heart.train heart.test):","code":"# Predict classifications for a new dataset: predict(heart.fft, newdata = heartdisease)"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"directly-defining-ffts","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease > Advanced functions","what":"Directly defining FFTs","title":"Tutorial: Creating FFTs for heart disease","text":"define specific FFT apply data, can define tree providing verbal description .tree argument. Similarly, can define sets FFT definitions (data frame) evaluate data using tree.definitions argument FFTrees(). often start existing set FFTs, FFTrees provides set functions extracting, converting, modifying tree definitions. See vignette Manually specifying FFTs defining FFTs descriptions modifying tree definitions.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"vignettes","dir":"Articles","previous_headings":"","what":"Vignettes","title":"Tutorial: Creating FFTs for heart disease","text":"complete list vignettes available FFTrees package:","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"manually-specifying-ffts","dir":"Articles","previous_headings":"","what":"Manually specifying FFTs","title":"Manually specifying FFTs","text":"usually create fast--frugal trees (FFTs) data using FFTrees() function (see Main guide: FFTrees overview vignette Creating FFTs FFTrees() instructions). However, occasionally may want design evaluate specific FFTs (e.g., test hypothesis include exclude variables based theoretical considerations). two ways manually define fast--frugal trees FFTrees() function: sentence using .tree argument (easier way), data frame using tree.definitions argument (harder way). methods require data evaluate performance FFTs, bypass tree construction algorithms built FFTrees package. manually created FFTs optimized specific data, key difference fitting predicting disappears FFTs. Although can still use two sets ‘train’ vs. ‘test’ data, manually defined FFT fitted hence expected perform systematically better ‘train’ data ‘test’ data.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"using-my-tree","dir":"Articles","previous_headings":"Manually specifying FFTs","what":"1. Using my.tree","title":"Manually specifying FFTs","text":"first method manually defining FFT use .tree argument, .tree sentence describing (single) FFT. argument specified FFTrees(), function — rather auxiliary fftrees_wordstofftrees() function — attempts interpret verbal description convert valid definition FFT (part FFTrees object). example, let’s use heartdisease data find predictor variables (e.g., sex, age, etc.) predict criterion variable (diagnosis): Table 1: Five cues binary criterion variable diagnosis first cases heartdisease data. ’s verbally describe FFT using first three cues conditional sentences: see shortly, FFTrees() function accepts descriptions (assigned character string in_words) .tree argument, creates corresponding FFT, evaluates corresponding dataset.","code":"in_words <- \"If sex = 1, predict True. If age < 45, predict False. If thal = {fd, normal}, predict True. Otherwise, predict False.\""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"verbally-defining-ffts","dir":"Articles","previous_headings":"Manually specifying FFTs > 1. Using my.tree","what":"Verbally defining FFTs","title":"Manually specifying FFTs","text":"instructions manually specifying trees: node must start word “” correspond form: , predict . Numeric thresholds specified directly (without brackets), like age > 21. categorical variables, factor thresholds must specified within curly braces, like sex = {male}. factors sets values, categories within threshold separated commas like eyecolor = {blue,brown}. specify cue directions, standard logical comparisons =, !=, <, >= (etc.) valid. numeric cues, use >, >=, <,  <=. factors, use =  !=. Positive exits indicated True, negative exits specified False. final node FFT always bi-directional (.e., positive negative exit). description final node always mentions positive (True) exit first. text Otherwise, predict EXIT included example actually necessary (ignored).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"example","dir":"Articles","previous_headings":"Manually specifying FFTs > 1. Using my.tree","what":"Example","title":"Manually specifying FFTs","text":"Now, let’s use verbal description FFT (assigned in_words ) .tree argument FFTrees() function. creates corresponding FFT applies heartdisease data: Running FFTrees() .tree argument creates object my_fft contains one FFT. verbal description tree can printed inwords(my_fft), want print plot object evaluate tree’s performance training testing data. Let’s see well manually constructed FFT (my_fft) training data: Figure 1: FFT manually constructed using .tree argument FFTrees(). manually constructing tree, resulting FFTrees object contains single FFT. Hence, ROC plot (right bottom panel Figure 1) show range FFTs, locates constructed FFT ROC space. formal definition new FFT available FFTrees object my_fft: Note 2nd node FFT (using age cue) predicting noise outcome (.e., non-final exit value  0  FALSE, shown left). tree definitions always refer signal outcome (.e., non-final exit value  1  TRUE, shown right), direction symbol left exit (.e., 2nd node Figure 1: age < 45, predict 0 noise) must flipped relative appearance tree definition (age >= 45, predict 1 signal). Thus, plot formal definition describe  FFT. turns , performance first FFT created verbal description mixed affair: tree rather high sensitivity ( 91%), low specificity ( 10%) allows many false alarms. Consequently, accuracy measures fail exceed baseline level.","code":"# Create FFTrees from a verbal FFT description (as my.tree): my_fft <- FFTrees(formula = diagnosis ~., data = heartdisease, main = \"My 1st FFT\", my.tree = in_words) # Inspect FFTrees object: plot(my_fft, data = \"train\") # Get FFT definition(s): get_fft_df(my_fft) # my_fft$trees$definitions #> # A tibble: 1 × 7 #> tree nodes classes cues directions thresholds exits #> #> 1 1 3 n;n;c sex;age;thal =;>=;= 1;45;fd,normal 1;0;0.5"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"creating-an-alternative-fft","dir":"Articles","previous_headings":"Manually specifying FFTs > 1. Using my.tree","what":"Creating an alternative FFT","title":"Manually specifying FFTs","text":"Let’s see can come better FFT. following example uses cues thal, cp,  ca .tree argument: FFTrees aims interpret .tree argument best abilities, flexibility entering verbal description  FFT. instance, also described desired FFT flowery terms: However, vocabulary FFTrees limited, safer enter cue directions symbolic form (.e., using =, <, <=, >, >=,  !=).1 verify FFTrees interpreted .tree description intended, let’s check whether FFT inwords(my_fft_2) yields description corresponds wanted: seems (prosaic version ) wanted, let’s visualize tree (evaluate performance) briefly inspect tree definition: Figure 2: Another FFT manually constructed using .tree argument FFTrees(). alternative FFT nicely balancing sensitivity specificity performs much better overall. Nevertheless, still far perfect — check whether can create even better ones!","code":"# Create a 2nd FFT from an alternative FFT description (as my.tree): my_fft_2 <- FFTrees(formula = diagnosis ~., data = heartdisease, main = \"My 2nd FFT\", my.tree = \"If thal = {rd,fd}, predict True. If cp != {a}, predict False. If ca > 1, predict True. Otherwise, predict False.\") # Create a 2nd FFT from an alternative FFT description (as my.tree): my_fft_2 <- FFTrees(formula = diagnosis ~., data = heartdisease, main = \"My 2nd FFT\", my.tree = \"If thal equals {rd,fd}, we shall say True. When Cp differs from {a}, let's predict False. Whenever CA happens to exceed 1, we will insist on True. Else, we give up and go away.\") inwords(my_fft_2) #> [1] \"If thal = {rd,fd}, decide True.\" #> [2] \"If cp != {a}, decide False.\" #> [3] \"If ca > 1, decide True, otherwise, decide False.\" # Visualize FFT: plot(my_fft_2) # FFT definition: get_fft_df(my_fft_2) # my_fft_2$trees$definitions #> # A tibble: 1 × 7 #> tree nodes classes cues directions thresholds exits #> #> 1 1 3 c;c;n thal;cp;ca =;=;> rd,fd;a;1 1;0;0.5 # Note the flipped direction value for 2nd cue (exit = '0'): # 'if (cp = a), predict 1' in the tree definition corresponds to # 'if (cp != a), predict 0' in the my.tree description and plot."},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"using-tree-definitions","dir":"Articles","previous_headings":"Manually specifying FFTs","what":"2. Using tree.definitions","title":"Manually specifying FFTs","text":"experienced users may want define evaluate one FFT time. achieve , FFTrees() function allows providing sets tree.definitions (data frame). However, questions regarding specific trees usually arise later exploration FFTs, tree.definitions argument mostly used combination existing FFTrees object x. case, parameters (e.g., regarding formula, data various goals) FFTrees object x kept, object re-evaluated new set tree.definitions. FFTs simple transparent rules solving binary classification problems, neat directly manipulate evaluate rules. purpose, FFTrees provides set tree manipulation functions (see Figure 3 ). functions extract sets existing FFT definitions (x) convert individual FFT definitions manageable (“tidy”) format. functions allow edit trim FFT definitions (e.g., adding, changing, reordering removing nodes). Finally, functions allow re-convert individual FFT definitions sets definitions, collect re-evaluate data. basic workflow get, change, use FFT definitions contains five steps: Get (sets ) FFT definitions Select convert individual FFT tidy data format Manipulate FFT (e.g., changing nodes exits) Re-convert changed definition original data format Collect sets changed FFT definitions /evaluate data Conceptually, workflow boils first creating  FFT model data, manipulating model, finally re-evaluating data. tools involved workflow allow editing grammar FFTs.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"overview-retrieving-manipulating-and-using-fft-definitions","dir":"Articles","previous_headings":"Manually specifying FFTs > 2. Using tree.definitions","what":"Overview: Retrieving, manipulating, and using FFT definitions","title":"Manually specifying FFTs","text":"Figure 3: Overview 4 tree definition conversion functions (yellow)6 tree trimming functions (blue). Figure 3 provides overview functions provided converting manipulating FFT definitions. can distinguish three cycles: get_fft_df() extracts set current FFT definitions (x$trees$definitions). add_fft_df() adds one FFT definitions existing set FFT definitions. Thus, function allows collecting sets FFT definitions. tree.definitions argument main FFTrees() function allows evaluating sets FFT definitions data. read_fft_df() selects single FFT set FFT definitions converts tidy data format (data frame row represents node). write_fft_df() converts single FFT tidy data frame (1-row-per-node) 1-row-per FFT format used add_fft_df() tree.definitions argument FFTrees(). add_nodes() allows adding new nodes FFT; drop_nodes() allows deleting nodes FFT; edit_nodes() allows changing existing nodes FFT; flip_exits() allows changing exit direction existing nodes; reorder_nodes() allows changing order FFT nodes; select_nodes() allows filtering existing nodes FFT. following example illustrates interplay functions typical workflow. looking Figure 3, first move right side (retrieving sets FFT definitions manipulating individual FFTs) move left side (re-convert individual FFTs sets FFT definitions).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"example-1","dir":"Articles","previous_headings":"Manually specifying FFTs > 2. Using tree.definitions","what":"Example","title":"Manually specifying FFTs","text":"illustrate typical workflow redefining FFTs built Tutorial: FFTs heart disease evaluating (full) heartdisease data. obtain set existing tree definitions, use default algorithm create FFTrees object x: seen Tutorial, evaluating expression yields set 7 FFTs. Rather evaluating individually (e.g., using print(x) plot(x) commands inspect specific trees), now extract tree definitions select modify individual FFTs. definitions stored part FFTrees object x, achieved evaluating x$trees$definitions summary(x)$definitions. Alternatively, can use get_fft_df() utility function  x obtain set generated tree definitions: resulting R object tree_dfs data frame 7 variables. 7 rows defines FFT context current FFTrees object x (see vignette Creating FFTs FFTrees() help interpreting tree definitions). “ifan” algorithm responsible creating trees yields family highly similar FFTs (vary exits, may truncate cues), may want explore alternative versions trees. 7 FFTs defined tree_dfs share three cues thal, cp,  ca, order. Let’s assume reasons explore cue order thal, ca,  cp.","code":"# Create an FFTrees object x: x <- FFTrees(formula = diagnosis ~ ., # criterion and (all) predictors data = heart.train, # training data data.test = heart.test, # testing data main = \"Heart Disease 1\", # initial label decision.labels = c(\"low risk\", \"high risk\"), # exit labels quiet = TRUE) # hide user feedback # Get tree definitions of x: (tree_dfs <- get_fft_df(x)) #> # A tibble: 7 × 7 #> tree nodes classes cues directions thresholds exits #> #> 1 1 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 1;0;0.5 #> 2 2 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;0;1;0.5 #> 3 3 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 0;1;0.5 #> 4 4 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;1;0;0.5 #> 5 5 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 0;0;0.5 #> 6 6 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 0;0;0;0.5 #> 7 7 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;1;1;0.5"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"obtaining-individual-tree-definitions","dir":"Articles","previous_headings":"Manually specifying FFTs > 2. Using tree.definitions","what":"Obtaining individual tree definitions","title":"Manually specifying FFTs","text":"can apply tree editing functions, first select initial FFT want manipulate . job read_fft_df() (see Cycle 2 Figure 3): read_fft_df() selects FFT definition converts tidy data frame. present case, select convert tree 1: resulting R object fft_1 selected definition tree 1 converted tidy data frame. 3 rows defines node FFT. format can understood manipulated easily compact format used row 1 tree_dfs (formats can converted complementary functions read_fft_df() write_fft_df()).","code":"(fft_1 <- read_fft_df(ffts_df = tree_dfs, tree = 1)) #> class cue direction threshold exit #> 1 c thal = rd,fd 1 #> 2 c cp = a 0 #> 3 n ca > 0 0.5"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"manipulating-individual-tree-definitions","dir":"Articles","previous_headings":"Manually specifying FFTs > 2. Using tree.definitions","what":"Manipulating individual tree definitions","title":"Manually specifying FFTs","text":"selected one FFT converted tidy data frame fft_1, can use various tree trimming functions edit manipulate definition individual tree (see Cycle 3 Figure 3). Reordering nodes example, selected FFT uses cues thal, cp,  ca, wanted explore alternative cue order thal, ca,  cp. words, need swap order 2nd 3rd cues fft_1. purpose reorder_nodes() function: reorder_nodes() allows changing order FFT nodes. contrast read_fft_df() function , tree editing functions Cycle 3 require individual FFT-definition (tidy data frame) first argument fft. case reorder_nodes(), second argument order specifies numeric vector desired node positions (.e., integers  1 nrow(fft) order). Thus, swapping order 2nd 3rd nodes fft_1 achieved follows: Swapping final two nodes implies final node fft_1 (using numerical cue ca) becomes non-final cue, whereas previous middle node (using categorical cue cp) becomes final cue (see corresponding feedback message). default, previous exit cue becomes signal exit (: exit 1, .e., predicting TRUE value diagnosis criterion). Saving resulting tree definition (stored tidy data frame format fft_1)  R object my_fft_1 allow us collect modified FFTs later. Flipping exits specific exit structure mind deciding explore cue order thal, ca,  cp, explore possible exit directions. every non-final node allows two alternative exits, tree containing nn nodes 2(n−1)2^{(n-1)} exit structures (.e., 22=42^2 = 4 3 cues). 33 exit structures addition my_fft_1 can obtained flipping exit directions first, second, non-final nodes. alternative can achieved applying flip_exits() function my_fft_1: flip_exits() allows changing exit direction existing nodes. instance, tree definition signal exit first node my_fft_1 can reversed non-signal node follows:","code":"(my_fft_1 <- reorder_nodes(fft = fft_1, order = c(1, 3, 2))) #> reorder_nodes: Former exit node now is node 2 #> #> class cue direction threshold exit #> 1 c thal = rd,fd 1 #> 2 n ca > 0 1 #> 3 c cp = a 0.5 (my_fft_2 <- flip_exits(my_fft_1, nodes = 1)) #> class cue direction threshold exit #> 1 c thal = rd,fd 0 #> 2 n ca > 0 1 #> 3 c cp = a 0.5"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"using-magrittr-pipes-to-combine-steps","dir":"Articles","previous_headings":"Manually specifying FFTs > 2. Using tree.definitions","what":"Using magrittr pipes to combine steps","title":"Manually specifying FFTs","text":"tree conversion editing functions need used separately. first argument represents data object manipulated, can viewed verbs tree manipulation language chained longer command sequences using magrittr pipe operator. instance, reversing exit 2nd cue my_fft_1 achieved follows: Similarly, five steps FFTrees object x tree definition alternative exit structure my_fft_4 chained single pipe follows: evaluate four alternative tree definitions, need re-convert 1-line-per-FFT format (using write_fft_df()) gather single data frame (using add_fft_df()). Figure 3, corresponds moving upwards left (individual FFT definitions tidy data frame combining sets FFT definitions single data frame).","code":"library(magrittr) (my_fft_3 <- my_fft_1 %>% flip_exits(nodes = 2)) #> class cue direction threshold exit #> 1 c thal = rd,fd 1 #> 2 n ca > 0 0 #> 3 c cp = a 0.5 (my_fft_4 <- x %>% get_fft_df() %>% read_fft_df(tree = 1) %>% reorder_nodes(order = c(1, 3, 2)) %>% flip_exits(nodes = c(1, 2))) #> reorder_nodes: Former exit node now is node 2 #> #> class cue direction threshold exit #> 1 c thal = rd,fd 0 #> 2 n ca > 0 0 #> 3 c cp = a 0.5"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"re-converting-and-collecting-sets-of-tree-definitions","dir":"Articles","previous_headings":"Manually specifying FFTs > 2. Using tree.definitions","what":"Re-converting and collecting sets of tree definitions","title":"Manually specifying FFTs","text":"created four modified tree definitions (.e., my_fft_1 my_fft_4), now want re-convert tidy data frame (row representing FFT node) (non-tidy) data frame format (row represents entire FFT). compact format allows us gather several FFT definitions one data frame, can evaluate together data call main FFTrees() function. Figure 3, corresponding steps shown left sides Cycle 2 Cycle 1. re-convert two tree definition formats (stored data frames), use write_fft_df() function: write_fft_df() converts single FFT tidy data frame (1-row-per-node) 1-row-per FFT format used add_fft_df() tree.definitions argument FFTrees(). addition FFT definition convert (e.g., my_fft_1), tree argument allows providing numeric ID later allow us identify FFT within set: creates R object my_tree_dfs (non-tidy) data frame definition my_fft_1 occupies one row. Next, add FFT definitions my_tree_dfs data frame. can achieved add_fft_df() function: add_fft_df() adds one FFT definitions existing set FFT definitions. Thus, function allows collecting sets FFT definitions. However, first requires converting tidy FFT definitions compact 1-row-per FFT format, use series command pipes. pipe starts tidy FFT definition applies write_fft_df() ( ID) add_fft_df (my_tree_dfs), re-assigning modified data frame my_tree_dfs : resulting data frame my_tree_dfs contains 4 FFT definitions 4 rows. Per design (), differ values tree ID structures exits.","code":"(my_tree_dfs <- write_fft_df(my_fft_1, tree = 1)) #> tree nodes classes cues directions thresholds exits #> 1 1 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 1;1;0.5 my_tree_dfs <- my_fft_2 %>% write_fft_df(tree = 2) %>% add_fft_df(my_tree_dfs) my_tree_dfs <- my_fft_3 %>% write_fft_df(tree = 3) %>% add_fft_df(my_tree_dfs) my_tree_dfs <- my_fft_4 %>% write_fft_df(tree = 4) %>% add_fft_df(my_tree_dfs) my_tree_dfs #> tree nodes classes cues directions thresholds exits #> 1 1 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 1;1;0.5 #> 2 2 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 0;1;0.5 #> 3 3 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 1;0;0.5 #> 4 4 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 0;0;0.5"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"applying-sets-of-tree-definitions-to-data","dir":"Articles","previous_headings":"Manually specifying FFTs > 2. Using tree.definitions","what":"Applying sets of tree definitions to data","title":"Manually specifying FFTs","text":"edited collected set tree definitions, now can evaluate corresponding FFTs data. can providing set tree definitions (stored my_tree_dfs data frame) tree.definitions argument main FFTrees() function: tree.definitions argument main FFTrees() function allows evaluating sets FFT definitions data. using main FFTrees() function set tree.definitions (data frame line contains definition one FFT), can provide existing FFTrees object (e.g., x ). Importantly, however, input tree.definitions prevents generation new FFTs (via “ifan” “dfan” algorithms) instead evaluates FFT definitions provided data specified:2 can see feedback messages, providing FFTrees object (x) re-uses datasets, parameters, labels, unless overwritten new values. resulting FFTrees object y contains summary statistics resulting applying 4 FFT definitions my_tree_dfs datasets used create x (.e., data = heart.train data.test = heart.test). now can assess visualize performance FFTs usual ways, e.g., summary(), print() plot() functions y trees: Comparing accuracy statistics new FFTs (object y) original FFTs (object x) shows swapping 2nd 3rd cue hardly effect. Upon reflection, surprising: people still classified categories . However, evaluate costs classification (e.g., considering  pci  mcu measures cost measures cue usage), still detect differences FFTs show accuracy.","code":"# Evaluate new tree.definitions for an existing FFTrees object x: y <- FFTrees(object = x, # existing FFTrees object x tree.definitions = my_tree_dfs, # new set of FFT definitions main = \"Heart Disease 2\" # new label ) summary(y) #> Heart Disease 2 #> #> FFTrees #> - Trees: 4 fast-and-frugal trees predicting diagnosis #> - Parameters: algorithm = 'ifan', max.levels = 4, #> stopping.rule = 'exemplars', stopping.par = 0.1, #> goal = 'bacc', goal.chase = 'bacc', goal.threshold = 'bacc'. #> #> #> Table: Tree definitions. #> #> | tree| nodes|classes |cues |directions |thresholds |exits | #> |----:|-----:|:-------|:----------|:----------|:----------|:-------| #> | 1| 3|c;n;c |thal;ca;cp |=;>;= |rd,fd;0;a |1;0;0.5 | #> | 2| 3|c;n;c |thal;ca;cp |=;>;= |rd,fd;0;a |0;1;0.5 | #> | 3| 3|c;n;c |thal;ca;cp |=;>;= |rd,fd;0;a |1;1;0.5 | #> | 4| 3|c;n;c |thal;ca;cp |=;>;= |rd,fd;0;a |0;0;0.5 | #> #> #> Table: Tree statistics on training data [p(True) = 44%]. #> #> | tree| n| hi| fa| mi| cr| sens| spec| far| ppv| npv| dprime| acc| bacc| wacc| cost_dec| cost_cue| cost| pci| mcu| #> |----:|---:|--:|--:|--:|--:|----:|----:|----:|----:|----:|------:|----:|----:|----:|--------:|--------:|----:|----:|----:| #> | 1| 150| 54| 18| 12| 66| 0.82| 0.79| 0.21| 0.75| 0.85| 1.69| 0.80| 0.80| 0.80| 0.20| 1.76| 1.96| 0.86| 1.76| #> | 2| 150| 44| 7| 22| 77| 0.67| 0.92| 0.08| 0.86| 0.78| 1.79| 0.81| 0.79| 0.79| 0.19| 1.58| 1.77| 0.88| 1.58| #> | 3| 150| 63| 42| 3| 42| 0.95| 0.50| 0.50| 0.60| 0.93| 1.66| 0.70| 0.73| 0.73| 0.30| 1.98| 2.28| 0.85| 1.98| #> | 4| 150| 28| 2| 38| 82| 0.42| 0.98| 0.02| 0.93| 0.68| 1.74| 0.73| 0.70| 0.70| 0.27| 1.68| 1.95| 0.87| 1.68| #> #> #> Table: Tree statistics on test data [p(True) = 48%]. #> #> | tree| n| hi| fa| mi| cr| sens| spec| far| ppv| npv| dprime| acc| bacc| wacc| cost_dec| cost_cue| cost| pci| mcu| #> |----:|---:|--:|--:|--:|--:|----:|----:|----:|----:|----:|------:|----:|----:|----:|--------:|--------:|----:|----:|----:| #> | 1| 153| 64| 19| 9| 61| 0.88| 0.76| 0.24| 0.77| 0.87| 1.86| 0.82| 0.82| 0.82| 0.18| 1.69| 1.87| 0.87| 1.69| #> | 2| 153| 49| 8| 24| 72| 0.67| 0.90| 0.10| 0.86| 0.75| 1.71| 0.79| 0.79| 0.79| 0.21| 1.70| 1.91| 0.87| 1.70| #> | 3| 153| 70| 45| 3| 35| 0.96| 0.44| 0.56| 0.61| 0.92| 1.55| 0.69| 0.70| 0.70| 0.31| 1.90| 2.22| 0.85| 1.90| #> | 4| 153| 28| 0| 45| 80| 0.38| 1.00| 0.00| 1.00| 0.64| 2.44| 0.71| 0.69| 0.69| 0.29| 1.71| 2.01| 0.87| 1.71| # Visualize individual FFTs: # plot(y, tree = 1)"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"details","dir":"Articles","previous_headings":"Manually specifying FFTs > 2. Using tree.definitions","what":"Details","title":"Manually specifying FFTs","text":"just created new FFTrees object y using FFTrees object x set customized FFTs defined tree.definitions argument. circumvented FFT building algorithms used provided FFT definitions instead. Thus, ordinary distinction training test data longer applies context: model fitted , sets used evaluate FFTs tree.definitions data. Acknowledging , may use full dataset heartdisease, rather splitting two distinct subsets: , can evaluate performance FFTs obtaining summary, printing plotting individual FFTs FFTrees object z: Finally, mostly care comparing new FFTs automatically created ones, added new set my_tree_dfs old set (tree_dfs, obtained  x ). (e.g., using add_fft_df() function) creates superset 11 tree definitions, can evaluated together heartdisease data: Evaluating performance corresponding FFTs (e.g., summary()) shows reversing final two cues little effects accuracy (note minor differences costs, e.g., mcu).3","code":"# Create a new FFTrees object z: z <- FFTrees(formula = diagnosis ~ ., data = heartdisease, # using full dataset tree.definitions = my_tree_dfs, # new set of FFT definitions main = \"Heart Disease 3\" # new label ) # Summarize results: summary(z) # Visualize an FFT: plot(z, tree = 1) (all_fft_dfs <- add_fft_df(my_tree_dfs, tree_dfs)) #> # A tibble: 11 × 7 #> tree nodes classes cues directions thresholds exits #> #> 1 1 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 1;0;0.5 #> 2 2 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;0;1;0.5 #> 3 3 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 0;1;0.5 #> 4 4 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;1;0;0.5 #> 5 5 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 0;0;0.5 #> 6 6 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 0;0;0;0.5 #> 7 7 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;1;1;0.5 #> 8 8 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 1;1;0.5 #> 9 9 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 0;1;0.5 #> 10 10 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 1;0;0.5 #> 11 11 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 0;0;0.5 # Create a new FFTrees object a: all <- FFTrees(formula = diagnosis ~ ., data = heartdisease, # using full dataset tree.definitions = all_fft_dfs, # new set of FFT definitions main = \"Heart Disease 4\", # new label ) # Summarize results: summary(all)"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"vignettes","dir":"Articles","previous_headings":"","what":"Vignettes","title":"Manually specifying FFTs","text":"complete list vignettes available FFTrees package:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_plot.html","id":"visualizing-fftrees","dir":"Articles","previous_headings":"","what":"Visualizing FFTrees","title":"Visualising FFTs","text":"FFTrees package makes easy visualize evaluate fast--frugal trees (FFTs): Use main FFTrees() function create set FFTs (e.g., R object x type FFTrees). Visualize tree  x evaluating plot(x). two key arguments plotting tree: Whereas tree argument allows selecting different trees  x (using tree = 1 default), argument distinguishes five main types plots: plot(x, = '') visualizes tree corresponding performance statistics. also default evaluating plot(x). plot(x, = 'tree') visualizes tree diagram selected tree (without performance statistics). plot(x, = 'icontree') visualizes tree diagram selected tree icon arrays exit nodes (additional options show.iconguide n.per.icon. plot(x, = 'cues') visualizes current cue accuracies ROC space (calling showcues() function). plot(x, = 'roc') visualizes performance comparison FFTs competing algorithms ROC space. arguments plot.FFTrees() function allow customization plot (e.g., defining labels parameters, selectively hiding showing elements). following, illustrate ways creating FFTs based titanic data (included FFTrees package).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_plot.html","id":"the-titanic-data","dir":"Articles","previous_headings":"Visualizing FFTrees","what":"The Titanic data","title":"Visualising FFTs","text":"titanic dataset contains basic survival statistics Titanic passengers. passenger, know class s/traveled, well binary categories specifying age, sex, survival information. get first impression, inspect random sample cases: sample 10 observations titanic data. current goal fit FFTs dataset. essentially asks: Can use information cues class, age sex decide whether passenger survived? First, let’s create FFTrees object (called titanic.fft) titanic dataset: Note used entire titanic data (.e., 2201 cases) train titanic.fft, rather specifying train.p set aside proportion specifying dedicated data.test set predictive purposes. implies present goal fit FFTs historic data, rather create use FFTs predict new cases.","code":"set.seed(12) # reproducible randomness rcases <- sort(sample(1:nrow(titanic), 10)) # Sample of data: knitr::kable(titanic[rcases, ], caption = \"A sample of 10 observations from the `titanic` data.\") # Create FFTs for the titanic data: titanic.fft <- FFTrees(formula = survived ~., data = titanic, main = \"Surviving the Titanic\", decision.labels = c(\"Died\", \"Survived\"))"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_plot.html","id":"visualising-cue-accuracies","dir":"Articles","previous_headings":"Visualizing FFTrees","what":"Visualising cue accuracies","title":"Visualising FFTs","text":"can visualize individual cue accuracies (specifically sensitivities specificities) including = 'cues' argument within plot() function. Let’s apply function titanic.fft object see accurate cues predicting survival: Figure 1: Cue accuracies FFTs predicting survival titanic dataset. Given axes plot, good performing cues near top left corner graph (.e., exhibit low false alarm rate high hit rate). titanic data, implies none cues predicts well . best individual cue appears sex (indicated  1), followed class (2). contrast, age (3) seems pretty poor cue predicting survival (despite specificity  97%). Inspecting cue accuracies can provide valuable information constructing FFTs. provide lower bounds performance trees (combining cues worthwhile yields benefit), even poor individual cues can shine combination predictors.","code":"plot(titanic.fft, what = \"cues\", main = \"Cues predicting Titanic survival\") #> Plotting cue training statistics: #> — Cue accuracies ranked by bacc #>"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_plot.html","id":"visualizing-ffts-and-their-performance","dir":"Articles","previous_headings":"Visualizing FFTrees","what":"Visualizing FFTs and their performance","title":"Visualising FFTs","text":"visualize tree FFTrees object, use plot(). Let’s plot one trees (Tree #1, .e., best one, given current goal): Figure 2: Plotting best FFT FFTrees object. resulting plot visualizes one rtitanic.ffttreestreesn\\ possible trees thetitanic.fftobject. Astree = 1corresponds best tree given currentgoalfor selecting FFTs, plotted tree specifyingtree = ‘best.train’`. Figure 2 contains lot information three distinct panels, let’s briefly consider contents: Basic dataset information: top row plot shows basic information current dataset: population size (N) baseline frequencies two categories criterion variable. FFT classification performance: middle row shows tree (center) well many cases (: persons) classified level tree (either side). example, current tree (Tree #1  4) can understood : person female, decide survived. Otherwise, person neither first second class, decide died. Finally, person child, predict survived, otherwise decide died. Accuracy performance information: bottom row shows general performance statistics  FFT: models titanic.fft trained entire titanic dataset, fitted FFTs 2201 cases, rather setting aside data predictive purposes. panel label reflects important distinction: results fitting data (.e., data used build tree) displayed, ’ll see “Training” label. testing dataset separate one used build tree used, ’ll see “Prediction” label. bottom panel provides performance information structured three subpanels: classification table (left) shows relationship true criterion states (columns) predicted decisions (rows). abbreviations hi (hits) cr (Correct rejections) denote correct decisions; mi (misses) fa (false-alarms) denote incorrect decisions. range vertical levels (middle) show tree’s cumulative performance terms two frugality measures (mcu pci) various accuracy measures (sensitivity, specificity, accuracy, balanced accuracy (see Accuracy statistics details). Finally, plot (right) shows ROC curve comparing performance trees FFTrees object. Additionally, performance logistic regression (blue) CART (red) shown. tree plotted middle panel highlighted solid green color (.e., Figure 2 shows Tree #1).","code":"plot(titanic.fft, tree = 1)"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_plot.html","id":"additional-arguments","dir":"Articles","previous_headings":"Visualizing FFTrees","what":"Additional arguments","title":"Visualising FFTs","text":"Specifying additional arguments plot() changes various elements displayed. visualized? argument selects contents plotted: = '' (default), plot shows tree diagram range corresponding performance statistics. Using one options narrows range shown: visualize bare tree diagram (without performance statistics), specify = \"tree\" (formerly stats = FALSE). visualize tree diagram icon arrays exit nodes, specify = \"icontree\" (additional options show.iconguide n.per.icon). visualize performance comparison (different FFTs competing algorithms) ROC space, specify = \"roc\". following examples illustrate wide range corresponding plots: Figure 3: FFT diagram icon arrays exit nodes. Figure 4: Performance comparison FFTs ROC space. main options suffice, various show. arguments (.e., show.header, show.tree, show.confusion, show.levels, show.roc, show.icons, show.iconguide) allow selectively turn turn specific elements overall plot. example: Figure 5: Plotting selected elements. tree: tree want plot? FFTrees objects typically contain multiple FFTs, need indicate tree want visualize. usually specify tree show integer value, tree = 2, plot corresponding tree (.e., Tree #2) FFTrees object. Alternatively, can specify tree = \"best.train\" tree = \"best.test\" visualize best training prediction tree, respectively. selects shows tree highest goal value (e.g., weighted accuracy wacc) fitting testing data. data: data want apply tree ? can specify data = \"train\" data = \"test\" distinguish training testing dataset (available) FFTrees object. FFTrees objects contain test data, data set data = \"train\" default. data tree arguments can refer datasets used training fitting (.e., “train” “test” sets), specified consistently. instance, following command visualize best training tree titanic.fft: data = \"train\" default. However, following analog expression fail: two distinct reasons: data remains unspecified, default data = \"train\". Thus, asking tree = \"best.test\" require switching data = \"test\". crucially, titanic.fft created without test data. Hence, asking best test tree make sense — plot() show best training tree (warning).","code":"# Plot tree diagram with icon arrays: plot(titanic.fft, what = \"icontree\", n.per.icon = 50, show.iconguide = TRUE) # Plot only the performance comparison in ROC space: plot(titanic.fft, what = \"roc\") # Hide some elements of the FFT plot: plot(titanic.fft, show.icons = FALSE, # hide icons show.iconguide = FALSE, # hide icon guide show.header = FALSE # hide header ) plot(titanic.fft, tree = \"best.train\") plot(titanic.fft, tree = \"best.test\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_plot.html","id":"plotting-performance-for-new-data","dir":"Articles","previous_headings":"Visualizing FFTrees","what":"Plotting performance for new data","title":"Visualising FFTs","text":"Shifting emphasis fitting prediction, primarily need specify test data used train FFTrees object. predicting performance new dataset (e.g.; data = test.data), plotting printing functions automatically apply existing FFTrees object new data compute corresponding performance statistics (using fftrees_apply() function). However, applying existing FFTs new data, changes FFTrees object stored input object, unless (invisible) output plot.FFTrees() print.FFTrees() re-assigned object. best way fit FFTs training data evaluate test data explicitly include datasets original FFTrees() command either using data.test train.p argument. example, can repeat previous analysis, now let’s create separate training test datasets including train.p = .50 argument. split dataset 50% training set, distinct 50% testing set. (Alternatively, specify dedicated test data set using data.test argument.) best training tree applied training data: Figure 6: Plotting best FFT training data. Tree #1 best training tree — also visualized plot(titanic.pred.fft, tree = \"best.train\"). tree high specificity  92%, much lower sensitivity just 51%. overall accuracy tree’s classifications  79%, exceeds baseline, far perfect. However, can see ROC table, logistic regression (LR) perform much better, CART performed even worse Tree #1. Now let’s inspect performance tree test data: Figure 7: Plotting best FFT test data. visualized tree asking plot(titanic.pred.fft, data = \"test\", tree = \"best.test\"). Note label bottom panel now switched “Accuracy (Training)” “Accuracy (Testing)”. sensitivity specificity values decreased somewhat, typical using model (fitted training data) predicting new (test) data. Let’s visualize prediction performance Tree #2, liberal tree (.e., highest sensitivity): Figure 8: Plotting Tree #2. alternative tree better sensitivity ( 63%), overall accuracy decreased baseline level ( 67%). Whereas comparing training test performance illustrates trade-offs mere fitting genuine predictive modeling, comparing performance details various FFTs illustrates typical trade-offs model solving binary classification problems engages . Importantly, types trade-offs rendered transparent using FFTrees.","code":"set.seed(100) # for replicability of the training/test split titanic.pred.fft <- FFTrees(formula = survived ~., data = titanic, train.p = .50, # use 50% to train, 50% to test main = \"Titanic\", decision.labels = c(\"Died\", \"Survived\") ) # print(titanic.pred.fft, tree = 1) plot(titanic.pred.fft, tree = 1) # print(titanic.pred.fft, data = \"test\", tree = 1) plot(titanic.pred.fft, data = \"test\", tree = 1) plot(titanic.pred.fft, data = \"test\", tree = 2)"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_plot.html","id":"vignettes","dir":"Articles","previous_headings":"","what":"Vignettes","title":"Visualising FFTs","text":"complete list vignettes available FFTrees package:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/guide.html","id":"fast-and-frugal-trees-ffts","dir":"Articles","previous_headings":"","what":"Fast-and-Frugal Trees (FFTs)","title":"Overview: Creating FFTs with FFTrees","text":"fast--frugal tree (FFT) (Martignon et al., 2003) set hierarchical rules solving binary classification tasks based little pieces information (usually using 4 fewer cues). contrast complex decision trees, node  FFT exactly two branches. branch can either contain another cue (.e., ask another question) lead exit (.e., yield decision prediction outcome). non-final node  FFT one exit branch final node two exit branches. FFTs simple effective decision strategies use minimal information making decisions binary classification problems (Gigerenzer et al., 1999; see Gigerenzer & Todd, 1999). FFTs often preferable complex decision strategies (logistic regression, LR) rarely -fit data (Gigerenzer & Brighton, 2009) easy interpret, implement, communicate real-world settings (Marewski & Gigerenzer, 2012). FFTs designed tackle many real world tasks making fast decisions emergency rooms (Green & Mehr, 1997) detecting depression (Jenny et al., 2013). Whereas performance success empirical questions, key theoretical advantage FFTs transparency decision makers anyone aiming understand evaluate details algorithm. words Burton et al. (2020), “human users interpret, justify, control, interact fast--frugal decision aid” (p. 229).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/guide.html","id":"using-the-fftrees-package","dir":"Articles","previous_headings":"","what":"Using the FFTrees package","title":"Overview: Creating FFTs with FFTrees","text":"FFTrees package makes easy produce, display, evaluate FFTs (Phillips et al., 2017). package’s main function FFTrees() takes formula formula dataset data arguments returns several FFTs attempt classify training cases criterion classes. FFTs created can used predict new data cross-validate performance. example using main FFTrees() function fit FFTs heart.train data: resulting FFTrees object heart.fft contains 7 FFTs fitted heart.test data. evaluate tree’s predictive performance, compare predictions un-trained heart.test data true criterion values. can apply best training FFT heart.test data: fast--frugal tree (FFT) predict heart disease status.","code":"# 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(\"Healthy\", \"Diseased\")) # Visualize predictive performance: plot(heart.fft, data = \"test\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/guide.html","id":"getting-started","dir":"Articles","previous_headings":"","what":"Getting started","title":"Overview: Creating FFTs with FFTrees","text":"start using FFTrees package, recommend studying Tutorial: Creating FFTs heart disease. tutorial illustrates basics steps creating, visualizing, evaluating fast--frugal trees (FFTs). scientific background FFTs development FFTrees described Phillips et al. (2017) (doi 10.1017/S1930297500006239 | html | PDF). following vignettes provide details related topics corresponding examples.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/guide.html","id":"vignettes","dir":"Articles","previous_headings":"Getting started","what":"Vignettes","title":"Overview: Creating FFTs with FFTrees","text":"complete list vignettes available FFTrees package:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/guide.html","id":"datasets","dir":"Articles","previous_headings":"Getting started","what":"Datasets","title":"Overview: Creating FFTs with FFTrees","text":"FFTrees package contains several datasets — mostly UCI Machine Learning Repository — allow address interesting questions exploring FFTs: blood – people donate blood? source breastcancer – patients suffer breast cancer? source car – cars acceptable? source contraceptive – factors determine whether women use contraceptives? source creditapproval – factors determine creditcard approval? source fertility – factors predict fertile sperm concentration? source forestfires – environmental conditions predict forest fires? source heartdisease – patients suffer heart disease? source iris.v – iris belongs class “virginica”? source mushrooms – features predict poisonous mushrooms? source sonar – sonar signal bounce metal cylinder (rock)? source titanic – passengers survived Titanic? source voting – U.S. congressmen vote 1984? source wine – determines ratings wine quality? source","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/guide.html","id":"details-about-the-datasets","dir":"Articles","previous_headings":"Getting started > Datasets","what":"Details about the datasets","title":"Overview: Creating FFTs with FFTrees","text":"preparing data predicted FFTs, usually distinguish several (categorical numeric) predictors (binary) criterion variable. Table 1 provides basic information datasets included FFTrees package (see documentation additional details). Table 1: Key information datasets included FFTrees.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/guide.html","id":"citing-fftrees","dir":"Articles","previous_headings":"","what":"Citing FFTrees","title":"Overview: Creating FFTs with FFTrees","text":"lot fun creating FFTrees hope like ! accessible introduction FFTs, recommend reading article journal Judgment Decision Making (2017), entitled FFTrees: toolbox create, visualize, evaluate fast--frugal decision trees (available html | PDF ). Citation (APA format): Phillips, N. D., Neth, H., Woike, J. K. & Gaissmaier, W. (2017). FFTrees: toolbox create, visualize, evaluate fast--frugal decision trees. Judgment Decision Making, 12 (4), 344–368. doi 10.1017/S1930297500006239 using FFTrees work, please cite article spread word, can continue developing package. BibTeX Citation:","code":"@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}, doi = {10.1017/S1930297500006239} }"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/guide.html","id":"contact","dir":"Articles","previous_headings":"","what":"Contact","title":"Overview: Creating FFTs with FFTrees","text":"latest release FFTrees available https://CRAN.R-project.org/package=FFTrees. latest developer version available https://github.com/ndphillips/FFTrees. comments, tips, bug reports, please post https://github.com/ndphillips/FFTrees/issues contact Nathaniel Nathaniel.D.Phillips.@gmail.com https://www.linkedin.com//nathanieldphillips/.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Nathaniel Phillips. Author. Hansjoerg Neth. Author, maintainer. Jan Woike. Author. Wolfgang Gaissmaier. Author.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Phillips, N. D., Neth, H., Woike, J. K., & Gaissmaier, W. (2017). FFTrees: toolbox create, visualize, evaluate fast--frugal decision trees. Judgment Decision Making, 12 (4), 344--368. doi 10.1017/S1930297500006239","code":"@Article{, title = {FFTrees: A toolbox to create, visualize, and evaluate fast-and-frugal decision trees}, author = {Nathaniel D Phillips and Hansjörg Neth and Jan K Woike and Wolfgang Gaissmaier}, year = {2017}, journal = {Judgment and Decision Making}, volume = {12}, number = {4}, pages = {344--368}, address = {PDF at }, note = {R package (version 2.0.0, June 6, 2023)}, url = {https://CRAN.R-project.org/package=FFTrees}, doi = {10.1017/S1930297500006239}, }"},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"fftrees-2009000-","dir":"","previous_headings":"","what":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"R package FFTrees creates, visualizes evaluates fast--frugal decision trees (FFTs) solving binary classification tasks, using algorithms methods described Phillips, Neth, Woike & Gaissmaier (2017, 10.1017/S1930297500006239).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"what-are-fast-and-frugal-trees-ffts","dir":"","previous_headings":"","what":"What are fast-and-frugal trees (FFTs)?","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"Fast--frugal trees (FFTs) simple transparent decision algorithms solving binary classification problems. key feature making FFTs faster frugal decision trees every node allows making decision. predicting novel cases, performance FFTs competes complex algorithms machine learning techniques, logistic regression (LR), support-vector machines (SVM), random forests (RF). Apart faster requiring less information, FFTs tend robust overfitting, easy interpret, use, communicate.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"latest release FFTrees available CRAN https://CRAN.R-project.org/package=FFTrees: current development version can installed GitHub repository https://github.com/ndphillips/FFTrees:","code":"install.packages(\"FFTrees\") # install.packages(\"devtools\") devtools::install_github(\"ndphillips/FFTrees\", build_vignettes = TRUE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"getting-started","dir":"","previous_headings":"","what":"Getting started","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"example, let’s create FFT predicting patients’ heart disease status (Healthy vs. Disease) based heartdisease dataset included FFTrees:","code":"library(FFTrees) # load package"},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"using-data","dir":"","previous_headings":"Getting started","what":"Using data","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"heartdisease data provides medical information 303 patients examined heart disease. full data contains binary criterion variable describing true state patient split two subsets: heart.train set fitting decision trees, heart.test set testing trees. first rows columns subsets heartdisease data: heart.train (training / fitting data) describes 150 patients: Table 1: Beginning heart.train subset (using data 150 patients fitting/training FFTs). heart.test (testing / prediction data) describes 153 different patients variables: Table 2: Beginning heart.test subset (used predict diagnosis 153 new patients). challenge predict patient’s diagnosis — column logical values indicating true state patient (.e., TRUE  FALSE, based patient suffering suffering heart disease) — values potential predictors.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"questions-answered-by-ffts","dir":"","previous_headings":"Getting started","what":"Questions answered by FFTs","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"solve binary classification problems FFTs, must answer two key questions: variables use predict criterion? use combine predictor variables FFTs? created FFTs, additional questions include: accurate predictions specific FFT? costly predictions algorithm? FFTrees package answers questions creating, evaluating, visualizing FFTs.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"creating-fast-and-frugal-trees-ffts","dir":"","previous_headings":"Getting started","what":"Creating fast-and-frugal trees (FFTs)","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"use main FFTrees() function create FFTs heart.train data evaluate predictive performance heart.test data: main FFTrees() function allows creating FFTrees object heartdisease data: Evaluating FFTrees() analyzes training data, creates several FFTs, applies test data. results stored object heart_fft, can printed, plotted summarized (options selecting specific data trees). Let’s plot FFTrees object visualize tree predictive performance (test data): Figure 1: fast--frugal tree (FFT) predicting heart disease test data performance characteristics. summary trees FFTrees object key performance statistics can obtained summary(heart_fft).","code":"# Create an FFTrees object from the heartdisease data: heart_fft <- FFTrees(formula = diagnosis ~., data = heart.train, data.test = heart.test, decision.labels = c(\"Healthy\", \"Disease\")) # Plot the best tree applied to the test data: plot(heart_fft, data = \"test\", main = \"Heart Disease\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"building-ffts-from-verbal-descriptions","dir":"","previous_headings":"Getting started","what":"Building FFTs from verbal descriptions","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"FFTs simple even can create ‘words’ apply data. example, let’s create tree following three nodes evaluate performance heart.test data: sex = 1, predict Disease. age < 45, predict Healthy. thal = {fd, normal}, predict Healthy, otherwise, predict Disease. conditions can directly supplied .tree argument FFTrees(): Figure 2: FFT predicting heart disease created verbal description. performance measures (bottom panel Figure 2) show particular tree somewhat biased: nearly perfect sensitivity (.e., good identifying cases Disease) suffers low specificity (.e., performs poorly identifying Healthy cases). Expressed terms errors, my_fft incurs misses expense many false alarms. Although accuracy custom tree still exceeds data’s baseline fair amount, FFTs heart_fft (created ) strike better balance. Overall, counts “best” tree particular problem depends many factors (e.g., goal fitting vs. predicting data trade-offs maximizing accuracy vs. incorporating costs cues errors). explore range options, FFTrees package enables us design evaluate range FFTs.","code":"# Create custom FFT 'in words' and apply it to test data: # 1. Create my own FFT (from verbal description): my_fft <- FFTrees(formula = diagnosis ~., data = heart.train, data.test = heart.test, decision.labels = c(\"Healthy\", \"Disease\"), my.tree = \"If sex = 1, predict Disease. If age < 45, predict Healthy. If thal = {fd, normal}, predict Healthy, Otherwise, predict Disease.\") # 2. Plot and evaluate my custom FFT (for test data): plot(my_fft, data = \"test\", main = \"My custom FFT\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"resources","dir":"","previous_headings":"","what":"Resources","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"following versions FFTrees corresponding resources available:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"references","dir":"","previous_headings":"","what":"References","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"fun creating FFTrees package hope like ! comprehensive, yet accessible introduction FFTs, recommend article journal Judgment Decision Making (2017), entitled FFTrees: toolbox create, visualize,evaluate fast--frugal decision trees (available html | PDF ). Citation (APA format): Phillips, N. D., Neth, H., Woike, J. K. & Gaissmaier, W. (2017). FFTrees: toolbox create, visualize, evaluate fast--frugal decision trees. Judgment Decision Making, 12 (4), 344–368. doi 10.1017/S1930297500006239 encourage read article learn history FFTs FFTrees package creates, visualizes, evaluates . using FFTrees work, please cite us share experiences (e.g., GitHub) can continue developing package.  2024, 130 scientific publications used cited FFTrees (see Google Scholar full list). Examples include: Lötsch, J., Haehner, ., & Hummel, T. (2020). Machine-learning-derived rules set excludes risk Parkinson’s disease patients olfactory gustatory symptoms high accuracy. Journal Neurology, 267(2), 469–478. doi 10.1007/s00415-019-09604-6 Kagan, R., Parlee, L., Beckett, B., Hayden, J. B., Gundle, K. R., & Doung, Y. C. (2020). Radiographic parameter-driven decision tree reliably predicts aseptic mechanical failure compressive osseointegration fixation. Acta Orthopaedica, 91(2), 171–176. doi 10.1080/17453674.2020.1716295 Klement, R. J., Sonke, J. J., Allgäuer, M., Andratschke, N., Appold, S., Belderbos, J., … & Mantel, F. (2020). Correlating dose variables local tumor control stereotactic body radiotherapy early stage non-small cell lung cancer: modeling study 1500 individual treatments. International Journal Radiation Oncology * Biology * Physics. doi 10.1016/j.ijrobp.2020.03.005 Nobre, G. G., Hunink, J. E., Baruth, B., Aerts, J. C., & Ward, P. J. (2019). Translating large-scale climate variability crop production forecast Europe. Scientific Reports, 9(1), 1–13. doi 10.1038/s41598-018-38091-4 Buchinsky, F. J., Valentino, W. L., Ruszkay, N., Powell, E., Derkay, C. S., Seedat, R. Y., … & Mortelliti, . J. (2019). Age diagnosis, HPV type, strongly associated clinical course recurrent respiratory papillomatosis. PloS One, 14(6). doi 10.1371/journal.pone.0216697 [File README.Rmd last updated 2024-05-23.]","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees-package.html","id":null,"dir":"Reference","previous_headings":"","what":"FFTrees: Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees — FFTrees-package","title":"FFTrees: Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees — FFTrees-package","text":"Create, visualize, test fast--frugal decision trees (FFTs) using algorithms methods described Phillips, Neth, Woike & Gaissmaier (2017), doi:10.1017/S1930297500006239 . FFTs simple transparent decision trees solving binary classification problems. FFTs can preferable complex algorithms require little information, easy understand communicate, robust overfitting.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"FFTrees: Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees — FFTrees-package","text":"Maintainer: Hansjoerg Neth h.neth@uni.kn (ORCID) Authors: Nathaniel Phillips Nathaniel.D.Phillips.@gmail.com (ORCID) Jan Woike (ORCID) Wolfgang Gaissmaier (ORCID)","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees.guide.html","id":null,"dir":"Reference","previous_headings":"","what":"Open the FFTrees package guide — FFTrees.guide","title":"Open the FFTrees package guide — FFTrees.guide","text":"Open FFTrees package guide","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees.guide.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Open the FFTrees package guide — FFTrees.guide","text":"","code":"FFTrees.guide()"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees.guide.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Open the FFTrees package guide — FFTrees.guide","text":"return value, called side effects.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees.html","id":null,"dir":"Reference","previous_headings":"","what":"Main function to create and apply fast-and-frugal trees (FFTs) — FFTrees","title":"Main function to create and apply fast-and-frugal trees (FFTs) — FFTrees","text":"FFTrees workhorse function FFTrees package creating fast--frugal trees (FFTs). FFTs decision algorithms solving binary classification tasks, .e., predict values binary criterion variable based 1 multiple predictor variables (cues). Using FFTrees data usually generates range FFTs corresponding summary statistics (FFTrees object) can printed, plotted, examined . criterion predictor variables specified formula notation. Based settings data data.test, FFTs trained (required) training dataset (given set current goal values) evaluated (predict) (optional) test dataset. existing FFTrees object object tree.definitions provided inputs, new FFTs created. arguments provided, tree.definitions take priority FFTs existing object. Specifically, tree.definitions provided, assigned FFTs x. tree.definitions provided, existing FFTrees object object provided, trees object assigned FFTs x.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Main function to create and apply fast-and-frugal trees (FFTs) — FFTrees","text":"","code":"FFTrees( formula = NULL, data = NULL, data.test = NULL, algorithm = \"ifan\", train.p = 1, goal = NULL, goal.chase = NULL, goal.threshold = NULL, max.levels = NULL, numthresh.method = \"o\", numthresh.n = 10, repeat.cues = TRUE, stopping.rule = \"exemplars\", stopping.par = 0.1, sens.w = 0.5, cost.outcomes = NULL, cost.cues = NULL, main = NULL, decision.labels = c(\"False\", \"True\"), my.goal = NULL, my.goal.fun = NULL, my.tree = NULL, object = NULL, tree.definitions = NULL, quiet = list(ini = TRUE, fin = FALSE, mis = FALSE, set = TRUE), comp = NULL, force = NULL, rank.method = NULL, rounding = NULL, store.data = NULL, verbose = NULL, do.comp = NULL, do.cart = NULL, do.lr = NULL, do.rf = NULL, do.svm = NULL )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Main function to create and apply fast-and-frugal trees (FFTs) — FFTrees","text":"formula formula. formula specifying binary criterion variable (logical) function 1 predictor variables (cues). data data frame. dataset used training (fitting) FFTs alternative algorithms. data must contain binary criterion variable specified formula potential predictors (can categorical numeric variables). data.test data frame. optional dataset used model testing (prediction) structure data. algorithm character string. algorithm used create FFTs. Can 'ifan', 'dfan'. train.p numeric. percentage data use training data.test specified? example, train.p = .50 randomly split data 50% training set 50% test set. Default: train.p = 1 (.e., using data training). goal character string indicating statistic maximize selecting trees: \"acc\" = overall accuracy, \"bacc\" = balanced accuracy, \"wacc\" = weighted accuracy, \"dprime\" = discriminability, \"cost\" = costs (based cost.outcomes cost.cues). goal.chase character string indicating statistic maximize constructing trees: \"acc\" = overall accuracy, \"bacc\" = balanced accuracy, \"wacc\" = weighted accuracy, \"dprime\" = discriminability, \"cost\" = costs (based cost.outcomes cost.cues). goal.threshold character string indicating criterion maximize optimizing cue thresholds: \"acc\" = overall accuracy, \"bacc\" = balanced accuracy, \"wacc\" = weighted accuracy, \"dprime\" = discriminability, \"cost\" = costs (based cost.outcomes, cost.cues constant per cue). default goals set fftrees_create. max.levels integer. maximum number nodes (levels) considered FFT. combinations possible exit structures considered, larger values max.levels create larger sets FFTs. numthresh.method thresholds numeric cues determined (character)? \"o\" optimize thresholds (goal.threshold), \"m\" use median. Default: numthresh.method = \"o\". numthresh.n number numeric thresholds try (integer). Default: numthresh.n = 10. repeat.cues May cues occur multiple times within tree (logical)? Default: repeat.cues = TRUE. stopping.rule character string indicating method stop growing trees. Available options : \"exemplars\": tree grows small proportion unclassified exemplars remain; \"levels\": tree grows certain level reached; \"statdelta\": tree grows change criterion statistic goal.chase exceeds threshold level. (setting currently experimental includes first level beyond threshold. tree statistics can non-monotonic, option may yield inconsistent results.) stopping methods use stopping.par set numeric threshold value. Default: stopping.rule = \"exemplars\". stopping.par numeric. numeric parameter indicating criterion value current stopping.rule. stopping.rule \"levels\", number desired levels (integer). stopping rule \"exemplars\", smallest proportion exemplars allowed last level. stopping.rule \"statdelta\", minimum required change (goal.chase value) include level. Default: stopping.par = .10. sens.w numeric value 0 1 indicating weight sensitivity relative specificity optimizing weighted accuracy (e.g., goal = 'wacc'). Default: sens.w = .50 (.e., wacc corresponds bacc). cost.outcomes list length 4 specifying cost value one 4 possible classification outcomes. list elements must named 'hi', 'fa', 'mi', 'cr' (specifying costs hit, false alarm, miss, correct rejection, respectively) provide numeric cost value. E.g.; cost.outcomes = listc(\"hi\" = 0, \"fa\" = 10, \"mi\" = 20, \"cr\" = 0) imposes false alarm miss costs 10 20 units, respectively, correct decisions costs. cost.cues list containing cost cue (common unit). list element must name corresponding cue (.e., variable data), single (positive numeric) value. Cues data present cost.cues assumed costs (.e., cost value 0). main string. optional label dataset. Passed functions, like plot.FFTrees, print.FFTrees. decision.labels vector strings length 2 text labels negative positive decision/prediction outcomes (.e., left vs. right, noise vs. signal, 0 vs. 1, respectively, character). E.g.; decision.labels = c(\"Healthy\", \"Diseased\"). .goal name optimization measure defined .goal.fun (character string). Example: .goal = \"my_acc\" (see .goal.fun corresponding function). Default: .goal = NULL. .goal.fun definition outcome measure optimize, defined function frequency counts 4 basic classification outcomes hi, fa, mi, cr (.e., R function 4 arguments hi, fa, mi, cr). Example: .goal.fun = function(hi, fa, mi, cr){(hi + cr)/(hi + fa + mi + cr)} (.e., accuracy). Default: .goal.fun = NULL. .tree verbal description FFT, .e., \"FFT words\" (character string). example, .tree = \"age > 20, predict TRUE. sex = {m}, predict FALSE. Otherwise, predict TRUE.\". object optional existing FFTrees object. specified, new FFTs fitted, existing trees applied data data.test. formula, data data.test specified, current values object used. tree.definitions optional data.frame hard-coded FFT definitions (format x$trees$definitions FFTrees object x). specified, new FFTs fitted (.e., algorithm functions evaluating cues creating FFTs skipped). Instead, tree definitions provided used re-evaluate current FFTrees object current data. quiet list 4 logical arguments: detailed progress reports suppressed? Setting list elements FALSE helpful diagnosing errors. Default: quiet = list(ini = TRUE, fin = FALSE, mis = FALSE, set = TRUE), initial vs. final steps, missing cases, parameter settings, respectively. Providing single logical value sets elements TRUE FALSE. comp, .comp, .lr, .cart, .svm, .rf, force, rank.method, rounding, store.data, verbose Deprecated arguments (unused replaced, retired future releases).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Main function to create and apply fast-and-frugal trees (FFTs) — FFTrees","text":"FFTrees object following elements: criterion_name name binary criterion variable (character). cue_names names potential predictor variables (cues) data (character). formula formula specified creating FFTs. trees list FFTs created, details contained n, best, definitions, inwords, stats, level_stats, decisions. data original training test data (available). params list defined control parameters (e.g.; algorithm, goal, sens.w, well various thresholds, stopping rule, cost parameters). cues list cue information, details contained thresholds stats.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Main function to create and apply fast-and-frugal trees (FFTs) — FFTrees","text":"","code":"# 1. Create fast-and-frugal trees (FFTs) for heart disease: heart.fft <- FFTrees(formula = diagnosis ~ ., data = heart.train, data.test = heart.test, main = \"Heart Disease\", decision.labels = c(\"Healthy\", \"Diseased\") ) #> ✔ Created an FFTrees object. #> Ranking 13 cues: ■■■■■■■■ 23% | ETA: 1s #> Ranking 13 cues: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s #> #> ✔ Ranked 13 cues (optimizing 'bacc'). #> ✔ Created 7 FFTs with 'ifan' algorithm (chasing 'bacc'). #> ✔ Defined 7 FFTs. #> ✔ Applied 7 FFTs to 'train' data. #> ✔ Ranked 7 FFTs by 'train' data. #> ✔ Applied 7 FFTs to 'test' data. #> ✔ Expressed 7 FFTs in words. # 2. Print a summary of the result: heart.fft # same as: #> Heart Disease #> FFTrees #> - Trees: 7 fast-and-frugal trees predicting diagnosis #> - Cost of outcomes: hi = 0, fa = 1, mi = 1, cr = 0 #> - Cost of cues: #> age sex cp trestbps chol fbs restecg thalach #> 1 1 1 1 1 1 1 1 #> exang oldpeak slope ca thal #> 1 1 1 1 1 #> #> FFT #1: Definition #> [1] If thal = {rd,fd}, decide Diseased. #> [2] If cp != {a}, decide Healthy. #> [3] If ca > 0, decide Diseased, otherwise, decide Healthy. #> #> FFT #1: Training Accuracy #> Training data: N = 150, Pos (+) = 66 (44%) #> #> | | True + | True - | Totals: #> |----------|--------|--------| #> | Decide + | hi 54 | fa 18 | 72 #> | Decide - | mi 12 | cr 66 | 78 #> |----------|--------|--------| #> Totals: 66 84 N = 150 #> #> acc = 80.0% ppv = 75.0% npv = 84.6% #> bacc = 80.2% sens = 81.8% spec = 78.6% #> #> FFT #1: Training Speed, Frugality, and Cost #> mcu = 1.74, pci = 0.87 #> cost_dec = 0.200, cost_cue = 1.740, cost = 1.940 #> # print(heart.fft, data = \"train\", tree = \"best.train\") # 3. Plot an FFT applied to training data: plot(heart.fft) # same as: # plot(heart.fft, what = \"all\", data = \"train\", tree = \"best.train\") # 4. Apply FFT to (new) testing data: plot(heart.fft, data = \"test\") # predict for Tree 1 plot(heart.fft, data = \"test\", tree = 2) # predict for Tree 2 # 5. Predict classes and probabilities for new data: predict(heart.fft, newdata = heartdisease) #> ✔ Applied 7 FFTs to 'test' data. #> ✔ Generated predictions for tree 1. #> [1] TRUE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE TRUE TRUE FALSE #> [13] TRUE TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE #> [25] TRUE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE FALSE #> [37] TRUE TRUE TRUE FALSE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE #> [49] FALSE FALSE FALSE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE FALSE #> [61] TRUE FALSE TRUE FALSE TRUE TRUE FALSE TRUE TRUE FALSE FALSE TRUE #> [73] TRUE TRUE TRUE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE TRUE #> [85] FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE TRUE #> [97] TRUE TRUE FALSE FALSE FALSE FALSE TRUE FALSE TRUE TRUE TRUE TRUE #> [109] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE #> [121] TRUE TRUE FALSE TRUE FALSE FALSE TRUE TRUE FALSE FALSE TRUE TRUE #> [133] FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE #> [145] TRUE FALSE TRUE FALSE FALSE FALSE TRUE FALSE TRUE TRUE TRUE TRUE #> [157] TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE TRUE FALSE FALSE #> [169] TRUE FALSE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE FALSE FALSE #> [181] TRUE TRUE FALSE TRUE FALSE FALSE TRUE TRUE TRUE TRUE FALSE TRUE #> [193] TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE #> [205] TRUE TRUE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE TRUE TRUE #> [217] FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE #> [229] TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE #> [241] FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE TRUE TRUE #> [253] TRUE FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE #> [265] TRUE TRUE FALSE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE #> [277] FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE #> [289] TRUE FALSE TRUE FALSE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE #> [301] TRUE FALSE FALSE predict(heart.fft, newdata = heartdisease, type = \"prob\") #> ✔ Applied 7 FFTs to 'test' data. #> ✔ Generated predictions for tree 1. #> # A tibble: 303 × 2 #> prob_0 prob_1 #> #> 1 0.262 0.738 #> 2 0.273 0.727 #> 3 0.262 0.738 #> 4 0.862 0.138 #> 5 0.862 0.138 #> 6 0.862 0.138 #> 7 0.273 0.727 #> 8 0.706 0.294 #> 9 0.262 0.738 #> 10 0.262 0.738 #> # ℹ 293 more rows # 6. Create a custom tree (from verbal description) with my.tree: custom.fft <- FFTrees( formula = diagnosis ~ ., data = heartdisease, my.tree = \"If age < 50, predict False. If sex = 1, predict True. If chol > 300, predict True, otherwise predict False.\", main = \"My custom FFT\") #> ✔ Created an FFTrees object. #> ✔ Created an FFT from 'my.tree' description. #> ✔ Defined 1 FFT. #> ✔ Applied 1 FFT to 'train' data. #> ✔ Ranked 1 FFT by 'train' data. #> ✔ Expressed 1 FFT in words. # Plot the (pretty bad) custom tree: plot(custom.fft)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_fft_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Add an FFT definition to tree definitions — add_fft_df","title":"Add an FFT definition to tree definitions — add_fft_df","text":"add_fft_df adds definition(s) one FFT(s) (multi-line format FFTrees object) single FFT (tidy data frame) multi-line FFT definitions FFTrees object. add_fft_df allows collecting combining (sets ) tree definitions manipulating tree trimming functions.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_fft_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add an FFT definition to tree definitions — add_fft_df","text":"","code":"add_fft_df(fft, ffts_df = NULL, quiet = FALSE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_fft_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add an FFT definition to tree definitions — add_fft_df","text":"fft (set ) FFT definition(s) (multi-line format FFTrees object) one FFT definition (data frame tidy format, one row per node). ffts_df set FFT definitions (data frame, usually FFTrees object, suitable variable names pass verify_ffts_df. Default: ffts_df = NULL. quiet Hide feedback messages (logical)? Default: quiet = FALSE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_fft_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add an FFT definition to tree definitions — add_fft_df","text":"(set ) FFT definition(s) one line FFT definition format used FFTrees object (data frame).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_nodes.html","id":null,"dir":"Reference","previous_headings":"","what":"Add nodes to an FFT definition — add_nodes","title":"Add nodes to an FFT definition — add_nodes","text":"add_nodes allows adding one nodes existing FFT definition (tidy data frame format). add_nodes allows directly set change value(s) class, cue, direction, threshold, exit, FFT definition specified nodes. rudimentary verification plausible entries. Importantly, however, add_nodes ignorant data, values variables validated specific set data. Values nodes refer new position final FFT. Duplicate values nodes ignored (last entry used). new exit node added, exit type former final node set signal value (.e., exit_types[2]).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_nodes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add nodes to an FFT definition — add_nodes","text":"","code":"add_nodes( fft, nodes = NA, class = NA, cue = NA, direction = NA, threshold = NA, exit = NA, quiet = FALSE )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_nodes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add nodes to an FFT definition — add_nodes","text":"fft One FFT definition (data frame tidy format, one row per node). nodes FFT nodes added (integer vector). Values refer new position final FFT (.e., adding nodes fft). Default: nodes = NA. class class values nodes (character). cue cue names nodes (character). direction direction values nodes (character). threshold threshold values nodes (character). exit exit values nodes (values exit_types). quiet Hide feedback messages (logical)? Default: quiet = FALSE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_nodes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add nodes to an FFT definition — add_nodes","text":"One FFT definition (data frame tidy format, one row per node).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_stats.html","id":null,"dir":"Reference","previous_headings":"","what":"Add decision statistics to data (based on frequency counts of a 2x2 matrix of classification outcomes) — add_stats","title":"Add decision statistics to data (based on frequency counts of a 2x2 matrix of classification outcomes) — add_stats","text":"add_stats assumes input 4 essential classification outcomes (frequency counts data frame \"data\" variable names \"hi\", \"fa\", \"mi\", \"cr\") uses compute various decision accuracy measures.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_stats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add decision statistics to data (based on frequency counts of a 2x2 matrix of classification outcomes) — add_stats","text":"","code":"add_stats( data, correction = 0.25, sens.w = NULL, my.goal = NULL, my.goal.fun = NULL, cost.outcomes = NULL, cost.each = NULL )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_stats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add decision statistics to data (based on frequency counts of a 2x2 matrix of classification outcomes) — add_stats","text":"data data frame 4 frequency counts (integer values, named \"hi\", \"fa\", \"mi\", \"cr\"). correction numeric. Correction added counts calculating dprime. Default: correction = .25. sens.w numeric. Sensitivity weight (computing weighted accuracy, wacc). Default: sens.w = NULL (ensure values passed calling function). .goal Name optional, user-defined goal (character string). Default: .goal = NULL. .goal.fun User-defined goal function (4 arguments hi fa mi cr). Default: .goal.fun = NULL. cost.outcomes list. list length 4 named \"hi\", \"fa\", \"mi\", \"cr\", specifying costs hit, false alarm, miss, correct rejection, respectively. E.g.; cost.outcomes = listc(\"hi\" = 0, \"fa\" = 10, \"mi\" = 20, \"cr\" = 0) means false alarm miss cost 10 20 units, respectively, correct decisions incur costs. Default: cost.outcomes = NULL (ensure values passed calling function). cost.numeric. optional fixed cost added outputs (e.g., cost using cue). Default: cost.= NULL (ensure values passed calling function).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_stats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add decision statistics to data (based on frequency counts of a 2x2 matrix of classification outcomes) — add_stats","text":"data frame variables computed accuracy cost measures (dropping inputs).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_stats.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add decision statistics to data (based on frequency counts of a 2x2 matrix of classification outcomes) — add_stats","text":"Providing numeric values cost.(vector) cost.outcomes (named list) allows computing cost information counts corresponding classification decisions.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/blood.html","id":null,"dir":"Reference","previous_headings":"","what":"Blood donation data — blood","title":"Blood donation data — blood","text":"Data Blood Transfusion Service Center Hsin-Chu City Taiwan.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/blood.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Blood donation data — blood","text":"","code":"blood"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/blood.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Blood donation data — blood","text":"data frame containing 748 rows 5 columns. recency Months since last donation frequency Total number donations total Total blood donated (c.c.) time Months since first donation donation.crit Criterion: person donate blood (March 2007)? Values: 0/vs. 1/yes (76.2% vs.\\ 23.8%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/blood.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Blood donation data — blood","text":"https://archive.ics.uci.edu/ml/datasets/Blood+Transfusion+Service+Center Original owner donor: Prof. -Cheng Yeh Department Information Management Chung-Hua University","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/breastcancer.html","id":null,"dir":"Reference","previous_headings":"","what":"Breast cancer data — breastcancer","title":"Breast cancer data — breastcancer","text":"Physiological data patients tested breast cancer.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/breastcancer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Breast cancer data — breastcancer","text":"","code":"breastcancer"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/breastcancer.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Breast cancer data — breastcancer","text":"data frame containing 699 patients (rows) 9 variables (columns). thickness Clump Thickness cellsize.unif Uniformity Cell Size cellshape.unif Uniformity Cell Shape adhesion Marginal Adhesion epithelial Single Epithelial Cell Size nuclei.bare Bare Nuclei chromatin Bland Chromatin nucleoli Normal Nucleoli mitoses Mitoses diagnosis Criterion: Absence/presence breast cancer. Values: FALSE vs. TRUE (65.0% vs.\\ 35.0%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/breastcancer.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Breast cancer data — breastcancer","text":"https://archive.ics.uci.edu/ml/datasets/Breast+Cancer+Wisconsin+(Original) Original creator: Dr. William H. Wolberg (physician) University Wisconsin Hospitals Madison, Wisconsin, USA","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/breastcancer.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Breast cancer data — breastcancer","text":"made following enhancements original data improved usability: ID number cases excluded. numeric criterion value 2 benign 4 malignant converted logical (.e., TRUE/FALSE). 16 cases excluded contained NA values. , data remains consistent original dataset.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/car.html","id":null,"dir":"Reference","previous_headings":"","what":"Car acceptability data — car","title":"Car acceptability data — car","text":"dataset car evaluations based basic features, derived simple hierarchical decision model.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/car.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Car acceptability data — car","text":"","code":"car"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/car.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Car acceptability data — car","text":"data frame containing 1728 cars (rows) 7 variables (columns). buying.price price buying car, Factor (high, low, med, vhigh) maint.price price maintenance, Factor (high, low, med, vhigh) doors number doors, Factor (2, 3, 4, 5more) persons capacity terms persons carry, Factor (2, 4, ) luggage size luggage boot, Factor (big, med, small) safety estimated safety car, Factor (high, low, med) acceptability Criterion: Category acceptability rating. Values: unacc/ vgood/ good/ acc","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/car.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Car acceptability data — car","text":"http://archive.ics.uci.edu/ml/datasets/Car+Evaluation Original creators donors: Marko Bohanec Blaz Zupan","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/car.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Car acceptability data — car","text":"criterion variable car's acceptability rating. criterion dataset yet binarized. using FFTrees, prerequisite step completed based individual preferences.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/car.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Car acceptability data — car","text":"Bohanec, M., Rajkovic, V. (1990): Expert system decision making. Sistemica, 1 (1), 145–157.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/classtable.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute classification statistics for binary prediction and criterion (e.g.; truth) vectors — classtable","title":"Compute classification statistics for binary prediction and criterion (e.g.; truth) vectors — classtable","text":"main input 2 logical vectors prediction criterion values.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/classtable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute classification statistics for binary prediction and criterion (e.g.; truth) vectors — classtable","text":"","code":"classtable( prediction_v = NULL, criterion_v = NULL, correction = 0.25, sens.w = NULL, cost.outcomes = NULL, cost_v = NULL, my.goal = NULL, my.goal.fun = NULL, quiet_mis = FALSE, na_prediction_action = \"ignore\" )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/classtable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute classification statistics for binary prediction and criterion (e.g.; truth) vectors — classtable","text":"prediction_v logical. logical vector predictions. criterion_v logical. logical vector (TRUE) criterion values. correction numeric. Correction added counts calculating dprime. Default: correction = .25. sens.w numeric. Sensitivity weight parameter (0 1, computing wacc). Default: sens.w = NULL (ensure values passed calling function). cost.outcomes list. list length 4 names 'hi', 'fa', 'mi', 'cr' specifying costs hit, false alarm, miss, correct rejection, respectively. instance, cost.outcomes = listc(\"hi\" = 0, \"fa\" = 10, \"mi\" = 20, \"cr\" = 0) means false alarm miss cost 10 20, respectively, correct decisions cost. Default: cost.outcomes = NULL (ensure values passed calling function). cost_v numeric. Additional cost value decision (optional vector numeric values). Typically used include cue cost decision (constant current level FFT). Default: cost_v = NULL (ensure values passed calling function). .goal Name optional, user-defined goal (character string). Default: .goal = NULL. .goal.fun User-defined goal function (4 arguments hi fa mi cr). Default: .goal.fun = NULL. quiet_mis logical value passed hide/show NA user feedback (usually x$params$quiet$mis calling function). Default: quiet_mis = FALSE (.e., show user feedback). na_prediction_action happens prediction possible? (Experimental currently unused.)","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/classtable.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compute classification statistics for binary prediction and criterion (e.g.; truth) vectors — classtable","text":"primary confusion matrix computed confusionMatrix.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/contraceptive.html","id":null,"dir":"Reference","previous_headings":"","what":"Contraceptive use data — contraceptive","title":"Contraceptive use data — contraceptive","text":"subset 1987 National Indonesia Contraceptive Prevalence Survey.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/contraceptive.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Contraceptive use data — contraceptive","text":"","code":"contraceptive"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/contraceptive.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Contraceptive use data — contraceptive","text":"data frame containing 1473 cases (rows) 10 variables (columns). wife.age Wife's age, Numeric wife.edu Wife's education, Nummeric, (1=low, 2, 3, 4=high) hus.ed Husband's education, Nummeric, (1=low, 2, 3, 4=high) children Number children ever born, Numeric wife.rel Wife's religion, Numeric, (0=Non-Islam, 1=Islam) wife.work Wife's now working?, Nummeric, (0=Yes, 1=) hus.occ Husband's occupation, Nummeric, (1, 2, 3, 4) sol Standard--living index, Nummeric, (1=low, 2, 3, 4=high) media Media exposure, Numeric, (0=Good, 1=good) cont.crit Criterion: Use contraceptive (logical). Values: FALSE vs. TRUE (42.7% vs. 57.3%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/contraceptive.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Contraceptive use data — contraceptive","text":"https://archive.ics.uci.edu/ml/datasets/Contraceptive+Method+Choice Original creator donor: Tjen-Sien Lim","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/contraceptive.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Contraceptive use data — contraceptive","text":"samples describe married women either pregnant know pregnant time interview. problem consists predicting woman's current contraceptive method choice (: binarized cont.crit) based demographic socio-economic characteristics. made following enhancements original data improved usability: criterion binarized class attribute variable three levels (1 = -use, 2 = Long-term, 3 = Short-term), logical variable (TRUE vs. FALSE). , data remains consistent original dataset.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/creditapproval.html","id":null,"dir":"Reference","previous_headings":"","what":"Credit approval data — creditapproval","title":"Credit approval data — creditapproval","text":"data reports predictors result credit card applications. attribute names values changed symbols protect confidentiality.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/creditapproval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Credit approval data — creditapproval","text":"","code":"creditapproval"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/creditapproval.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Credit approval data — creditapproval","text":"data frame containing 690 cases (rows) 15 variables (columns). c.1 categorical: b, c.2 continuous c.3 continuous c.4 categorical: u, y, l, t c.5 categorical: g, p, gg c.6 categorical: c, d, cc, , j, k, m, r, q, w, x, e, aa, ff c.7 categorical: v, h, bb, j, n, z, dd, ff, o c.8 continuous c.9 categorical: t, f c.10 categorical: t, f c.11 continuous c.12 categorical: t, f c.13 categorical: g, p, s c.14 continuous c.15 continuous crit Criterion: Credit approval. Values: TRUE (+) vs. FALSE (-) (44.5% vs. 55.5%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/creditapproval.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Credit approval data — creditapproval","text":"https://archive.ics.uci.edu/ml/datasets/Credit+Approval","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/creditapproval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Credit approval data — creditapproval","text":"dataset contains mix attributes – continuous, nominal small sample sizes, nominal larger sample sizes. also missing values. made following enhancements original data improved usability: missing values, denoted \"?\" dataset, transformed NA values. Binary factor variables exclusive \"t\" \"f\" values converted logical vectors (TRUE/FALSE). , data remains consistent original dataset.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/describe_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Describe data — describe_data","title":"Describe data — describe_data","text":"Calculate key descriptive statistics given set data.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/describe_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Describe data — describe_data","text":"","code":"describe_data(data, data_name, criterion_name, baseline_value)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/describe_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Describe data — describe_data","text":"data data frame criterion variable criterion_name. data_name character string specifying name data. criterion_name character string specifying criterion name. baseline_value value criterion_name denoting baseline (e.g., TRUE FALSE).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/describe_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Describe data — describe_data","text":"data frame descriptive statistics.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/describe_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Describe data — describe_data","text":"","code":"data(heartdisease) describe_data(heartdisease, \"heartdisease\", criterion_name = \"diagnosis\", baseline_value = TRUE) #> # A tibble: 1 × 7 #> Name Cases_n Criterion Baseline_pct Predictors_n NAs_n NAs_pct #> #> 1 heartdisease 303 diagnosis 45.9 13 0 0"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/drop_nodes.html","id":null,"dir":"Reference","previous_headings":"","what":"Drop a node from an FFT definition — drop_nodes","title":"Drop a node from an FFT definition — drop_nodes","text":"drop_nodes deletes one nodes existing FFT definition (removing corresponding rows FFT definition tidy data frame format). dropping final node, last remaining node becomes new final node (.e., gains second exit). Duplicates nodes dropped (rather incrementally) nodes range 1:nrow(fft) ignored. Dropping nodes yields error. drop_nodes inverse function select_nodes. Inserting new nodes possible add_nodes.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/drop_nodes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Drop a node from an FFT definition — drop_nodes","text":"","code":"drop_nodes(fft, nodes = NA, quiet = FALSE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/drop_nodes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Drop a node from an FFT definition — drop_nodes","text":"fft One FFT definition (data frame tidy format, one row per node). nodes FFT nodes drop (integer vector). Default: nodes = NA. quiet Hide feedback messages (logical)? Default: quiet = FALSE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/drop_nodes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Drop a node from an FFT definition — drop_nodes","text":"One FFT definition (data frame tidy format, one row per node).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/edit_nodes.html","id":null,"dir":"Reference","previous_headings":"","what":"Edit nodes in an FFT definition — edit_nodes","title":"Edit nodes in an FFT definition — edit_nodes","text":"edit_nodes allows manipulating one nodes existing FFT definition (tidy data frame format). edit_nodes allows directly set change value(s) class, cue, direction, threshold, exit, FFT definition specified nodes. rudimentary verification plausible entries. Importantly, however, edit_nodes ignorant data, values variables validated specific set data. Repeated changes node possible (repeating corresponding integer value nodes).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/edit_nodes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Edit nodes in an FFT definition — edit_nodes","text":"","code":"edit_nodes( fft, nodes = NA, class = NA, cue = NA, direction = NA, threshold = NA, exit = NA, quiet = FALSE )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/edit_nodes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Edit nodes in an FFT definition — edit_nodes","text":"fft One FFT definition (data frame tidy format, one row per node). nodes FFT nodes edited (integer vector). Default: nodes = NA. class class values nodes (character). cue cue names nodes (character). direction direction values nodes (character). threshold threshold values nodes (character). exit exit values nodes (values exit_types). quiet Hide feedback messages (logical)? Default: quiet = FALSE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/edit_nodes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Edit nodes in an FFT definition — edit_nodes","text":"One FFT definition (data frame tidy format, one row per node).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fact_clean.html","id":null,"dir":"Reference","previous_headings":"","what":"Clean factor variables in prediction data — fact_clean","title":"Clean factor variables in prediction data — fact_clean","text":"Clean factor variables prediction data","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fact_clean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clean factor variables in prediction data — fact_clean","text":"","code":"fact_clean(data.train, data.test, show.warning = T)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fact_clean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clean factor variables in prediction data — fact_clean","text":"data.train training dataset data.test testing dataset show.warning logical","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fertility.html","id":null,"dir":"Reference","previous_headings":"","what":"Fertility data — fertility","title":"Fertility data — fertility","text":"dataset describes sample 100 volunteers providing semen sample analyzed according 2010 criteria.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fertility.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fertility data — fertility","text":"","code":"fertility"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fertility.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Fertility data — fertility","text":"data frame containing 100 rows 10 columns. season Season analysis performed. (winter, spring, summer, fall) age Age time analysis child.dis Childish diseases (ie , chicken pox, measles, mumps, polio) (yes(1), (0)) trauma Accident serious trauma (yes(1), (0)) surgery Surgical intervention (yes(1), (0)) fevers High fevers last year (less three months ago(-1), three months ago (0), . (1)) alcohol Frequency alcohol consumption (several times day, every day, several times week, week, hardly ever never) smoking Smoking habit (never(-1), occasional (0)) daily (1)) sitting Number hours spent sitting per day diagnosis Criterion: Diagnosis normal (TRUE) vs. altered (FALSE) (88.0% vs.\\ 22.0%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fertility.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Fertility data — fertility","text":"https://archive.ics.uci.edu/ml/datasets/Fertility Original contributors: David Gil Lucentia Research Group Department Computer Technology University Alicante Jose Luis Girela Department Biotechnology University Alicante","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fertility.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fertility data — fertility","text":"Sperm concentration related socio-demographic data, environmental factors, health status, life habits. made following enhancements original data improved usability: criterion redefined factor variable two levels (N = Normal, O = Altered) logical variable (TRUE vs. FALSE). , data remains consistent original dataset.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_apply.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply an FFT to data and generate accuracy statistics — fftrees_apply","title":"Apply an FFT to data and generate accuracy statistics — fftrees_apply","text":"fftrees_apply applies fast--frugal tree (FFT, FFTrees object) dataset (type mydata) generates corresponding accuracy statistics (cue levels trees). fftrees_apply called internally main FFTrees function (mydata = \"train\" — test data exists — mydata = \"test\"). Alternatively, fftrees_apply called predicting outcomes new data predict.FFTrees.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_apply.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply an FFT to data and generate accuracy statistics — fftrees_apply","text":"","code":"fftrees_apply(x, mydata = NULL, newdata = NULL, fin_NA_pred = \"majority\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_apply.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply an FFT to data and generate accuracy statistics — fftrees_apply","text":"x object FFT definitions applied current data (FFTrees object). mydata type data FFT applied (character, either \"train\" \"test\"). newdata New data FFT applied (data frame). fin_NA_pred outcome predicted final node tree cue value NA (character)? Valid options : 'noise' predict FALSE (0/left/signal) corresponding cases 'signal' predict TRUE (1/right/noise) corresponding cases 'majority' predict common criterion value (.e., TRUE base rate p(TRUE) > .50 'train' data) corresponding cases 'baseline' flip random coin biased criterion baseline p(TRUE) ('train' data) corresponding cases 'dnk' yet ToDo: abstain classifying / decide 'know' / defer (.e., tertium datur) Default: fin_NA_pred = \"majority\".","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_apply.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Apply an FFT to data and generate accuracy statistics — fftrees_apply","text":"modified FFTrees object (lists x$trees containing information FFT decisions statistics).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_create.html","id":null,"dir":"Reference","previous_headings":"","what":"Create an object of class FFTrees — fftrees_create","title":"Create an object of class FFTrees — fftrees_create","text":"fftrees_create creates FFTrees object. fftrees_create called internally main FFTrees function. main purpose verify store various parameters (e.g., denote algorithms, goals, thresholds) used maximization processes evaluation purposes (e.g., sens.w cost values).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_create.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create an object of class FFTrees — fftrees_create","text":"","code":"fftrees_create( formula = NULL, data = NULL, data.test = NULL, algorithm = NULL, goal = NULL, goal.chase = NULL, goal.threshold = NULL, max.levels = NULL, numthresh.method = NULL, numthresh.n = NULL, repeat.cues = NULL, stopping.rule = NULL, stopping.par = NULL, sens.w = NULL, cost.outcomes = NULL, cost.cues = NULL, main = NULL, decision.labels = NULL, my.goal = NULL, my.goal.fun = NULL, my.tree = NULL, quiet = NULL )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_create.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create an object of class FFTrees — fftrees_create","text":"formula formula (binary criterion variable). data Training data (data frame). data.test Data testing models/prediction (data frame). algorithm Algorithm growing FFTs (\"ifan\" \"dfan\") (character string). goal Measure used select FFTs (character string). goal.chase Measure used optimize FFT creation (character string). goal.threshold Measure used optimize cue thresholds (character string). max.levels integer. numthresh.method string. numthresh.n integer. repeat.cues logical. stopping.rule string. stopping.par numeric. sens.w numeric. cost.outcomes list. cost.cues list. main string. decision.labels string. .goal name optimization measure defined .goal.fun (character string). Example: .goal = \"my_acc\" (see .goal.fun corresponding function). Default: .goal = NULL. .goal.fun definition outcome measure optimize, defined function frequency counts 4 basic classification outcomes hi, fa, mi, cr (.e., R function 4 arguments hi, fa, mi, cr). Example: .goal.fun = function(hi, fa, mi, cr){(hi + cr)/(hi + fa + mi + cr)} (.e., accuracy). Default: .goal.fun = NULL. .tree verbal description FFT, .e., \"FFT words\" (character string). example, .tree = \"age > 20, predict TRUE. sex = {m}, predict FALSE. Otherwise, predict TRUE.\". quiet list logical elements.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_create.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create an object of class FFTrees — fftrees_create","text":"new FFTrees object.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_cuerank.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate thresholds that optimize some statistic (goal) for cues in data — fftrees_cuerank","title":"Calculate thresholds that optimize some statistic (goal) for cues in data — fftrees_cuerank","text":"fftrees_cuerank takes FFTrees object x optimizes goal.threshold (x$params) cues newdata (type data).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_cuerank.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate thresholds that optimize some statistic (goal) for cues in data — fftrees_cuerank","text":"","code":"fftrees_cuerank(x = NULL, newdata = NULL, data = \"train\", rounding = NULL)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_cuerank.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate thresholds that optimize some statistic (goal) for cues in data — fftrees_cuerank","text":"x FFTrees object. newdata dataset cues ranked (data frame). data type data cues ranked (character: 'train', 'test', 'dynamic'). Default: data = 'train'. rounding integer. integer value indicating decimal digit non-integer numeric cue thresholds rounded. Default: rounding = NULL (.e., rounding).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_cuerank.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate thresholds that optimize some statistic (goal) for cues in data — fftrees_cuerank","text":"modified FFTrees object (cue rank information current data type x$cues$stats).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_cuerank.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate thresholds that optimize some statistic (goal) for cues in data — fftrees_cuerank","text":"fftrees_cuerank creates data frame cuerank_df added x$cues$stats. Note cue directions thresholds computed FFTrees always predict positive criterion values (.e., TRUE signal, rather FALSE noise). Using thresholds negative exits (.e., predicting instances FALSE noise) usually requires reversal (e.g., negating cue direction). fftrees_cuerank called (twice) fftrees_grow_fan algorithm grow fast--frugal trees (FFTs).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_define.html","id":null,"dir":"Reference","previous_headings":"","what":"Create FFT definitions — fftrees_define","title":"Create FFT definitions — fftrees_define","text":"fftrees_define defines fast--frugal trees (FFTs) either definitions provided applying algorithms (definitions provided), returns modified FFTrees object contains definitions. use cases, fftrees_define passes new FFTrees object x either fftrees_grow_fan (create new FFTs applying algorithms data) fftrees_wordstofftrees (.tree specified). existing FFTrees object object tree.definitions provided inputs, new FFTs created. arguments provided, tree.definitions take priority FFTs existing object. Specifically, tree.definitions provided, assigned FFTs x. tree.definitions provided, existing FFTrees object object provided, trees object assigned FFTs x.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_define.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create FFT definitions — fftrees_define","text":"","code":"fftrees_define(x, object = NULL, tree.definitions = NULL)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_define.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create FFT definitions — fftrees_define","text":"x current FFTrees object (changed returned). object existing FFTrees object (tree definitions). tree.definitions data.frame. optional hard-coded definition FFTs (format FFTrees object). specified, new FFTs created, tree definitions object x replaced tree definitions provided current object re-evaluated.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_define.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create FFT definitions — fftrees_define","text":"FFTrees object tree definitions.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_ffttowords.html","id":null,"dir":"Reference","previous_headings":"","what":"Describe a fast-and-frugal tree (FFT) in words — fftrees_ffttowords","title":"Describe a fast-and-frugal tree (FFT) in words — fftrees_ffttowords","text":"fftrees_ffttowords provides verbal description tree definition (defined FFTrees object). Thus, fftrees_ffttowords translates abstract FFT definition natural language output. fftrees_ffttowords complement function fftrees_wordstofftrees, parses verbal description FFT abstract tree definition FFTrees object. final sentence (tree node) FFT's description always predicts positive criterion values (.e., TRUE instances) first, predicting negative criterion values (.e., FALSE instances). Note may require reversal exit directions, final cue predicted FALSE instances. Note cue directions thresholds computed FFTrees always predict positive criterion values (.e., TRUE signal, rather FALSE noise). Using thresholds negative exits (.e., predicting instances FALSE noise) usually requires reversal (e.g., negating cue direction).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_ffttowords.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Describe a fast-and-frugal tree (FFT) in words — fftrees_ffttowords","text":"","code":"fftrees_ffttowords(x = NULL, mydata = \"train\", digits = 2)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_ffttowords.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Describe a fast-and-frugal tree (FFT) in words — fftrees_ffttowords","text":"x FFTrees object created FFTrees. mydata type data tree applied (character string \"train\" \"test\"). Default: mydata = \"train\". digits many digits round numeric values (integer)?","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_ffttowords.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Describe a fast-and-frugal tree (FFT) in words — fftrees_ffttowords","text":"modified FFTrees object x x$trees$inwords containing list string vectors.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_ffttowords.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Describe a fast-and-frugal tree (FFT) in words — fftrees_ffttowords","text":"","code":"heart.fft <- FFTrees(diagnosis ~ ., data = heartdisease, decision.labels = c(\"Healthy\", \"Disease\") ) #> ✔ Created an FFTrees object. #> Ranking 13 cues: ■■■■■■■■ 23% | ETA: 1s #> Ranking 13 cues: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s #> #> ✔ Ranked 13 cues (optimizing 'bacc'). #> ✔ Created 7 FFTs with 'ifan' algorithm (chasing 'bacc'). #> ✔ Defined 7 FFTs. #> ✔ Applied 7 FFTs to 'train' data. #> ✔ Ranked 7 FFTs by 'train' data. #> ✔ Expressed 7 FFTs in words. inwords(heart.fft) #> [1] \"If thal = {rd,fd}, decide Disease.\" #> [2] \"If cp != {a}, decide Healthy.\" #> [3] \"If ca > 0, decide Disease, otherwise, decide Healthy.\""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_grow_fan.html","id":null,"dir":"Reference","previous_headings":"","what":"Grow fast-and-frugal trees (FFTs) using the fan algorithms — fftrees_grow_fan","title":"Grow fast-and-frugal trees (FFTs) using the fan algorithms — fftrees_grow_fan","text":"fftrees_grow_fan called fftrees_define create new FFTs applying fan algorithms (specifically, either ifan dfan) data.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_grow_fan.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Grow fast-and-frugal trees (FFTs) using the fan algorithms — fftrees_grow_fan","text":"","code":"fftrees_grow_fan(x, repeat.cues = TRUE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_grow_fan.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Grow fast-and-frugal trees (FFTs) using the fan algorithms — fftrees_grow_fan","text":"x FFTrees object. repeat.cues Can cues considered/used repeatedly (logical)? Default: repeat.cues = TRUE, relevant using dfan algorithm.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_ranktrees.html","id":null,"dir":"Reference","previous_headings":"","what":"Rank FFTs by current goal — fftrees_ranktrees","title":"Rank FFTs by current goal — fftrees_ranktrees","text":"fftrees_ranktrees ranks trees FFTrees object x based current goal (either \"cost\" specified x$params$goal). fftrees_ranktrees called main FFTrees function creating FFTs applying (training) data.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_ranktrees.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rank FFTs by current goal — fftrees_ranktrees","text":"","code":"fftrees_ranktrees(x, data = \"train\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_ranktrees.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rank FFTs by current goal — fftrees_ranktrees","text":"x FFTrees object. data type data used (character). Default: data = \"train\".","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_threshold_factor_grid.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform a grid search over factor and return accuracy statistics for a given factor cue — fftrees_threshold_factor_grid","title":"Perform a grid search over factor and return accuracy statistics for a given factor cue — fftrees_threshold_factor_grid","text":"Perform grid search factor return accuracy statistics given factor cue","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_threshold_factor_grid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform a grid search over factor and return accuracy statistics for a given factor cue — fftrees_threshold_factor_grid","text":"","code":"fftrees_threshold_factor_grid( thresholds = NULL, cue_v = NULL, criterion_v = NULL, directions = \"=\", goal.threshold = NULL, sens.w = NULL, my.goal = NULL, my.goal.fun = NULL, cost.each = NULL, cost.outcomes = NULL )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_threshold_factor_grid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform a grid search over factor and return accuracy statistics for a given factor cue — fftrees_threshold_factor_grid","text":"thresholds numeric. vector factor thresholds consider. cue_v numeric. Feature/cue values. criterion_v logical. logical vector (TRUE) criterion values. directions character. Character vector threshold directions consider. goal.threshold character string indicating criterion maximize optimizing cue thresholds: \"acc\" = overall accuracy, \"bacc\" = balanced accuracy, \"wacc\" = weighted accuracy, \"dprime\" = discriminability, \"cost\" = costs (based cost.outcomes, cost.cues constant per cue). Default: goal.threshold = \"bacc\". sens.w numeric. Sensitivity weight parameter (0 1, computing wacc). Default: sens.w = .50. .goal Name optional, user-defined goal (character string). Default: .goal = NULL. .goal.fun User-defined goal function (4 arguments hi fa mi cr). Default: .goal.fun = NULL. cost.numeric. constant cost value add value (e.g., cost cue). cost.outcomes list. list length 4 names 'hi', 'fa', 'mi', 'cr' specifying costs hit, false alarm, miss, correct rejection, respectively, common currency. instance, cost.outcomes = listc(\"hi\" = 0, \"fa\" = 10, \"mi\" = 20, \"cr\" = 0) means false alarm miss cost 10 20 units, respectively, correct decisions cost.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_threshold_factor_grid.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform a grid search over factor and return accuracy statistics for a given factor cue — fftrees_threshold_factor_grid","text":"data frame containing accuracy statistics factor thresholds.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_threshold_numeric_grid.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform a grid search over thresholds and return accuracy statistics for a given numeric cue — fftrees_threshold_numeric_grid","title":"Perform a grid search over thresholds and return accuracy statistics for a given numeric cue — fftrees_threshold_numeric_grid","text":"Perform grid search thresholds return accuracy statistics given numeric cue","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_threshold_numeric_grid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform a grid search over thresholds and return accuracy statistics for a given numeric cue — fftrees_threshold_numeric_grid","text":"","code":"fftrees_threshold_numeric_grid( thresholds, cue_v, criterion_v, directions = c(\">\", \"<=\"), goal.threshold = NULL, sens.w = NULL, my.goal = NULL, my.goal.fun = NULL, cost.each = NULL, cost.outcomes = NULL )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_threshold_numeric_grid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform a grid search over thresholds and return accuracy statistics for a given numeric cue — fftrees_threshold_numeric_grid","text":"thresholds numeric. vector thresholds consider. cue_v numeric. Feature values. criterion_v logical. logical vector (TRUE) criterion values. directions character. Possible directions consider. goal.threshold character string indicating criterion maximize optimizing cue thresholds: \"acc\" = overall accuracy, \"bacc\" = balanced accuracy, \"wacc\" = weighted accuracy, \"dprime\" = discriminability, \"cost\" = costs (based cost.outcomes, cost.cues constant per cue). Default: goal.threshold = \"bacc\". sens.w numeric. Sensitivity weight parameter (0 1, computing wacc). Default: sens.w = .50. .goal Name optional, user-defined goal (character string). Default: .goal = NULL. .goal.fun User-defined goal function (4 arguments hi fa mi cr). Default: .goal.fun = NULL. cost.numeric. constant cost value add value (e.g., cost cue). cost.outcomes list. list length 4 names 'hi', 'fa', 'mi', 'cr' specifying costs hit, false alarm, miss, correct rejection, respectively, common currency. instance, cost.outcomes = listc(\"hi\" = 0, \"fa\" = 10, \"mi\" = 20, \"cr\" = 0) means false alarm miss cost 10 20 units, respectively, correct decisions cost.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_threshold_numeric_grid.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform a grid search over thresholds and return accuracy statistics for a given numeric cue — fftrees_threshold_numeric_grid","text":"data frame containing accuracy statistics numeric thresholds.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_wordstofftrees.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert a verbal description of an FFT into an FFTrees object — fftrees_wordstofftrees","title":"Convert a verbal description of an FFT into an FFTrees object — fftrees_wordstofftrees","text":"fftrees_wordstofftrees converts verbal description FFT (provided string text) tree definition (FFTrees object). Thus, fftrees_wordstofftrees provides simple natural language parser FFTs. fftrees_wordstofftrees complement function fftrees_ffttowords, converts abstract tree definition (FFTrees object) verbal description (.e., provides natural language output). increase robustness, parsing fftrees_wordstofftrees allows lower- uppercase spellings (typographical variants) ignores else-part final sentence (.e., part beginning \"otherwise\").","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_wordstofftrees.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert a verbal description of an FFT into an FFTrees object — fftrees_wordstofftrees","text":"","code":"fftrees_wordstofftrees(x, my.tree)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_wordstofftrees.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert a verbal description of an FFT into an FFTrees object — fftrees_wordstofftrees","text":"x FFTrees object. .tree character string. verbal description (string text) defining FFT.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_wordstofftrees.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert a verbal description of an FFT into an FFTrees object — fftrees_wordstofftrees","text":"FFTrees object new tree definition described .tree.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/flip_exits.html","id":null,"dir":"Reference","previous_headings":"","what":"Flip exits in an FFT definition — flip_exits","title":"Flip exits in an FFT definition — flip_exits","text":"flip_exits reverses exits one nodes existing FFT definition (tidy data frame format). flip_exits alters value(s) non-final exits specified nodes (0 1, 1 0). contrast, exits final nodes remain unchanged. Duplicates nodes flipped (rather repeatedly) nodes range 1:nrow(fft) ignored. flip_exits specialized function edit_nodes.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/flip_exits.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Flip exits in an FFT definition — flip_exits","text":"","code":"flip_exits(fft, nodes = NA, quiet = FALSE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/flip_exits.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Flip exits in an FFT definition — flip_exits","text":"fft One FFT definition (data frame tidy format, one row per node). nodes FFT nodes whose exits flipped (integer vector). Default: nodes = NA. quiet Hide feedback messages (logical)? Default: quiet = FALSE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/flip_exits.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Flip exits in an FFT definition — flip_exits","text":"One FFT definition (data frame tidy format, one row per node).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/forestfires.html","id":null,"dir":"Reference","previous_headings":"","what":"Forest fires data — forestfires","title":"Forest fires data — forestfires","text":"dataset forest fire statistics.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/forestfires.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forest fires data — forestfires","text":"","code":"forestfires"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/forestfires.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Forest fires data — forestfires","text":"data frame containing 517 rows 13 columns. X Integer -x-axis spatial coordinate within Montesinho park map: 1 9 Y Integer - y-axis spatial coordinate within Montesinho park map: 2 9 month Factor - month year: \"jan\" \"dec\" day Factor -day week: \"mon\" \"sun\" FFMC Numeric -FFMC index FWI system: 18.7 96.20 DMC Numeric - DMC index FWI system: 1.1 291.3 DC Numeric - DC index FWI system: 7.9 860.6 ISI Numeric - ISI index FWI system: 0.0 56.10 temp Numeric - temperature Celsius degrees: 2.2 33.30 RH Numeric - relative humidity percent: 15.0 100 wind Numeric - wind speed km/h: 0.40 9.40 rain Numeric - outside rain mm/m2 : 0.0 6.4 fire.crit Criterion: fire (greater 1.00 ha)? Values: TRUE (yes) vs. FALSE () (47.0% vs. 53.0%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/forestfires.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Forest fires data — forestfires","text":"http://archive.ics.uci.edu/ml/datasets/Forest+Fires Original creator: Prof. Paulo Cortez Aníbal Morais Department Information Systems University Minho, Portugal","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/forestfires.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forest fires data — forestfires","text":"made following enhancements original data improved usability: criterion redefined numeric variable indicated number hectares burned fire logical variable (TRUE (values >1) vs. FALSE (values <=1)). , data remains consistent original dataset.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_best_tree.html","id":null,"dir":"Reference","previous_headings":"","what":"Select the best tree (from current set of FFTs) — get_best_tree","title":"Select the best tree (from current set of FFTs) — get_best_tree","text":"get_best_tree selects (looks identifies) best tree (integer) set (“fan”) FFTs contained current FFTrees object x, existing type data ('train' 'test'), goal corresponding statistics available designated data type (x$trees$stats).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_best_tree.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select the best tree (from current set of FFTs) — get_best_tree","text":"","code":"get_best_tree(x, data, goal, my.goal.max = TRUE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_best_tree.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select the best tree (from current set of FFTs) — get_best_tree","text":"x FFTrees object. data type data consider (character: either 'train' 'test'). goal goal (character) maximized minimized selecting tree existing FFTrees object x (existing x$trees$stats). .goal.max Default direction user-defined .goal (logical): .goal maximized? Default: .goal.max = TRUE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_best_tree.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Select the best tree (from current set of FFTs) — get_best_tree","text":"integer denoting tree maximizes/minimizes goal data.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_best_tree.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Select the best tree (from current set of FFTs) — get_best_tree","text":"Importantly, get_best_tree identifies selects `tree` identifier (integer) set existing trees known statistics, rather creating new trees computing new cue thresholds. specifically, goal used identifying selecting `tree` identifier (integer) best FFT existing set FFTs, computing new cue thresholds (see goal.threshold fftrees_cuerank()) creating new trees (see goal.chase fftrees_ranktrees()).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_exit_type.html","id":null,"dir":"Reference","previous_headings":"","what":"Get exit type (from a vector x of FFT exit descriptions) — get_exit_type","title":"Get exit type (from a vector x of FFT exit descriptions) — get_exit_type","text":"get_exit_type checks converts vector x FFT exit descriptions exits FFT correspond current options exit_types (global constant).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_exit_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get exit type (from a vector x of FFT exit descriptions) — get_exit_type","text":"","code":"get_exit_type(x, verify = TRUE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_exit_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get exit type (from a vector x of FFT exit descriptions) — get_exit_type","text":"x vector FFT exit descriptions. verify flag turn verification /(logical). Default: verify = TRUE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_exit_type.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get exit type (from a vector x of FFT exit descriptions) — get_exit_type","text":"vector exit_types (error).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_exit_type.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get exit type (from a vector x of FFT exit descriptions) — get_exit_type","text":"get_exit_type also verifies exit types conform FFT (e.g., exits final node bi-directional).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_exit_type.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get exit type (from a vector x of FFT exit descriptions) — get_exit_type","text":"","code":"get_exit_type(c(0, 1, .5)) #> [1] 0.0 1.0 0.5 get_exit_type(c(FALSE, \" True \", 2/4)) #> [1] 0.0 1.0 0.5 get_exit_type(c(\"noise\", \"signal\", \"final\")) #> [1] 0.0 1.0 0.5 get_exit_type(c(\"left\", \"right\", \"both\")) #> [1] 0.0 1.0 0.5"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_fft_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Get FFT definitions (from an FFTrees object x) — get_fft_df","title":"Get FFT definitions (from an FFTrees object x) — get_fft_df","text":"get_fft_df gets FFT definitions FFTrees object x (data.frame).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_fft_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get FFT definitions (from an FFTrees object x) — get_fft_df","text":"","code":"get_fft_df(x)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_fft_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get FFT definitions (from an FFTrees object x) — get_fft_df","text":"x FFTrees object.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_fft_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get FFT definitions (from an FFTrees object x) — get_fft_df","text":"set FFT definitions (data.frame/tibble, one-line per FFT definition format used FFTrees object).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_fft_df.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get FFT definitions (from an FFTrees object x) — get_fft_df","text":"FFTs data.frame returned represented one-line per FFT definition format used FFTrees object. addition looking x$trees$definitions, get_fft_df verifies FFT definitions valid (given current settings).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.cost.html","id":null,"dir":"Reference","previous_headings":"","what":"Cue costs for the heartdisease data — heart.cost","title":"Cue costs for the heartdisease data — heart.cost","text":"data characterizes variables (cues) heartdisease dataset.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.cost.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cue costs for the heartdisease data — heart.cost","text":"","code":"heart.cost"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.cost.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Cue costs for the heartdisease data — heart.cost","text":"list length 13 containing cost cue heartdisease dataset (dollars). list element single (positive numeric) value.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.cost.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Cue costs for the heartdisease data — heart.cost","text":"https://archive.ics.uci.edu/ml/machine-learning-databases/heart-disease/costs/","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.test.html","id":null,"dir":"Reference","previous_headings":"","what":"Heart disease testing data — heart.test","title":"Heart disease testing data — heart.test","text":"Testing data heartdisease data. subset used test prediction performance model trained heart.train data. dataset heartdisease contains datasets.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Heart disease testing data — heart.test","text":"","code":"heart.test"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.test.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Heart disease testing data — heart.test","text":"data frame containing 153 rows 14 columns (see heartdisease details).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.test.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Heart disease testing data — heart.test","text":"https://archive.ics.uci.edu/ml/datasets/Heart+Disease","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.train.html","id":null,"dir":"Reference","previous_headings":"","what":"Heart disease training data — heart.train","title":"Heart disease training data — heart.train","text":"Training data binary prediction model (: FFT) (subset ) heartdisease data. complementary subset model testing heart.test. data heartdisease contains subsets.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.train.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Heart disease training data — heart.train","text":"","code":"heart.train"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.train.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Heart disease training data — heart.train","text":"data frame containing 150 rows 14 columns (see heartdisease details).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.train.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Heart disease training data — heart.train","text":"https://archive.ics.uci.edu/ml/datasets/Heart+Disease","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heartdisease.html","id":null,"dir":"Reference","previous_headings":"","what":"Heart disease data — heartdisease","title":"Heart disease data — heartdisease","text":"dataset predicting diagnosis 303 patients tested heart disease.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heartdisease.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Heart disease data — heartdisease","text":"","code":"heartdisease"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heartdisease.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Heart disease data — heartdisease","text":"data frame containing 303 rows 14 columns, following variables: diagnosis True value binary criterion: TRUE = Heart disease, FALSE = Heart disease age Age (years) sex Sex, 1 = male, 0 = female cp Chest pain type: ta = typical angina, aa = atypical angina, np = non-anginal pain, = asymptomatic trestbps Resting blood pressure (mm Hg admission hospital) chol Serum cholestoral mg/dl fbs Fasting blood sugar > 120 mg/dl: 1 = true, 0 = false restecg Resting electrocardiographic results. \"normal\" = normal, \"abnormal\" = ST-T wave abnormality (T wave inversions /ST elevation depression > 0.05 mV), \"hypertrophy\" = showing probable definite left ventricular hypertrophy Estes' criteria. thalach Maximum heart rate achieved exang Exercise induced angina: 1 = yes, 0 = oldpeak ST depression induced exercise relative rest slope slope peak exercise ST segment. ca Number major vessels (0-3) colored flourosopy thal \"normal\" = normal, \"fd\" = fixed defect, \"rd\" = reversible defect","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heartdisease.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Heart disease data — heartdisease","text":"https://archive.ics.uci.edu/ml/datasets/Heart+Disease","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/inwords.html","id":null,"dir":"Reference","previous_headings":"","what":"Provide a verbal description of an FFT — inwords","title":"Provide a verbal description of an FFT — inwords","text":"inwords generates provides verbal description fast--frugal tree (FFT) FFTrees object. data remains unspecified, inwords look x$trees$inwords. data set either \"train\" \"test\", inwords first employs fftrees_ffttowords re-generate verbal descriptions FFTs x.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/inwords.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Provide a verbal description of an FFT — inwords","text":"","code":"inwords(x, data = NULL, tree = 1)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/inwords.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Provide a verbal description of an FFT — inwords","text":"x FFTrees object. data type data tree applied (character string \"train\" \"test\"). Default: data = NULL look x$trees$inwords. tree tree display (integer).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/inwords.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Provide a verbal description of an FFT — inwords","text":"verbal description FFT (character string).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/iris.v.html","id":null,"dir":"Reference","previous_headings":"","what":"Iris data — iris.v","title":"Iris data — iris.v","text":"famous dataset R.. Fisher (1936) simplified predict virginica class (.e., binary classification problem).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/iris.v.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Iris data — iris.v","text":"","code":"iris.v"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/iris.v.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Iris data — iris.v","text":"data frame containing 150 rows 4 columns. sep.len sepal length cm sep.wid sepal width cm pet.len petal length cm pet.wid petal width cm virginica Criterion: iris belong class \"virginica\"? Values: TRUE vs. FALSE (33.33% vs.66.67%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/iris.v.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Iris data — iris.v","text":"https://archive.ics.uci.edu/ml/datasets/Iris","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/iris.v.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Iris data — iris.v","text":"improve usability, made following changes: criterion binarized factor variable three levels (Iris-setosa, Iris-versicolor, Iris-virginica), logical variable (.e., TRUE instances Iris-virginica FALSE two levels). , data remains consistent original dataset.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/iris.v.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Iris data — iris.v","text":"Fisher, R.. (1936): use multiple measurements taxonomic problems. Annual Eugenics, 7, Part II, pp. 179–188.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/mushrooms.html","id":null,"dir":"Reference","previous_headings":"","what":"Mushrooms data — mushrooms","title":"Mushrooms data — mushrooms","text":"Data describing poisonous vs. non-poisonous mushrooms.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/mushrooms.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Mushrooms data — mushrooms","text":"","code":"mushrooms"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/mushrooms.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Mushrooms data — mushrooms","text":"data frame containing 8,124 rows 23 columns. See http://archive.ics.uci.edu/ml/machine-learning-databases/mushroom/agaricus-lepiota.names column descriptions. poisonous Criterion: mushroom poisonous? Values: TRUE (poisonous) vs. FALSE (eatable) (48.2% vs.\\ 52.8%). cshape cap-shape, character (bell=b, conical=c, convex=x, flat=f, knobbed=k, sunken=s) csurface cap-surface, character (fibrous=f, grooves=g, scaly=y, smooth=s) ccolor cap-color, character (brown=n, buff=b, cinnamon=c, gray=g, green=r, pink=p, purple=u, red=e, white=w, yellow=y) bruises bruises? logical (TRUE/FALSE) odor character (almond=, anise=l, creosote=c, fishy=y, foul=f, musty=m, none=n, pungent=p, spicy=s) gattach gill-attachment, character (attached=, descending=d, free=f, notched=n) gspace gill-spacing, character (close=c, crowded=w, distant=d) gsize gill-size, character (broad=b, narrow=n) gcolor gill-color, character (black=k, brown=n, buff=b, chocolate=h, gray=g, green=r, orange=o, pink=p, purple=u, red=e, white=w, yellow=y) sshape stalk-shape, character (enlarging=e, tapering=t) sroot stalk-root, character (bulbous=b ,club=c, cup=u, equal=e, rhizomorphs=z, rooted=r) ssaring stalk-surface--ring, character (fibrous=f, scaly=y, silky=k, smooth=s) ssbring stalk-surface--ring, character (fibrous=f, scaly=y, silky=k, smooth=s) scaring stalk-color--ring, character (brown=n, buff=b, cinnamon=c, gray=g, orange=o, pink=p, red=e, white=w, yellow=y) scbring stalk-color--ring, character (brown=n, buff=b, cinnamon=c, gray=g, orange=o, pink=p, red=e, white=w, yellow=y) vtype veil-type, character (partial=p, universal=u) vcolor veil-color, character (brown=n, orange=o, white=w, yellow=y) ringnum character (none=n, one=o, two=t) ringtype character (cobwebby=c, evanescent=e, flaring=f, large=l, none=n, pendant=p, sheathing=s, zone=z) sporepc spore-print-color, character (black=k, brown=n, buff=b, chocolate=h, green=r, orange=o, purple=u, white=w, yellow=y) population character(abundant=, clustered=c, numerous=n, scattered=s, several=v, solitary=y) habitat character (grasses=g, leaves=l, meadows=m, paths=p, urban=u, waste=w, woods=d)","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/mushrooms.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Mushrooms data — mushrooms","text":"https://archive.ics.uci.edu/ml/datasets/Mushroom","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/mushrooms.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Mushrooms data — mushrooms","text":"dataset includes descriptions hypothetical samples corresponding 23 species gilled mushrooms Agaricus Lepiota Family. species classified poisonous (True False). Guide clearly states simple rule determining edibility mushroom; rule like “leaflets three, let ” Poisonous Oak Ivy. made following enhancements original data improved usability: missing values, denoted \"?\" dataset, transformed NAs. Binary factor variables exclusive \"t\" \"f\" values converted logical TRUE/FALSE vectors. binary factor criterion variable exclusive \"p\" \"e\" values converted logical TRUE/FALSE vector. , data remains consistent original dataset.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/mushrooms.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Mushrooms data — mushrooms","text":"Mushroom records drawn Audubon Society Field Guide North American Mushrooms (1981). G.H. Lincoff (Pres.), New York: .. Knopf.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/plot.FFTrees.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot an FFTrees object — plot.FFTrees","title":"Plot an FFTrees object — plot.FFTrees","text":"plot.FFTrees visualizes FFTrees object created FFTrees function. plot.FFTrees main plotting function FFTrees package called evaluating generic plot FFTrees object. plot.FFTrees visualizes selected FFT, key data characteristics, various aspects classification performance. x may contain test data, plot.FFTrees default plots performance characteristics training data (.e., fitting), rather test data (.e., prediction). test data available, specifying data = \"test\" plots prediction performance. Whenever sensitivity weight (sens.w) set default sens.w = 0.50, level shows balanced accuracy (bacc). , however, sens.w deviates default, level shows tree's weighted accuracy value (wacc) current sens.w value (level). Many aspects plot (e.g., panels) FFT's appearance (e.g., labels nodes exits) can customized setting corresponding arguments.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/plot.FFTrees.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot an FFTrees object — plot.FFTrees","text":"","code":"# S3 method for class 'FFTrees' plot( x = NULL, data = \"train\", what = \"all\", tree = 1, main = NULL, cue.labels = NULL, decision.labels = NULL, truth.labels = NULL, cue.cex = NULL, threshold.cex = NULL, decision.cex = 1, comp = TRUE, show.header = NULL, show.tree = NULL, show.confusion = NULL, show.levels = NULL, show.roc = NULL, show.icons = NULL, show.iconguide = NULL, hlines = TRUE, label.tree = NULL, label.performance = NULL, n.per.icon = NULL, level.type = \"bar\", which.tree = NULL, decision.names = NULL, stats = NULL, grayscale = FALSE, ... )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/plot.FFTrees.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot an FFTrees object — plot.FFTrees","text":"x FFTrees object created FFTrees function. data type data x plotted (string) test dataset (data frame). valid data string must either 'train' (fitting performance) 'test' (prediction performance). valid data frame, specified tree evaluated plotted data ('test' data), global FFTrees object x remains unchanged unless re-assigned. default, data = 'train' (x may contain test data). plotted (character string)? Valid options : '' Plot tree diagram corresponding guides performance statistics, excluding cue accuracies. 'cues' Plot marginal accuracy cues ROC space. Note cue accuracies shown calling = '' use showcues function. 'icontree' Plot tree diagram icon arrays exit nodes. Consider also setting n.per.icon show.iconguide. 'tree' Plot tree diagram. 'roc' Plot performance tree(s) (comparison algorithms) ROC space. Default: = ''. tree tree plotted (integer, valid corresponding tree argument non-empty). Default: tree = 1. plot best training best test tree respect goal specified FFT construction, use 'best.train' 'best.test', respectively. main main plot label (character string). cue.labels optional string labels cues / nodes (character vector). decision.labels character vector length 2 indicating content-specific names noise vs. signal predictions/exits. truth.labels character vector length 2 indicating content-specific names true noise vs. signal cases (using `decision.labels` unspecified). cue.cex size cue labels (numeric). threshold.cex size threshold labels (numeric). decision.cex size decision labels (numeric). comp performance competitive algorithms (e.g.; logistic regression, random forests, etc.) shown ROC plot (available, logical)? show.header Show header basic data properties (top panel, logical)? show.tree Show nodes exits FFT (middle panel, logical)? show.confusion Show 2x2 confusion matrix (bottom panel, logical)? show.levels Show performance levels (bottom panel, logical)? show.roc Show ROC curve (bottom panel, logical)? show.icons Show exit cases icon arrays (middle panel, logical)? show.iconguide Show icon guide (middle panel, logical)? hlines Show horizontal panel separation lines (logical)? Default: hlines = TRUE. label.tree label FFT (optional, character string). label.performance label performance section (optional, character string). n.per.icon number cases represented icon (numeric). level.type type performance levels drawn bottom (character string, either \"bar\" \"line\". Default: level.type = \"bar\". .tree Deprecated argument. Use tree instead. decision.names Deprecated argument. Use decision.labels instead. stats Deprecated argument. statistical information plotted (logical)? Use = \"\" include performance statistics = \"tree\" plot tree diagram. grayscale logical. TRUE, plot shown grayscale. ... Graphical parameters (passed text panel titles, showcues = 'cues', title = 'roc').","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/plot.FFTrees.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot an FFTrees object — plot.FFTrees","text":"invisible FFTrees object x plot visualizing describing FFT (side effect).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/plot.FFTrees.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot an FFTrees object — plot.FFTrees","text":"","code":"# Create FFTs (for heartdisease data): heart_fft <- FFTrees(formula = diagnosis ~ ., data = heart.train) #> ✔ Created an FFTrees object. #> Ranking 13 cues: ■■■■■■■■ 23% | ETA: 1s #> Ranking 13 cues: ■■■■■■■■■■■■■■■■■■■ 62% | ETA: 0s #> Ranking 13 cues: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s #> #> ✔ Ranked 13 cues (optimizing 'bacc'). #> ✔ Created 7 FFTs with 'ifan' algorithm (chasing 'bacc'). #> ✔ Defined 7 FFTs. #> ✔ Applied 7 FFTs to 'train' data. #> ✔ Ranked 7 FFTs by 'train' data. #> ✔ Expressed 7 FFTs in words. # Visualize the default FFT (Tree #1, what = 'all'): plot(heart_fft, main = \"Heart disease\", decision.labels = c(\"Absent\", \"Present\")) # Visualize cue accuracies (in ROC space): plot(heart_fft, what = \"cues\", main = \"Cue accuracies for heart disease data\") #> Plotting cue training statistics: #> — Cue accuracies ranked by bacc #> # Visualize tree diagram with icon arrays on exit nodes: plot(heart_fft, what = \"icontree\", n.per.icon = 2, main = \"Diagnosing heart disease\") # Visualize performance comparison in ROC space: plot(heart_fft, what = \"roc\", main = \"Performance comparison for heart disease data\") # Visualize predictions of FFT #2 (for new test data) with custom options: plot(heart_fft, tree = 2, data = heart.test, main = \"Predicting heart disease\", cue.labels = c(\"1. thal?\", \"2. cp?\", \"3. ca?\", \"4. exang\"), decision.labels = c(\"ok\", \"treat\"), truth.labels = c(\"Healthy\", \"Sick\"), n.per.icon = 2, show.header = TRUE, show.confusion = TRUE, show.levels = TRUE, show.roc = TRUE, hlines = FALSE, font = 3, col = \"steelblue\") #> Applying FFTrees object x to new test data... #> ✔ Applied 7 FFTs to 'test' data. #> Success, but re-assign output to x or use fftrees_apply() to globally change x # # For details, see # vignette(\"FFTrees_plot\", package = \"FFTrees\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/predict.FFTrees.html","id":null,"dir":"Reference","previous_headings":"","what":"Predict classification outcomes or probabilities from data — predict.FFTrees","title":"Predict classification outcomes or probabilities from data — predict.FFTrees","text":"predict.FFTrees predicts binary classification outcomes probabilities newdata FFTrees object.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/predict.FFTrees.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Predict classification outcomes or probabilities from data — predict.FFTrees","text":"","code":"# S3 method for class 'FFTrees' predict( object = NULL, newdata = NULL, tree = 1, type = \"class\", sens.w = NULL, method = \"laplace\", data = NULL, ... )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/predict.FFTrees.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Predict classification outcomes or probabilities from data — predict.FFTrees","text":"object FFTrees object created FFTrees function. newdata dataframe. data frame test data. tree integer. tree object used? default, tree = 1 used. type string. predicted? Can \"class\", returns vector class predictions, \"prob\" returns matrix class probabilities, \"\" returns matrix class probability predictions. sens.w, data deprecated method string. Method calculating class probabilities. Either 'laplace', applies Laplace correction, 'raw' applies correction. ... Additional arguments passed predict.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/predict.FFTrees.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Predict classification outcomes or probabilities from data — predict.FFTrees","text":"Either logical vector predictions, matrix class probabilities.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/predict.FFTrees.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Predict classification outcomes or probabilities from data — predict.FFTrees","text":"","code":"# Create training and test data: set.seed(100) breastcancer <- breastcancer[sample(nrow(breastcancer)), ] breast.train <- breastcancer[1:150, ] breast.test <- breastcancer[151:303, ] # Create an FFTrees object from the training data: breast.fft <- FFTrees( formula = diagnosis ~ ., data = breast.train ) #> ✔ Created an FFTrees object. #> Ranking 9 cues: ■■■■■■■■■■■■■■■■■■■■■■■■ 78% | ETA: 0s #> Ranking 9 cues: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s #> #> ✔ Ranked 9 cues (optimizing 'bacc'). #> ✔ Created 6 FFTs with 'ifan' algorithm (chasing 'bacc'). #> ✔ Defined 6 FFTs. #> ✔ Applied 6 FFTs to 'train' data. #> ✔ Ranked 6 FFTs by 'train' data. #> ✔ Expressed 6 FFTs in words. # Predict classification outcomes for test data: breast.fft.pred <- predict(breast.fft, newdata = breast.test ) #> ✔ Applied 6 FFTs to 'test' data. #> ✔ Generated predictions for tree 1. # Predict class probabilities for test data: breast.fft.pred <- predict(breast.fft, newdata = breast.test, type = \"prob\" ) #> ✔ Applied 6 FFTs to 'test' data. #> ✔ Generated predictions for tree 1."},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/print.FFTrees.html","id":null,"dir":"Reference","previous_headings":"","what":"Print basic information of fast-and-frugal trees (FFTs) — print.FFTrees","title":"Print basic information of fast-and-frugal trees (FFTs) — print.FFTrees","text":"print.FFTrees prints basic information FFTs FFTrees object x. x may contain test data, print.FFTrees default prints performance characteristics training data (.e., fitting), rather test data (.e., prediction). test data available, specify data = \"test\" print prediction performance.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/print.FFTrees.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print basic information of fast-and-frugal trees (FFTs) — print.FFTrees","text":"","code":"# S3 method for class 'FFTrees' print(x = NULL, tree = 1, data = \"train\", ...)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/print.FFTrees.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print basic information of fast-and-frugal trees (FFTs) — print.FFTrees","text":"x FFTrees object created FFTrees. tree tree printed (integer, valid corresponding tree argument non-empty). Default: tree = 1. print best training best test tree respect goal specified FFT construction, use \"best.train\" \"best.test\", respectively. data type data x printed (string) test dataset (data frame). valid data string must either 'train' (fitting performance) 'test' (prediction performance). valid data frame, specified tree evaluated printed data ('test' data), global FFTrees object x remains unchanged unless re-assigned. default, data = 'train' (x may contain test data). ... additional arguments passed print.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/print.FFTrees.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print basic information of fast-and-frugal trees (FFTs) — print.FFTrees","text":"invisible FFTrees object x summary information FFT printed console (side effect).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/read_fft_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Read an FFT definition from tree definitions — read_fft_df","title":"Read an FFT definition from tree definitions — read_fft_df","text":"read_fft_df reads returns definition single FFT (tidy data frame) multi-line FFT definitions FFTrees object. read_fft_df allows reading individual tree definitions manipulate tree trimming functions. write_fft_df provides inverse functionality.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/read_fft_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read an FFT definition from tree definitions — read_fft_df","text":"","code":"read_fft_df(ffts_df, tree = 1)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/read_fft_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read an FFT definition from tree definitions — read_fft_df","text":"ffts_df set FFT definitions (data frame, usually FFTrees object, suitable variable names pass verify_ffts_df. tree ID --selected FFT (integer), corresponding tree ffts_df. Default: tree = 1.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/read_fft_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read an FFT definition from tree definitions — read_fft_df","text":"One FFT definition (data frame tidy format, one row per node).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/reorder_nodes.html","id":null,"dir":"Reference","previous_headings":"","what":"Reorder nodes in an FFT definition — reorder_nodes","title":"Reorder nodes in an FFT definition — reorder_nodes","text":"reorder_nodes allows reordering nodes existing FFT definition (tidy data frame format). reorder_nodes allows directly set change node order FFT definition specifying nodes. former non-final node becomes final node, exit type former final node set signal value (.e., exit_types[2]).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/reorder_nodes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reorder nodes in an FFT definition — reorder_nodes","text":"","code":"reorder_nodes(fft, order = NA, quiet = FALSE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/reorder_nodes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reorder nodes in an FFT definition — reorder_nodes","text":"fft One FFT definition (data frame tidy format, one row per node). order desired node order (integer vector). values order must permutation 1:nrow(fft). Default: order = NA. quiet Hide feedback messages (logical)? Default: quiet = FALSE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/reorder_nodes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reorder nodes in an FFT definition — reorder_nodes","text":"One FFT definition (data frame tidy format, one row per node).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/select_nodes.html","id":null,"dir":"Reference","previous_headings":"","what":"Select nodes from an FFT definition — select_nodes","title":"Select nodes from an FFT definition — select_nodes","text":"select_nodes selects one nodes existing FFT definition (filtering corresponding row(s) FFT definition tidy data frame format). selecting final node, last selected node becomes new final node (.e., gains second exit). Duplicates nodes selected (rather incrementally) nodes range 1:nrow(fft) ignored. select_nodes inverse function drop_nodes.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/select_nodes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select nodes from an FFT definition — select_nodes","text":"","code":"select_nodes(fft, nodes = NA, quiet = FALSE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/select_nodes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select nodes from an FFT definition — select_nodes","text":"fft One FFT definition (data frame tidy format, one row per node). nodes FFT nodes select (integer vector). Default: nodes = NA. quiet Hide feedback messages (logical)? Default: quiet = FALSE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/select_nodes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Select nodes from an FFT definition — select_nodes","text":"One FFT definition (data frame tidy format, one row per node).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/showcues.html","id":null,"dir":"Reference","previous_headings":"","what":"Visualize cue accuracies (as points in ROC space) — showcues","title":"Visualize cue accuracies (as points in ROC space) — showcues","text":"showcues plots cue accuracies FFTrees object created FFTrees function (points ROC space). optional arguments cue.accuracies alt.goal specified, values take precedence corresponding settings FFTrees object x (change x). showcues called main plot.FFTrees function set = \"cues\".","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/showcues.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Visualize cue accuracies (as points in ROC space) — showcues","text":"","code":"showcues( x = NULL, cue.accuracies = NULL, alt.goal = NULL, main = NULL, top = 5, quiet = list(ini = TRUE, fin = FALSE, set = TRUE), ... )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/showcues.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Visualize cue accuracies (as points in ROC space) — showcues","text":"x FFTrees object created FFTrees function. cue.accuracies optional data frame specifying cue accuracies directly (without specifying FFTrees object x). alt.goal optional alternative goal sort current cue accuracies (without using goal FFTrees object x). main main plot title (character string). top many top cues highlighted (integer)? quiet user feedback messages suppressed (list 3 logical arguments)? Default: quiet = list(ini = TRUE, fin = FALSE, set = FALSE). ... Graphical parameters (passed plot).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/showcues.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Visualize cue accuracies (as points in ROC space) — showcues","text":"plot showing cue accuracies (FFTrees object) (points ROC space).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/showcues.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Visualize cue accuracies (as points in ROC space) — showcues","text":"","code":"# Create fast-and-frugal trees (FFTs) for heart disease: heart.fft <- FFTrees(formula = diagnosis ~ ., data = heart.train, data.test = heart.test, main = \"Heart Disease\", decision.labels = c(\"Healthy\", \"Diseased\") ) #> ✔ Created an FFTrees object. #> ✔ Ranked 13 cues (optimizing 'bacc'). #> ✔ Created 7 FFTs with 'ifan' algorithm (chasing 'bacc'). #> ✔ Defined 7 FFTs. #> ✔ Applied 7 FFTs to 'train' data. #> ✔ Ranked 7 FFTs by 'train' data. #> ✔ Applied 7 FFTs to 'test' data. #> ✔ Expressed 7 FFTs in words. # Show cue accuracies (in ROC space): showcues(heart.fft, main = \"Predicting heart disease\") #> Plotting cue training statistics: #> — Cue accuracies ranked by bacc #>"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/sonar.html","id":null,"dir":"Reference","previous_headings":"","what":"Sonar data — sonar","title":"Sonar data — sonar","text":"file contains patterns sonar signals bounced metal cylinder bounced roughly cylindrical rock various angles various conditions. transmitted sonar signal frequency-modulated chirp, rising frequency.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/sonar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sonar data — sonar","text":"","code":"sonar"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/sonar.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Sonar data — sonar","text":"data frame containing 208 rows 60 columns. V1 Number range 0.0 1.0 represents energy within particular frequency band, integrated certain period time. V2 (see V1) V3 (see V1) V4 (see V1) V5 (see V1) V6 (see V1) V7 (see V1) V8 (see V1) V9 (see V1) V10 (see V1) V11 (see V1) V12 (see V1) V13 (see V1) V14 (see V1) V15 (see V1) V16 (see V1) V17 (see V1) V18 (see V1) V19 (see V1) V20 (see V1) V21 (see V1) V22 (see V1) V23 (see V1) V24 (see V1) V25 (see V1) V26 (see V1) V27 (see V1) V28 (see V1) V29 (see V1) V30 (see V1) V31 (see V1) V32 (see V1) V33 (see V1) V34 (see V1) V35 (see V1) V36 (see V1) V37 (see V1) V38 (see V1) V39 (see V1) V40 (see V1) V41 (see V1) V42 (see V1) V43 (see V1) V44 (see V1) V45 (see V1) V46 (see V1) V47 (see V1) V48 (see V1) V49 (see V1) V50 (see V1) V51 (see V1) V52 (see V1) V53 (see V1) V54 (see V1) V55 (see V1) V56 (see V1) V57 (see V1) V58 (see V1) V59 (see V1) V60 (see V1) mine.crit Criterion: sonar signal bounce metal cylinder (rock)? Values: TRUE (metal cylinder) vs. FALSE (rock) (53.37% vs.\\ 46.63%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/sonar.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Sonar data — sonar","text":"https://archive.ics.uci.edu/ml/datasets/Connectionist+Bench+(Sonar,+Mines+vs.+Rocks)","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/sonar.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Sonar data — sonar","text":"made following enhancements original data improved usability: binary factor criterion variable exclusive \"m\" \"r\" values converted logical TRUE/FALSE vector. , data remains consistent original dataset.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/sonar.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Sonar data — sonar","text":"Gorman, R. P., Sejnowski, T. J. (1988). Analysis hidden units layered network trained classify sonar targets. Neural Networks, 1, pp. 75–89.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/summary.FFTrees.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize an FFTrees object — summary.FFTrees","title":"Summarize an FFTrees object — summary.FFTrees","text":"summary.FFTrees summarizes key contents FFTrees object.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/summary.FFTrees.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize an FFTrees object — summary.FFTrees","text":"","code":"# S3 method for class 'FFTrees' summary(object, tree = NULL, ...)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/summary.FFTrees.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize an FFTrees object — summary.FFTrees","text":"object FFTrees object. tree tree summarize (integer, may vector). tree = NULL (per default) exceeding possible range 1:object$trees$n, information trees object returned. ... Additional arguments (currently ignored).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/summary.FFTrees.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarize an FFTrees object — summary.FFTrees","text":"invisible list elements containing definitions performance stats FFT(s) specified tree(s).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/summary.FFTrees.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Summarize an FFTrees object — summary.FFTrees","text":"Given FFTrees object x, summary.FFTrees selects key parameters x$params provides definitions performance statistics tree x$trees. Inspect query x additional details. summary.FFTrees returns invisible list containing two elements: definitions corresponding performance measures trees; stats decision frequencies, derived probabilities, costs (separated train test). header prints descriptive information FFTrees object (console): main title, number trees (object$trees$n), name criterion variable (object$criterion_name). Per default, information available trees shown returned. Specifying tree filters output list elements corresponding tree(s). single tree specified, printed header includes verbal description corresponding tree. summary.FFTrees provides key details specified tree(s), individual decisions (stored object$trees$decisions) shown returned.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/titanic.html","id":null,"dir":"Reference","previous_headings":"","what":"Titanic survival data — titanic","title":"Titanic survival data — titanic","text":"Data indicating survived Titanic.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/titanic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Titanic survival data — titanic","text":"","code":"titanic"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/titanic.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Titanic survival data — titanic","text":"data frame containing 2,201 rows 4 columns. class Factor - Class (first, second, third, crew) age Factor - Age group (child adult) sex Factor - Sex (male female) survived Logical - Whether passenger survived (TRUE) (FALSE)","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/titanic.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Titanic survival data — titanic","text":"https://www.encyclopedia-titanica.org","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/titanic.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Titanic survival data — titanic","text":"See Titanic R datasets package details data (4-dimensional table).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/titanic.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Titanic survival data — titanic","text":"Dawson, Robert J. MacG. (1995). ‘Unusual Episode’ Data Revisited. Journal Statistics Education, 3. https://doi.org/10.1080/10691898.1995.11910499.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/voting.html","id":null,"dir":"Reference","previous_headings":"","what":"Voting data — voting","title":"Voting data — voting","text":"dataset votes U.S. House Representatives Congressmen 16 key votes identified CQA.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/voting.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Voting data — voting","text":"","code":"voting"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/voting.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Voting data — voting","text":"data frame containing 435 rows 16 columns. handicapped handicapped-infants, logical (TRUE, FALSE) water water-project-cost-sharing, logical (TRUE, FALSE) adoption adoption---budget-resolution, logical (TRUE, FALSE) physician physician-fee-freeze, logical (TRUE, FALSE) elsalvador el-salvador-aid, logical (TRUE, FALSE) religionschool religious-groups--schools, logical (TRUE, FALSE) satellite anti-satellite-test-ban, logical (TRUE, FALSE) nicaraguan aid--nicaraguan-contras, logical (TRUE, FALSE) mxmissile mxmissile, logical (TRUE, FALSE) immigration immigration, logical (TRUE, FALSE) synfuels synfuels-corporation-cutback, logical (TRUE, FALSE) education education-spending, logical (TRUE, FALSE) superfund superfund-right--sue, logical (TRUE, FALSE) crime crime, logical (TRUE, FALSE) dutyfree duty-free-exports, logical (TRUE, FALSE) southafrica export-administration-act-south-africa, logical (TRUE, FALSE) party.crit Criterion: voters democratic (republican) congressmen? Values: TRUE (democrat) / FALSE (republican) (61.52% vs. 38.48%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/voting.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Voting data — voting","text":"https://archive.ics.uci.edu/ml/datasets/Congressional+Voting+Records","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/voting.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Voting data — voting","text":"CQA lists nine different types votes: Voted , paired , announced (three simplified yea), voted , paired , announced (three simplified nay), voted present, voted present avoid conflict interest, vote otherwise make position known (three simplified unknown disposition). made following enhancements original data improved usability: missing values, denoted \"?\" dataset, transformed NAs. Binary factor variables exclusive \"y\" \"n\" values converted logical TRUE/FALSE vectors. binary character criterion variable exclusive \"democrat\" \"republican\" values converted logical TRUE/FALSE vector. , data remains consistent original dataset.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/voting.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Voting data — voting","text":"Congressional Quarterly Almanac, 98th Congress, 2nd session 1984, Congressional Quarterly Inc., Volume XL. Washington, D.C., 1985.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/wine.html","id":null,"dir":"Reference","previous_headings":"","what":"Wine tasting data — wine","title":"Wine tasting data — wine","text":"Chemical tasting data wines Northern Portugal.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/wine.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wine tasting data — wine","text":"","code":"wine"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/wine.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Wine tasting data — wine","text":"data frame containing 6497 rows 13 columns. fixed.acidity fixed acidity (nummeric) volatile.acidity volatile acidity (nummeric) citric.acid citric acid (nummeric) residual.sugar residual sugar (nummeric) chlorides chlorides (nummeric) free.sulfur.dioxide free sulfur dioxide (nummeric) total.sulfur.dioxide total sulfur dioxide (nummeric) density density (nummeric) pH PH Value (nummeric) sulphates Sulphates (nummeric) alcohol Alcohol (nummeric) quality Quality (nummeric, score 0 10) type Criterion: wine red white? (24.61% vs.75.39%)","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/wine.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Wine tasting data — wine","text":"http://archive.ics.uci.edu/ml/datasets/Wine+Quality","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/wine.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Wine tasting data — wine","text":"P. Cortez, . Cerdeira, F. Almeida, T. Matos J. Reis (2009). Modeling wine preferences data mining physicochemical properties. Decision Support Systems, 47 (4), 547–553. https://doi.org/10.1016/j.dss.2009.05.016","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/write_fft_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Write an FFT definition to tree definitions — write_fft_df","title":"Write an FFT definition to tree definitions — write_fft_df","text":"write_fft_df writes definition single FFT (tidy data frame) one-line FFT definition used FFTrees object. write_fft_df allows turning individual tree definitions one-line FFT definition format used FFTrees object. read_fft_df provides inverse functionality.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/write_fft_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Write an FFT definition to tree definitions — write_fft_df","text":"","code":"write_fft_df(fft, tree = -99L)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/write_fft_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Write an FFT definition to tree definitions — write_fft_df","text":"fft One FFT definition (data frame tidy format, one row per node). tree ID --written FFT (integer). Default: tree = -99L.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/write_fft_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Write an FFT definition to tree definitions — write_fft_df","text":"FFT definition one line FFT definition format used FFTrees object (data frame).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"fftrees-2009000","dir":"Changelog","previous_headings":"","what":"FFTrees 2.0.0.9000","title":"FFTrees 2.0.0.9000","text":"current development version FFTrees, available https://github.com/ndphillips/FFTrees.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"breaking-changes-2-0-0-9000","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"FFTrees 2.0.0.9000","text":"Deprecated applications non-FFT competitive algorithms (.e., LR, SVM, RF) FFT creation. now , consider using packages parsnip tidymodels create evaluate models.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"major-changes-2-0-0-9000","dir":"Changelog","previous_headings":"","what":"Major changes","title":"FFTrees 2.0.0.9000","text":"Added support handling NA values.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"minor-changes-2-0-0-9000","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"FFTrees 2.0.0.9000","text":"Plotting: plot.FFTrees() now labels row 2x2 confusion matrix “Prediction” using “test” data. plot.FFTrees() now truth.labels argument , set, distinguishes labels true (signal vs. noise) cases decision outcomes. plot.FFTrees() now grayscale argument , TRUE, creates grayscale plot. Decision costs: Increased value cost_cues_default 0 1, default cue costs correspond mcu.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"details-2-0-0-9000","dir":"Changelog","previous_headings":"","what":"Details","title":"FFTrees 2.0.0.9000","text":"Fix bug missing plot title. Added @aliases FFTrees-package documentation main FFTrees() function. Removed redundant data_old folder.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"fftrees-200","dir":"Changelog","previous_headings":"","what":"FFTrees 2.0.0","title":"FFTrees 2.0.0","text":"CRAN release: 2023-06-05 FFTrees version 2.0.0 released CRAN [2023-06-06]. version adds functionality, improves consistency, increases robustness. Changes since last release:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"major-changes-2-0-0","dir":"Changelog","previous_headings":"","what":"Major changes","title":"FFTrees 2.0.0","text":"tree definition conversion functions: get_fft_df, read_fft_df, write_fft_df, add_fft_df tree trimming functions: add_nodes, drop_nodes, edit_nodes, flip_exits, reorder_nodes, select_nodes enabled stopping.rule = \"statdelta\" fixed bug fftrees_grow_fan() prevented ifan algorithm stopping finding perfect FFT (given current goal.chase parameter) NA values categorical (.e., character/factor/logical) predictors treated factor levels NA values numeric predictors either ignored (default) imputed (mean corresponding predictor) creating using FFTs decide/predict (possible) NA values criterion variable yet dealt ","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"minor-changes-2-0-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"FFTrees 2.0.0","text":"get_best_tree() retrieves ID best tree FFTrees object (given goal) get_exit_type() converts vector exit descriptions FFT exits (given exit_types) get_fft_df() retrieves tree definitions FFTrees object Added cost information printing FFTs (print.FFTrees()). Improved user feedback (making quiet list four options). Increased vocabulary interpreting verbal FFT descriptions (using .tree). Improved documentation included data (e.g., FFTrees.guide()).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"details-2-0-0","dir":"Changelog","previous_headings":"","what":"Details","title":"FFTrees 2.0.0","text":"Added global constants utility functions. Added progress bar cli package (removing dependency progress). Added exit_types global constant. Improved data cleaning (consistent training test data). Revised documentation, vignettes, tests.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_190-1-9","dir":"Changelog","previous_headings":"","what":"1.9.0","title":"FFTrees 1.9","text":"FFTrees version 1.9.0 released CRAN [2023-02-08]. Apart adding functionality fixing minor bugs, version improves consistency, robustness, transparency. Changes since last release:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"major-changes-1-9","dir":"Changelog","previous_headings":"1.9.0","what":"Major changes","title":"FFTrees 1.9","text":"Enabled optimizing user-defined .goal cue tree levels (defined .goal.fun). Enabled optimizing dprime cue tree levels (using \"dprime\" goal.threshold, goal.chase, goal values). Increased vocabulary interpreting verbal FFT descriptions (using .tree). Included current goal cost values (\"cost\" occurs goals). Included criterion base rates (performance statistics train test data).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"minor-changes-1-9","dir":"Changelog","previous_headings":"1.9.0","what":"Minor changes","title":"FFTrees 1.9","text":"Included dprime values cue level statistics (x$cues$thresholds x$cues$stats). Included dprime values competition statistics (x$competition$train x$competition$test). Improved user feedback combinations goal cost values. Prepared modular tree translation editing functions (util_gfft.R). Prepared global tree notation separator (fft_node_sep). Added decision outcome cue costs asif_results (fftrees_grow_fan()).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"details-1-9","dir":"Changelog","previous_headings":"1.9.0","what":"Details","title":"FFTrees 1.9","text":"Added verification functions (checking integrity objects validity inputs). Deprecated rounding argument FFTrees(). Re-arranged arguments key functions (FFTrees() fftrees_create()) functionality. Re-arranged cleaned code (main helper functions). Re-defined local constants global constants (util_const.R). Revised status badges README. Tweaked plotting parameters. Fixed bugs revised vignettes.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_180-1-8","dir":"Changelog","previous_headings":"","what":"1.8.0","title":"FFTrees 1.8","text":"FFTrees version 1.8.0 released CRAN [2023-01-06]. version mostly extends improves existing functionality. Changes since last release:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"major-changes-1-8","dir":"Changelog","previous_headings":"1.8.0","what":"Major changes","title":"FFTrees 1.8","text":"Enabled manually defining FFTs tree.definitions using FFTs object FFTrees(). Enabled setting goal = 'dprime' select FFTs FFTrees(). Added improved user feedback (quiet = FALSE).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"minor-changes-1-8","dir":"Changelog","previous_headings":"1.8.0","what":"Minor changes","title":"FFTrees 1.8","text":"Show n.per.icon legend = 'icontree'. Bug fix: Removed clipping titles labels. Tweaked spacing parameters. Trimmed white space elements tree definitions (fftrees_apply.R). Added check cues occur current data (verify_all_cues_in_data()).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"details-1-8","dir":"Changelog","previous_headings":"1.8.0","what":"Details","title":"FFTrees 1.8","text":"Removed anova stats imports. Replaced expect_is() precise testthat inheritance functions. Replaced crayon package cli package. Revised documentation vignettes. Fixed bugs revised code increase robustness.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_175-1-7","dir":"Changelog","previous_headings":"","what":"1.7.5","title":"FFTrees 1.7","text":"FFTrees version 1.7.5 released CRAN [2022-09-15]. version contains mostly bug fixes, also improves revises existing functionality. Changes since last release:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"major-changes-1-7","dir":"Changelog","previous_headings":"1.7.5","what":"Major changes","title":"FFTrees 1.7","text":"Added distinctions FFTs “decide” vs. “predict” using corresponding labels plots verbal descriptions. Improved plotting printing FFTs (plot.FFTrees() print.FFTrees()): Added new plotting options (e.g., = '' vs. = 'tree' = 'icontree'). Added distinction header icon guide FFTs “decide” (training data) vs. “predict” (test data). Enabled applying tree new test data providing data frame data. Enabled passing graphical parameters (e.g., col, font, adj) text panel titles. Return invisible FFTrees object x (allow re-assigning global x using new test data).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"minor-changes-1-7","dir":"Changelog","previous_headings":"1.7.5","what":"Minor changes","title":"FFTrees 1.7","text":"Added wacc measures computed competing algorithms. Plotting plot.FFTrees(): Adjusted space title width main argument. Deprecated stats argument. Moved utility functions helper_plot.R.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"details-1-7","dir":"Changelog","previous_headings":"1.7.5","what":"Details","title":"FFTrees 1.7","text":"Revised documentation vignettes. Renamed internal functions variables.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_170-1-7","dir":"Changelog","previous_headings":"","what":"1.7.0","title":"FFTrees 1.7","text":"FFTrees version 1.7.0 released CRAN [2022-08-31]. version contains numerous bug fixes improves revises existing functionality. Changes since last release:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"major-changes-1-7-1","dir":"Changelog","previous_headings":"1.7.0","what":"Major changes","title":"FFTrees 1.7","text":"Added data argument print FFT’s training performance (default) prediction performance (test data available). Enabled setting tree \"best.train\" \"best.test\" (plotting FFTs). Reporting bacc wacc Accuracy section (sens.w, deviating default 0.50). Improved readability 2x2 confusion table (right-justifying digits). Moved cost information Accuracy Speed, Frugality, Cost section. Improved plot = 'ROC' analogous = 'cues'. Reporting bacc wacc Accuracy section (sens.w value, deviating default 0.50). Fixed bug re-enable setting tree \"best.train\" \"best.test\". Fixed bug show correct point labels ROC curve panel. Using current goal object x cue ranking criterion (rather always using wacc). Subtitle now shows sens.w value goal == 'wacc'. Cue legend now accommodates 0 < top < 10. Removed redundant data argument (FFTrees objects contain cue training data). Added alt.goal argument (allow ranking cue accuracies alternative goals). Added quiet argument (hide feedback messages). Added subtitle (signal current cue accuracy ranking criterion). Print tree performance summary goal information (console). Return tree definitions stats (list). Fixed bug forced reversals final exits final node manually creating FFTs .tree fftrees_wordstofftrees().","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"minor-changes-1-7-1","dir":"Changelog","previous_headings":"1.7.0","what":"Minor changes","title":"FFTrees 1.7","text":"Changed tree statistics test data data frames tibbles. Improved feedback missing decision labels creating FFTs descriptions .tree fftrees_wordstofftrees(). Deprecated store.data argument FFTrees().","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"details-1-7-1","dir":"Changelog","previous_headings":"1.7.0","what":"Details","title":"FFTrees 1.7","text":"Changed primary package maintainer Hansjoerg Neth, Nathaniel Phillips still board. Revised text, examples, links vignettes. Reduced clutter recycling code combining files. Cleanup code documentation.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"fftrees-16","dir":"Changelog","previous_headings":"","what":"FFTrees 1.6","title":"FFTrees 1.6","text":"FFTrees version 1.6.6 released CRAN [2022-07-18]. Changes since last release:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_166-1-6","dir":"Changelog","previous_headings":"","what":"1.6.6","title":"FFTrees 1.6","text":"Fixed bug causing plot.FFTrees() display plots properly.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_165-1-6","dir":"Changelog","previous_headings":"","what":"1.6.5","title":"FFTrees 1.6","text":"Cleanup get package back CRAN failed submission July 17, 2022.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_164-1-6","dir":"Changelog","previous_headings":"","what":"1.6.4","title":"FFTrees 1.6","text":"Cleanup get package back CRAN failed submission July 16, 2022.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_163-1-6","dir":"Changelog","previous_headings":"","what":"1.6.3","title":"FFTrees 1.6","text":"Additional cleanup get package back CRAN failed submission July 12, 2022.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_162-1-6","dir":"Changelog","previous_headings":"","what":"1.6.2","title":"FFTrees 1.6","text":"Internal cleanup get package back CRAN.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_161-1-6","dir":"Changelog","previous_headings":"","what":"1.6.1","title":"FFTrees 1.6","text":"plot.FFTrees() longer saves graphic params changed par(). plot.FFTRrees(): test = 'best.test' test data provided, information text returned message() rather print(). Deprecation notes plot.FFTrees() now returned warnings, messages.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_157-1-5","dir":"Changelog","previous_headings":"","what":"1.5.7","title":"FFTrees 1.5","text":"Officially deprecated \"max\" \"zigzag\" algorithms. Minor cleanup throughout.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_150-1-5","dir":"Changelog","previous_headings":"","what":"1.5.0","title":"FFTrees 1.5","text":"Fixed warnings CRAN submission. FFTrees objects now nicer internal structure. Added tests throughout (finally). Extensive code cleanup, speed things . New print method includes ASCII confusion matrix.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_140-1-4","dir":"Changelog","previous_headings":"","what":"1.4.0","title":"FFTrees 1.4","text":"Big hood changes make code efficient (prepare C++). Code ~50% faster. Many inputs cost.cues cost.outcomes now specified named lists avoid confusion. New cost outputs separate costs cues, outcomes, total costs. Changes input defaults goal goal.chase.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_136-1-3","dir":"Changelog","previous_headings":"","what":"1.3.6","title":"FFTrees 1.3","text":"Bug fixes.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_135-1-3","dir":"Changelog","previous_headings":"","what":"1.3.5","title":"FFTrees 1.3","text":"Bug fixes.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_134-1-3","dir":"Changelog","previous_headings":"","what":"1.3.4","title":"FFTrees 1.3","text":"Added class probability predictions predict.FFTrees(type = \"prob\"). Updated print.FFTrees() display FFT #1 ‘words’ (inwords(x) function).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_133-1-3","dir":"Changelog","previous_headings":"","what":"1.3.3","title":"FFTrees 1.3","text":"Added show.X arguments plot.FFTrees() allow selectively turn turn elements plotting FFTrees object. Added label.tree, label.performance arguments plot.FFTrees() allow specify plot (sub) labels. Bug fixes: Issues passing existing FFTrees object new call FFTrees().","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_130-1-3","dir":"Changelog","previous_headings":"","what":"1.3.0","title":"FFTrees 1.3","text":"Many additional vignettes (e.g.; Accuracy Statistics Heart Disease Tutorial) updates existing vignettes. Added cost.outcomes cost.cues allow user specify specify cost outcomes cues. Also added cost statistic throughout outputs. Added inwords(), function converts FFTrees object words. Added .tree argument FFTrees() allows user specify FFT verbally. E.g., .tree = 'age > 30, predict True. sex = {m}, predict False. Otherwise, predict True'. Added positive predictive value ppv, negative predictive value npv balanced predictive value bpv, primary accuracy statistics throughout. Added support two FFT construction algorithms Martignon et al. (2008): \"zigzag\" \"max\". algorithms contained file heuristic_algorithm.R can implemented FFTrees() arguments algorithm.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_123-1-2","dir":"Changelog","previous_headings":"","what":"1.2.3","title":"FFTrees 1.2","text":"Added sens.w argument allow differential weighting sensitivities specificities selecting applying trees. Fixed bug calculating importance weightings FFForest() outputs.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_120-1-2","dir":"Changelog","previous_headings":"","what":"1.2.0","title":"FFTrees 1.2","text":"Changed wording statistics throughout package: hr (hit rate) far (false alarm rate) (based classification frequency values hi  fa), now sens sensitivity spec specificity (1 −-far), respectively. rank.method argument now deprecated. Use algorithm instead. Added stats argument plot.FFTrees(). stats = FALSE, tree plotted without reference statistical output. Grouped competitive algorithm results (regression, cart, random forests, support vector machines) new x.fft$comp slot rather separate first level list algorithm. Also replaced separate algorithm wrappers one general comp_pred() wrapper function. Added FFForest(), function creating forests FFTs, plot.FFForest(), visualizing forests FFTs. (function experimental still development.) Added random forests support vector machines comparison FFTrees() using randomForest e1071 packages. Changed logistic regression algorithm default glm() version glmnet() regularized version. predict.FFTrees() now returns vector predictions specific tree rather creating entirely new FFTrees object. can now plot cue accuracies within plot.FFTrees() function including plot.FFTrees(= 'cues') argument. (replaces former showcues() function.) Many cosmetic changes plot.FFTrees() (e.g.; gray levels, distinct classification balls). can also control whether results competing algorithms displayed comp argument. Bug-fixes: Fixed bug levels classifications plotted correctly.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_117-1-1","dir":"Changelog","previous_headings":"","what":"1.1.7","title":"FFTrees 1.1","text":"Trees can now use cue multiple times within tree. , set rank.method = \"c\" repeat.cues = TRUE. Bug-fixes: can (!) now column NAs criterion test datasets represent data criterion unknown. FFTrees() now supports single predictor (e.g.; formula = diagnosis ~ age) previously work.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_116-1-1","dir":"Changelog","previous_headings":"","what":"1.1.6","title":"FFTrees 1.1","text":"Streamlined code improve cohesion functions. may cause issues FFTrees objects created earlier versions package. need re-created. Updated, clearer print.FFTrees() method see important info FFTrees object matrix format. Training testing statistics now separate objects (e.g., data$train vs. data$test) avoid confusion. Bug-fixes: predict.FFTrees() now works much better passing new dataset (data.test) test dataset existing FFTrees object.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_115-1-1","dir":"Changelog","previous_headings":"","what":"1.1.5","title":"FFTrees 1.1","text":"Plotting parameters mar layout now reset running plot.FFTrees()","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_114-1-1","dir":"Changelog","previous_headings":"","what":"1.1.4","title":"FFTrees 1.1","text":"Plotting longer fails one branch tree. Changed .tree argument plot.FFTrees() tree conform blog posts. predict.FFTrees() now works better tibble inputs. Changed fft label FFTrees throughout package avoid confusion fast fourier transform. Thus, main tree building function now FFTrees() new tree object class FFTrees. [File NEWS.md last updated 2024-09-04.]","code":""}] +[{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_accuracy_statistics.html","id":"accuracy-statistics-in-fftrees","dir":"Articles","previous_headings":"","what":"Accuracy Statistics in FFTrees","title":"Accuracy statistics in FFTrees","text":"vignette, cover accuracy statistics calculated FFTs FFTrees package (described Phillips et al., 2017). measures specific FFTs can used classification algorithm. First, let’s examine accuracy statistics FFT predicting heart disease: Running FFTrees() function call yields new FFTrees object heart.fft. printing plotting object particular dataset tree yields corresponding accuracy frugality statistics. now, simply plot best training tree: Figure 1: Example FFT heartdisease data. notice 2x2 table bottom-left corner plot: 2 x 2 matrix confusion table (see Wikipedia Neth et al., 2021 details). wide range accuracy measures can derived seemingly simple matrix. generic version confusion table: Figure 2: 2x2 matrix illustrating frequency counts 4 possible outcomes. 2 x 2 matrix cross-tabulates decisions algorithm (rows) actual criterion values (columns) contains counts observations four resulting cells. Counts cells  d refer correct decisions due match predicted criterion values, whereas counts cells b  c refer errors due mismatch predicted criterion values. correct decisions errors come two types: Correct decisions cell hi represent hits, positive criterion values correctly predicted positive, cell cr represents correct rejections, negative criterion values correctly predicted negative. errors, cell fa represents false alarms, negative criterion values erroneously predicted positive, cell mi represents misses, positive criterion values erroneously predicted negative. Given structure, accurate decision algorithm aims maximize frequencies cells hi  cr minimizing cells fa  mi. Table 1: Definitions frequency counts 2x2 confusion table. notation N()N() means number cases (frequency counts).","code":"# Create an FFTrees object predicting heart disease: heart.fft <- FFTrees(formula = diagnosis ~., data = heartdisease) plot(heart.fft, tree = \"best.train\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_accuracy_statistics.html","id":"conditional-accuracy-statistics","dir":"Articles","previous_headings":"Accuracy Statistics in FFTrees","what":"Conditional accuracy statistics","title":"Accuracy statistics in FFTrees","text":"first set accuracy statistics based subsets data. subsets result focusing particular cases interest computing conditional probabilities based . Given 2x2 structure confusion table, measures can conditional either algorithm decisions (positive predictive vs. negative predictive values) criterion values (sensitivity vs. specificity). words, measures conditional probabilities based either rows columns confusion table: Table 2: Conditional accuracy statistics based either rows columns 2x2 confusion table. sensitivity (aka. hit-rate) defined sens=hi/(hi+mi)sens = hi/(hi + mi) represents percentage cases positive criterion values correctly predicted algorithm. Similarly, specificity (aka. correct rejection rate, complement false alarm rate) defined spec=cr/(fa+cr)spec = cr/(fa + cr) represents percentage cases negative criterion values correctly predicted algorithm. positive-predictive value ppvppv negative predictive value npvnpv flip-sides  senssens specspec, conditional accuracies based decision outcomes (rather true criterion values).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_accuracy_statistics.html","id":"aggregate-accuracy-statistics","dir":"Articles","previous_headings":"Accuracy Statistics in FFTrees","what":"Aggregate accuracy statistics","title":"Accuracy statistics in FFTrees","text":"Additional accuracy statistics based four cells confusion table: Table 3: Aggregate accuracy statistics based four cells 2x2 confusion table. Overall accuracy (acc) defined overall percentage correct decisions ignoring difference hits correct rejections. specific measures baccbacc  waccwacc averages sensitivity specificity,  bpvbpv average predictive values. dprimedprime measure difference standardized (zz-score) transformed senssens  farfar(see Luan et al., 2011 relation FFTs signal detection theory, SDT).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_accuracy_statistics.html","id":"speed-and-frugality-statistics","dir":"Articles","previous_headings":"Accuracy Statistics in FFTrees","what":"Speed and frugality statistics","title":"Accuracy statistics in FFTrees","text":"next two statistics measure speed frugality fast--frugal tree (FFT). Unlike accuracy statistics , based confusion table. Rather, depend much information FFTs use make predictions decisions. Table 4: Measures quantify speed frugality FFTs. see exactly statistics come , let’s look results heart.fft (Tree #1): According output, Tree #1 mcu = 1.73 pci = 0.87. can easily calculate measures directly x$levelout output FFTrees object. object contains tree level (.e., node) case classified: Now, calculate mcu (mean number cues used), simply take mean vector: Now know  mcu comes , computing pci (.e., percentage cues ignored) just simple — ’s just total number cues dataset minus mcu, divided total number cues data:","code":"heart.fft #> FFTrees #> - Trees: 7 fast-and-frugal trees predicting diagnosis #> - Cost of outcomes: hi = 0, fa = 1, mi = 1, cr = 0 #> - Cost of cues: #> age sex cp trestbps chol fbs restecg thalach #> 1 1 1 1 1 1 1 1 #> exang oldpeak slope ca thal #> 1 1 1 1 1 #> #> FFT #1: Definition #> [1] If thal = {rd,fd}, decide True. #> [2] If cp != {a}, decide False. #> [3] If ca > 0, decide True, otherwise, decide False. #> #> FFT #1: Training Accuracy #> Training data: N = 303, Pos (+) = 139 (46%) #> #> | | True + | True - | Totals: #> |----------|--------|--------| #> | Decide + | hi 118 | fa 37 | 155 #> | Decide - | mi 21 | cr 127 | 148 #> |----------|--------|--------| #> Totals: 139 164 N = 303 #> #> acc = 80.9% ppv = 76.1% npv = 85.8% #> bacc = 81.2% sens = 84.9% spec = 77.4% #> #> FFT #1: Training Speed, Frugality, and Cost #> mcu = 1.73, pci = 0.87 #> cost_dec = 0.191, cost_cue = 1.733, cost = 1.924 # A vector of levels/nodes at which each case was classified: heart.fft$trees$decisions$train$tree_1$levelout #> [1] 1 3 1 2 2 2 3 3 1 1 1 2 1 1 1 2 1 3 2 2 2 2 2 1 1 2 2 2 3 1 2 1 2 1 2 3 1 #> [38] 1 1 2 1 1 2 2 3 1 2 1 2 2 2 1 3 2 1 1 1 1 2 2 1 2 1 2 1 1 2 1 1 2 2 1 1 1 #> [75] 3 2 1 2 2 1 3 3 2 1 2 2 2 2 3 2 3 1 1 2 2 1 1 1 2 3 3 2 3 2 1 1 1 1 1 1 1 #> [112] 3 1 1 1 1 2 3 1 1 1 1 2 1 2 2 1 1 2 3 1 1 2 3 2 2 1 1 1 2 2 1 2 1 1 2 1 2 #> [149] 2 2 1 3 1 1 3 3 1 1 1 1 1 3 2 3 2 1 2 2 1 2 1 1 3 3 1 1 1 1 2 2 1 1 2 1 3 #> [186] 2 1 1 1 1 2 1 1 3 2 3 2 3 2 2 3 3 1 1 1 1 1 1 2 3 2 1 2 1 3 1 2 3 3 3 2 2 #> [223] 2 1 3 2 3 2 3 3 2 3 2 2 2 3 1 1 2 2 2 2 3 2 2 3 1 3 1 2 1 1 1 2 3 2 3 2 2 #> [260] 1 2 2 2 2 3 1 3 1 1 2 1 1 1 3 2 1 2 2 2 3 1 2 1 2 1 1 1 1 1 2 1 2 1 1 3 2 #> [297] 1 1 1 1 1 2 2 # Calculate the mean number or cues used (mcu): mean(heart.fft$trees$decisions$train$tree_1$levelout) #> [1] 1.732673 # Calculate pci (percentage of cues ignored) as # (n.cues - mcu) / n.cues): n.cues <- ncol(heartdisease) (n.cues - heart.fft$trees$stats$train$mcu[1]) / n.cues #> [1] 0.8762376"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_accuracy_statistics.html","id":"additional-measures","dir":"Articles","previous_headings":"Accuracy Statistics in FFTrees","what":"Additional measures","title":"Accuracy statistics in FFTrees","text":"wide range additional measures can used quantify classification performance. can easily computed numerical information provided FFTrees object. alternative measures based frequency counts 2x2 matrix, see Table 3 Neth et al. (2021).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_accuracy_statistics.html","id":"vignettes","dir":"Articles","previous_headings":"","what":"Vignettes","title":"Accuracy statistics in FFTrees","text":"complete list vignettes available FFTrees package:","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"examples-of-ffts-with-fftrees","dir":"Articles","previous_headings":"","what":"Examples of FFTs with FFTrees","title":"Examples of FFTrees","text":"vignette illustrates construct fast--frugal trees (FFTs) additional datasets included FFTrees package. (See Phillips et al., 2017, comparison across 10 real-world datasets.)","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"mushrooms-data","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees","what":"Mushrooms data","title":"Examples of FFTrees","text":"mushrooms dataset contains data mushrooms (see ?mushrooms details). goal model predict mushrooms poisonous based 22 cues ranging mushroom’s odor, color, etc. first rows subset 10 potential predictors mushrooms data: Table 1: Binary criterion variable poisonous 10 potential predictors mushrooms data.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"creating-ffts","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees > Mushrooms data","what":"Creating FFTs","title":"Examples of FFTrees","text":"Let’s create trees using FFTrees()! ’ll use train.p = .50 argument split original data 5050% training set 5050% testing set: ’s basic information best performing FFT (Tree #1): Cool beans.","code":"# Create FFTs from the mushrooms data: set.seed(1) # for replicability of the training / test data split mushrooms_fft <- FFTrees(formula = poisonous ~., data = mushrooms, train.p = .50, # split data into 50:50 training/test subsets main = \"Mushrooms\", decision.labels = c(\"Safe\", \"Poison\")) # Print information about the best tree (during training): print(mushrooms_fft) #> Mushrooms #> FFTrees #> - Trees: 6 fast-and-frugal trees predicting poisonous #> - Cost of outcomes: hi = 0, fa = 1, mi = 1, cr = 0 #> - Cost of cues: #> cshape csurface ccolor bruises odor gattach gspace #> 1 1 1 1 1 1 1 #> gsize gcolor sshape sroot ssaring ssbring scaring #> 1 1 1 1 1 1 1 #> scbring vtype vcolor ringnum ringtype sporepc population #> 1 1 1 1 1 1 1 #> habitat #> 1 #> #> FFT #1: Definition #> [1] If odor != {f,s,y,p,c,m}, decide Safe. #> [2] If sporepc = {h,w,r}, decide Poison, otherwise, decide Safe. #> #> FFT #1: Training Accuracy #> Training data: N = 4,062, Pos (+) = 1,958 (48%) #> #> | | True + | True - | Totals: #> |----------|----------|----------| #> | Decide + | hi 1,683 | fa 0 | 1,683 #> | Decide - | mi 275 | cr 2,104 | 2,379 #> |----------|----------|----------| #> Totals: 1,958 2,104 N = 4,062 #> #> acc = 93.2% ppv = 100.0% npv = 88.4% #> bacc = 93.0% sens = 86.0% spec = 100.0% #> #> FFT #1: Training Speed, Frugality, and Cost #> mcu = 1.47, pci = 0.93 #> cost_dec = 0.068, cost_cue = 1.469, cost = 1.537"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"visualizing-cue-accuracies","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees > Mushrooms data","what":"Visualizing cue accuracies","title":"Examples of FFTrees","text":"Let’s look individual cue training accuracies plot(fft, = \"cues\"): looks like cues oder sporepc best predictors. fact, single cue odor hit rate  9797% false alarm rate nearly 00%! Based , expect final trees use just cues.","code":"# Plot the cue accuracies of an FFTrees object: plot(mushrooms_fft, what = \"cues\") #> Plotting cue training statistics: #> — Cue accuracies ranked by bacc #>"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"visualizing-fft-performance","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees > Mushrooms data","what":"Visualizing FFT performance","title":"Examples of FFTrees","text":"Now let’s plot performance best training tree applied test data: Indeed, looks like best tree uses  odor  sporepc cues. test dataset, tree false alarm rate  00% (1−1 - specificity), sensitivity (aka. hit rate)  8585%.","code":"# Plot the best FFT (for test data): plot(mushrooms_fft, data = \"test\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"trading-off-prediction-errors","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees > Mushrooms data","what":"Trading off prediction errors","title":"Examples of FFTrees","text":"considering implications predictions, fact FFT incurs many misses, false alarms, problematic: Given current task, failing detect poisonous mushrooms usually serious consequences falsely classifying poisonous. change balance possible errors, can select another tree set FFTs. case, FFT #2 use two cues, alter exit structure prediction incurs false alarms, misses. Alternatively, re-generate new set FFTs higher sensitivity weight value (e.g., increase default value  sens.w = .50  sens.w = .67) optimize FFTs’ weighted accuracy wacc.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"an-alternative-fft","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees > Mushrooms data","what":"An alternative FFT","title":"Examples of FFTrees","text":"Let’s assume famous mushroom expert insists FFT using wrong cues. According , best predictors poisonous mushrooms  ringtype  ringnum. test , build set FFTs cues check perform relative initial tree: , plot best training tree, predicting cases test dataset: can see, tree (mushrooms_ring_fft) sensitivity specificity values around 8080%, perform well earlier one (mushrooms_fft). suggests discard expert’s advice primarily rely  odor  sporepc cues.","code":"# Create trees using only the ringtype and ringnum cues: mushrooms_ring_fft <- FFTrees(formula = poisonous ~ ringtype + ringnum, data = mushrooms, train.p = .50, main = \"Mushrooms (ring cues)\", decision.labels = c(\"Safe\", \"Poison\")) # Plotting the best training FFT (for test data): plot(mushrooms_ring_fft, data = \"test\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"iris-v-data","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees","what":"Iris.v data","title":"Examples of FFTrees","text":"iris.v dataset contains data 150 flowers (see ?iris.v). goal predict flowers class Virginica. example, ’ll create trees using entire dataset (without splitting available data explicit training vs. test subsets), really fitting data, rather engaging genuine prediction: FFTrees package provides various functions inspect FFTrees object iris_fft. summary information best training tree, can print FTrees object (evaluating iris_fft print(iris_fft)). Alternatively, visualize tree (via plot(iris_fft)) summarize FFTrees object (via summary(iris_fft)): However, let’s first take look individual training cue accuracies…","code":"# Create FFTrees object for iris data: iris_fft <- FFTrees(formula = virginica ~., data = iris.v, main = \"Iris viginica\", decision.labels = c(\"Not-Vir\", \"Vir\")) # Inspect resulting FFTs: print(iris_fft) # summarize best training tree plot(iris_fft) # visualize best training tree summary(iris_fft) # summarize FFTrees object"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"visualizing-cue-accuracies-1","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees > Iris.v data","what":"Visualizing cue accuracies","title":"Examples of FFTrees","text":"can plot training cue accuracies training specifying = \"cues\": looks like two cues pet.len  pet.wid best predictors dataset. Based insight, expect final trees likely use one cues.","code":"# Plot cue values: plot(iris_fft, what = \"cues\") #> Plotting cue training statistics: #> — Cue accuracies ranked by bacc #>"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"visualizing-fft-performance-1","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees > Iris.v data","what":"Visualizing FFT performance","title":"Examples of FFTrees","text":"Now let’s visualize best tree: Indeed, turns best tree uses  pet.len  pet.wid cues (order). data, fitted tree exhibits performance sensitivity  100% specificity  94%.","code":"# Plot best FFT: plot(iris_fft)"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"viewing-alternative-ffts","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees > Iris.v data","what":"Viewing alternative FFTs","title":"Examples of FFTrees","text":"Now, tree quite well, someone wanted tree lowest possible false alarm rate? inspect ROC plot bottom right corner figure, see Tree #2 specificity close  100%. Let’s plot tree: can see, tree indeed higher specificity ( 98%), increase comes cost lower sensitivity ( 90%). trade-offs conflicting measures inevitable fitting predicting real-world data. Importantly, using FFTs FFTrees package help us render trade-offs transparent.","code":"# Plot FFT #2: plot(iris_fft, tree = 2)"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"titanic-data","dir":"Articles","previous_headings":"Examples of FFTs with FFTrees","what":"Titanic data","title":"Examples of FFTrees","text":"examples predict people’s survival Titanic disaster (growing FFTs titanic data), see Visualizing FFTs vignette.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_examples.html","id":"vignettes","dir":"Articles","previous_headings":"","what":"Vignettes","title":"Examples of FFTrees","text":"complete list vignettes available FFTrees package:","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"details-on-the-fftrees-function","dir":"Articles","previous_headings":"","what":"Details on the FFTrees() function","title":"Creating FFTs with FFTrees()","text":"vignette starts building fast--frugal tree (FFT) heartdisease data — also used Tutorial: FFTs heart disease Phillips et al. (2017) — explores additional aspects FFTrees() function. goal FFTrees() function create FFTs data record details problem specification, tree definitions, classification process, performance measures FFTrees object. FFTrees() can handle two sets data (training vs. testing) creates range FFTs, distinct process performance characteristics, evaluating function may take time (typically seconds) structure resulting FFTrees object quite complex. FFTrees() heart FFTrees package, pays understand arguments structure  FFTrees object.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"example-predicting-heart-disease","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Example: Predicting heart disease","title":"Creating FFTs with FFTrees()","text":"FFT generally addresses binary classification problems: attempts classify outcomes criterion variable one two classes (.e., True False) based range potential predictor variables (aka. cues features). corresponding problem domain clinical diagnostics : patient heart disease, given data patients’ general health diagnostic symptoms? address problem, FFTrees package includes heartdisease data. rather using full dataset fit FFTs, split data training set (heart.train), test set (heart.test). peak corresponding data frames: critical dependent variable (binary criterion variable) diagnosis. variable indicates whether patient heart disease (diagnosis = TRUE) (diagnosis = FALSE). variables dataset (e.g., sex, age, several biological measurements) can used predictors (aka. cues).","code":"# Training data: head(heart.train) #> # A tibble: 6 × 14 #> diagnosis age sex cp trestbps chol fbs restecg thalach exang oldpeak #> #> 1 FALSE 44 0 np 108 141 0 normal 175 0 0.6 #> 2 FALSE 51 0 np 140 308 0 hypert… 142 0 1.5 #> 3 FALSE 52 1 np 138 223 0 normal 169 0 0 #> 4 TRUE 48 1 aa 110 229 0 normal 168 0 1 #> 5 FALSE 59 1 aa 140 221 0 normal 164 1 0 #> 6 FALSE 58 1 np 105 240 0 hypert… 154 1 0.6 #> # ℹ 3 more variables: slope , ca , thal # Testing data: head(heart.test) #> # A tibble: 6 × 14 #> diagnosis age sex cp trestbps chol fbs restecg thalach exang oldpeak #> #> 1 FALSE 51 0 np 120 295 0 hypert… 157 0 0.6 #> 2 TRUE 45 1 ta 110 264 0 normal 132 0 1.2 #> 3 TRUE 53 1 a 123 282 0 normal 95 1 2 #> 4 TRUE 45 1 a 142 309 0 hypert… 147 1 0 #> 5 FALSE 66 1 a 120 302 0 hypert… 151 0 0.4 #> 6 TRUE 48 1 a 130 256 1 hypert… 150 1 0 #> # ℹ 3 more variables: slope , ca , thal "},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"creating-trees-with-fftrees","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Creating trees with FFTrees()","title":"Creating FFTs with FFTrees()","text":"illustrate difference fitting prediction, train FFTs heart.train, test prediction performance heart.test. Note can also automate training / test split using train.p argument FFTrees(). Setting train.p randomly split train.p% original data training set. create set FFTs, use FFTrees() function create new FFTrees object called heart.fft. , specify diagnosis binary criterion (dependent variable), include (independent) variables formula = diagnosis ~ .: wanted consider specific variables, like sex  age, trees, specify formula = diagnosis ~ age + sex.","code":"# Create an FFTrees object called heart.fft predicting diagnosis: heart.fft <- FFTrees(formula = diagnosis ~., data = heart.train, data.test = heart.test)"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"elements-of-an-fftrees-object","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Elements of an FFTrees object","title":"Creating FFTs with FFTrees()","text":"FFTrees() function returns object FFTrees class. many elements FFTrees object. can obtain elements printing names: Inspecting elements provides wealth information range FFTs contained current FFTrees object: criterion_name: name (predicted) binary criterion variable. cue_names: names potential cue variables (predictors) data. formula: formula used create FFTrees object. trees: Information trees contained object, list elements specify number n, best tree, well tree definitions, verbal descriptions (inwords), decisions, performance characteristics (stats level_stats) FFT. data: datasets used train test FFTs (applicable). params: parameters used constructing FFTs (currently 19 parameters). competition: Models statistics alternative classification algorithms (test, train, models). cues: Information cue variables (predictors), list elements specify thresholds performance stats training FFTs.","code":"# See the elements of an FFTrees object: names(heart.fft) #> [1] \"criterion_name\" \"cue_names\" \"formula\" \"trees\" #> [5] \"data\" \"params\" \"competition\" \"cues\""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"basic-performance-characteristics-of-ffts","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Basic performance characteristics of FFTs","title":"Creating FFTs with FFTrees()","text":"can view basic information FFTrees object printing name. default tree construction algorithm ifan creates multiple trees different exit structures, FFTrees object typically contains many FFTs. printing FFTrees object, automatically see performance training data (.e., fitting, rather prediction) obtain information tree highest value goal statistic. default, goal set weighed accuracy wacc: interpreting model output, need carefully distinguish FFT’s “Training” (fitting training data) “Prediction” performance (new test data). Unless explicitly ask print(heart.fft, data = \"test\"), output printing heart.fft report fitting phase (.e., data = \"train\" default). see corresponding prediction performance, alternatively ask : evaluating FFT either training test data, obtain wide range measures. general information FFTrees object, see verbal Definition best FFT (FFT #1). Key information evaluating FFT’s performance contained Accuracy panel (either training prediction). description frequency counts corresponding statistics provided: Table 1: Description FFTs’ basic frequencies corresponding accuracy speed/frugality statistics. obtain information another FFT  FFTrees object, can call print() numeric tree parameter. instance, following expression provide basic performance characteristics Tree 3: Alternatively, visualize tree performance characteristics calling plot(heart.fft, tree = 3, data = \"test\"). See Accuracy statistics vignette details accuracy statistics used throughout FFTrees package.","code":"# Training performance of the best tree (on \"train\" data, given current goal): heart.fft # same as: print(heart.fft, data = \"train\") #> FFTrees #> - Trees: 7 fast-and-frugal trees predicting diagnosis #> - Cost of outcomes: hi = 0, fa = 1, mi = 1, cr = 0 #> - Cost of cues: #> age sex cp trestbps chol fbs restecg thalach #> 1 1 1 1 1 1 1 1 #> exang oldpeak slope ca thal #> 1 1 1 1 1 #> #> FFT #1: Definition #> [1] If thal = {rd,fd}, decide True. #> [2] If cp != {a}, decide False. #> [3] If ca > 0, decide True, otherwise, decide False. #> #> FFT #1: Training Accuracy #> Training data: N = 150, Pos (+) = 66 (44%) #> #> | | True + | True - | Totals: #> |----------|--------|--------| #> | Decide + | hi 54 | fa 18 | 72 #> | Decide - | mi 12 | cr 66 | 78 #> |----------|--------|--------| #> Totals: 66 84 N = 150 #> #> acc = 80.0% ppv = 75.0% npv = 84.6% #> bacc = 80.2% sens = 81.8% spec = 78.6% #> #> FFT #1: Training Speed, Frugality, and Cost #> mcu = 1.74, pci = 0.87 #> cost_dec = 0.200, cost_cue = 1.740, cost = 1.940 # Prediction performance of the best training tree (on \"test\" data): print(heart.fft, data = \"test\") # Performance of alternative FFTs (Tree 3) in an FFTrees object: print(heart.fft, tree = 3, data = \"test\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"cue-performance-information","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Cue performance information","title":"Creating FFTs with FFTrees()","text":"FFT decision threshold cue (regardless whether actually used tree) maximizes goal value cue applied entire training dataset. can obtain cue accuracy statistics using calculated decision thresholds cue.accuracies list. object test data, can see marginal cue accuracies test data (using thresholds calculated training data): can also visualize cue accuracies training data (ROC space, .e., showing cue’s hit rate false alarm rate) calling plot() = \"cues\" argument. show sensitivities specificities cue, top five cues highlighted listed: See Plotting FFTrees objects vignette details visualizing cue accuracies FFTs.","code":"# Decision thresholds and marginal classification training accuracies for each cue: heart.fft$cues$stats$train #> cue class threshold direction n hi fa mi cr sens #> 1 age numeric 57 > 150 38 22 28 62 0.5757576 #> 2 sex numeric 0 > 150 53 48 13 36 0.8030303 #> 3 cp character a = 150 48 18 18 66 0.7272727 #> 4 trestbps numeric 148 > 150 15 9 51 75 0.2272727 #> 5 chol numeric 273 > 150 22 17 44 67 0.3333333 #> 6 fbs numeric 0 > 150 10 9 56 75 0.1515152 #> 7 restecg character hypertrophy,abnormal = 150 40 34 26 50 0.6060606 #> 8 thalach numeric 154 <= 150 44 29 22 55 0.6666667 #> 9 exang numeric 0 > 150 31 14 35 70 0.4696970 #> 10 oldpeak numeric 0.8 > 150 41 22 25 62 0.6212121 #> 11 slope character flat,down = 150 45 27 21 57 0.6818182 #> 12 ca numeric 0 > 150 47 19 19 65 0.7121212 #> 13 thal character rd,fd = 150 47 16 19 68 0.7121212 #> spec ppv npv acc bacc wacc dprime #> 1 0.7380952 0.6333333 0.6888889 0.6666667 0.6569264 0.6569264 0.8227611 #> 2 0.4285714 0.5247525 0.7346939 0.5933333 0.6158009 0.6158009 0.6653742 #> 3 0.7857143 0.7272727 0.7857143 0.7600000 0.7564935 0.7564935 1.3853056 #> 4 0.8928571 0.6250000 0.5952381 0.6000000 0.5600649 0.5600649 0.4882880 #> 5 0.7976190 0.5641026 0.6036036 0.5933333 0.5654762 0.5654762 0.3996338 #> 6 0.8928571 0.5263158 0.5725191 0.5666667 0.5221861 0.5221861 0.2105078 #> 7 0.5952381 0.5405405 0.6578947 0.6000000 0.6006494 0.6006494 0.5065806 #> 8 0.6547619 0.6027397 0.7142857 0.6600000 0.6607143 0.6607143 0.8230087 #> 9 0.8333333 0.6888889 0.6666667 0.6733333 0.6515152 0.6515152 0.8840984 #> 10 0.7380952 0.6507937 0.7126437 0.6866667 0.6796537 0.6796537 0.9394337 #> 11 0.6785714 0.6250000 0.7307692 0.6800000 0.6801948 0.6801948 0.9297212 #> 12 0.7738095 0.7121212 0.7738095 0.7466667 0.7429654 0.7429654 1.3009993 #> 13 0.8095238 0.7460317 0.7816092 0.7666667 0.7608225 0.7608225 1.4243467 #> cost_dec cost cost_cue #> 1 -0.3333333 -1.333333 1 #> 2 -0.4066667 -1.406667 1 #> 3 -0.2400000 -1.240000 1 #> 4 -0.4000000 -1.400000 1 #> 5 -0.4066667 -1.406667 1 #> 6 -0.4333333 -1.433333 1 #> 7 -0.4000000 -1.400000 1 #> 8 -0.3400000 -1.340000 1 #> 9 -0.3266667 -1.326667 1 #> 10 -0.3133333 -1.313333 1 #> 11 -0.3200000 -1.320000 1 #> 12 -0.2533333 -1.253333 1 #> 13 -0.2333333 -1.233333 1 # Visualize individual cue accuracies: plot(heart.fft, what = \"cues\", main = \"Cue accuracy for heartdisease\") #> Plotting cue training statistics: #> — Cue accuracies ranked by bacc #>"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"tree-definitions","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Tree definitions","title":"Creating FFTs with FFTrees()","text":"tree.definitions data frame contains definitions (cues, classes, exits, thresholds, directions) trees  FFTrees object. combination five pieces information (well order), define describe tree makes decisions: Separate levels tree definitions separated colons (;). understand read definitions, let’s start understanding Tree 1, tree highest weighted accuracy training: Nodes, classes, cues: Tree 1 three cues order thal, cp, ca. classes cues  c (character), c  n (numeric). Exits, directions, thresholds: decision exits cues 1 (positive), 0 (negative),  0.5 (positive negative). means first cue makes positive decisions, second cue makes negative decisions, third cue makes positive negative decisions. decision thresholds rd fd first cue, second cue,  0 third cue. cue directions predicting criterion variable   = first cue, = second cue,   > third cue, respectively. Importantly, cue directions indicate tree make positive decisions positive exit (.e., predicted Signal) cue. tree positive exit given cue, cases satisfy threshold direction classified positive criterion value. However, tree negative exit given cue, cases satisfy given thresholds classified negative. Thus, directions cues negative exits need negated (e.g., = becomes !=, > becomes <=, etc.). information, can understand verbalize Tree 1 follows: thal equal either rd  fd, predict positive criterion value. Otherwise, cp equal  , predict negative value. Otherwise, ca greater  0, predict positive value, else predict negative value. Note heart.fft$trees$definitions also reveals Tree 3 Tree 5 use cues cue directions Tree 1. However, differ exit structures first second cues (nodes). Applying inwords() function FFTrees object returns verbal description tree. instance, obtain verbal description tree highest training accuracy (.e., Tree #1), can ask :","code":"# See the definitions of all trees: heart.fft$trees$definitions #> # A tibble: 7 × 7 #> tree nodes classes cues directions thresholds exits #> #> 1 1 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 1;0;0.5 #> 2 2 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;0;1;0.5 #> 3 3 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 0;1;0.5 #> 4 4 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;1;0;0.5 #> 5 5 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 0;0;0.5 #> 6 6 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 0;0;0;0.5 #> 7 7 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;1;1;0.5 # Describe the best training tree (i.e., Tree #1): inwords(heart.fft, tree = 1) #> [1] \"If thal = {rd,fd}, decide True.\" #> [2] \"If cp != {a}, decide False.\" #> [3] \"If ca > 0, decide True, otherwise, decide False.\""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"accuracy-statistics-of-ffts","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Accuracy statistics of FFTs","title":"Creating FFTs with FFTrees()","text":"performance FFT specific dataset characterized range accuracy statistics. training statistics trees heart.fft: corresponding statistics testing : See Accuracy statistics vignette definitions accuracy statistics used throughout FFTrees package.","code":"# Training statistics for all trees: heart.fft$trees$stats$train #> # A tibble: 7 × 20 #> tree n hi fa mi cr sens spec far ppv npv dprime #> #> 1 1 150 54 18 12 66 0.818 0.786 0.214 0.75 0.846 1.69 #> 2 2 150 57 22 9 62 0.864 0.738 0.262 0.722 0.873 1.72 #> 3 3 150 44 7 22 77 0.667 0.917 0.0833 0.863 0.778 1.79 #> 4 4 150 60 31 6 53 0.909 0.631 0.369 0.659 0.898 1.65 #> 5 5 150 28 2 38 82 0.424 0.976 0.0238 0.933 0.683 1.74 #> 6 6 150 21 1 45 83 0.318 0.988 0.0119 0.955 0.648 1.71 #> 7 7 150 64 56 2 28 0.970 0.333 0.667 0.533 0.933 1.40 #> # ℹ 8 more variables: acc , bacc , wacc , cost_dec , #> # cost_cue , cost , pci , mcu # Testing statistics for all trees: heart.fft$trees$stats$test #> # A tibble: 7 × 20 #> tree n hi fa mi cr sens spec far ppv npv dprime acc #> #> 1 1 153 64 19 9 61 0.877 0.762 0.238 0.771 0.871 1.86 0.817 #> 2 2 153 67 26 6 54 0.918 0.675 0.325 0.720 0.9 1.82 0.791 #> 3 3 153 49 8 24 72 0.671 0.9 0.1 0.860 0.75 1.71 0.791 #> 4 4 153 69 36 4 44 0.945 0.55 0.45 0.657 0.917 1.70 0.739 #> 5 5 153 28 0 45 80 0.384 1 0 1 0.64 2.44 0.706 #> 6 6 153 22 0 51 80 0.301 1 0 1 0.611 2.22 0.667 #> 7 7 153 72 56 1 24 0.986 0.3 0.7 0.562 0.96 1.60 0.627 #> # ℹ 7 more variables: bacc , wacc , cost_dec , cost_cue , #> # cost , pci , mcu "},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"classification-decisions","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Classification decisions","title":"Creating FFTs with FFTrees()","text":"decision list contains raw classification decisions tree case, well detailed information costs classification. instance, decisions made Tree 1 training data:","code":"# Inspect the decisions of Tree 1: heart.fft$trees$decisions$train$tree_1 #> # A tibble: 150 × 6 #> criterion decision levelout cost_cue cost_dec cost #> #> 1 FALSE FALSE 2 2 0 2 #> 2 FALSE FALSE 2 2 0 2 #> 3 FALSE FALSE 2 2 0 2 #> 4 TRUE TRUE 1 1 0 1 #> 5 FALSE FALSE 2 2 0 2 #> 6 FALSE TRUE 1 1 1 2 #> 7 FALSE FALSE 2 2 0 2 #> 8 TRUE TRUE 1 1 0 1 #> 9 TRUE TRUE 3 3 0 3 #> 10 FALSE FALSE 2 2 0 2 #> # ℹ 140 more rows"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"predicting-new-cases-with-predict","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Predicting new cases with predict()","title":"Creating FFTs with FFTrees()","text":"created FFTrees object, can use predict new data using predict(). First, ’ll use heart.fft object make predictions cases 1  10 heartdisease dataset. default, tree best training wacc values used predict value binary criterion variable: wanted use alternative FFT FFTrees object predicting criterion outcomes new data, specify number tree argument predict() function. predict class probabilities, can include type = \"prob\" argument. return matrix class predictions, first column indicates probabilities case classified  0 / FALSE, second column indicates probability case classified  1 / TRUE: Use type = \"\" get classification probability predictions cases:","code":"# Predict classes for new data from the best training tree: predict(heart.fft, newdata = heartdisease[1:10, ]) #> [1] TRUE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE TRUE # Predict class probabilities for new data from the best training tree: predict(heart.fft, newdata = heartdisease, type = \"prob\") #> # A tibble: 303 × 2 #> prob_0 prob_1 #> #> 1 0.262 0.738 #> 2 0.273 0.727 #> 3 0.262 0.738 #> 4 0.862 0.138 #> 5 0.862 0.138 #> 6 0.862 0.138 #> 7 0.273 0.727 #> 8 0.706 0.294 #> 9 0.262 0.738 #> 10 0.262 0.738 #> # ℹ 293 more rows # Predict both classes and probabilities: predict(heart.fft, newdata = heartdisease, type = \"both\") #> # A tibble: 303 × 3 #> class prob_0 prob_1 #> #> 1 TRUE 0.262 0.738 #> 2 TRUE 0.273 0.727 #> 3 TRUE 0.262 0.738 #> 4 FALSE 0.862 0.138 #> 5 FALSE 0.862 0.138 #> 6 FALSE 0.862 0.138 #> 7 TRUE 0.273 0.727 #> 8 FALSE 0.706 0.294 #> 9 TRUE 0.262 0.738 #> 10 TRUE 0.262 0.738 #> # ℹ 293 more rows"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"visualising-trees","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Visualising trees","title":"Creating FFTs with FFTrees()","text":"created FFTrees object using FFTrees() function can visualize tree (ROC curves) using plot() function. following code visualize best training tree applied test data: See Plotting FFTrees objects vignette details visualizing trees.","code":"plot(heart.fft, main = \"Heart Disease\", decision.labels = c(\"Healthy\", \"Disease\"))"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"manually-defining-an-fft","dir":"Articles","previous_headings":"Details on the FFTrees() function","what":"Manually defining an FFT","title":"Creating FFTs with FFTrees()","text":"can also design specific FFT apply dataset using .tree argument FFTrees(). , specify FFT sentence, making sure correctly spell cue names appear data. Sets factor cues can specified using (curly) brackets. example, can manually define FFT using sentence: \"chol > 300, predict True. thal = {fd,rd}, predict False. Otherwise, predict True\" plot resulting FFT: can see, performance particular tree pretty terrible — motivate build better FFTs ! addition defining FFT verbal description, can edit define sets FFT definitions evaluate data. See Manually specifying FFTs vignette details editing, modifying, evaluating specific FFTs.","code":"# Manually define a tree using the my.tree argument: myheart_fft <- FFTrees(diagnosis ~., data = heartdisease, my.tree = \"If chol > 300, predict True. If thal = {fd,rd}, predict False. Otherwise, predict True\") plot(myheart_fft, main = \"Specifying a manual FFT\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_function.html","id":"vignettes","dir":"Articles","previous_headings":"","what":"Vignettes","title":"Creating FFTs with FFTrees()","text":"complete list vignettes available FFTrees package:","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"tutorial-creating-ffts-for-heart-disease","dir":"Articles","previous_headings":"","what":"Tutorial: Creating FFTs for heart disease","title":"Tutorial: Creating FFTs for heart disease","text":"tutorial using FFTrees package follows examples presented Phillips et al. (2017) (freely available html | PDF): Phillips, N. D., Neth, H., Woike, J. K. & Gaissmaier, W. (2017). FFTrees: toolbox create, visualize, evaluate fast--frugal decision trees. Judgment Decision Making, 12 (4), 344–368. following, explain use FFTrees create, evaluate visualize FFTs four simple steps.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"step-1-install-and-load-the-fftrees-package","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease","what":"Step 1: Install and load the FFTrees package","title":"Tutorial: Creating FFTs for heart disease","text":"can install FFTrees CRAN using install.packages(). (need .) use package, first need load current R session. load package using library(): FFTrees package contains several vignettes guide package’s functionality (like one). open main guide, run FFTrees.guide():","code":"# Install the package from CRAN: install.packages(\"FFTrees\") # Load the package: library(FFTrees) # Open the main package guide: FFTrees.guide()"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"step-2-create-ffts-from-training-data-and-test-on-testing-data","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease","what":"Step 2: Create FFTs from training data (and test on testing data)","title":"Tutorial: Creating FFTs for heart disease","text":"example, create FFTs heart disease data set. training data object called heart.train, testing data object called heart.test. data, predict diagnosis, binary criterion indicates whether patient heart disease (.e., high-risk low-risk). create FFTrees object, use function FFTrees() two main arguments: formula expects formula indicating binary criterion variable function one predictor variable(s) considered tree. shorthand formula = diagnosis ~ . means include predictor variables. data specifies training data used construct FFTs (must include criterion variable). can construct first FFTs: Evaluating expression runs code examines data, optimizes thresholds based current goals cue, creates evaluates 7 FFTs. resulting FFTrees object contains tree definitions, decisions, performance statistics, assigned heart.fft object.","code":"# Create an FFTrees object: heart.fft <- FFTrees(formula = diagnosis ~ ., # Criterion and (all) predictors data = heart.train, # Training data data.test = heart.test, # Testing data main = \"Heart Disease\", # General label decision.labels = c(\"Low-Risk\", \"High-Risk\") # Decision labels (False/True) )"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"other-arguments","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease > Step 2: Create FFTs from training data (and test on testing data)","what":"Other arguments","title":"Tutorial: Creating FFTs for heart disease","text":"algorithm: two different algorithms available build FFTs \"ifan\" (Phillips et al., 2017) \"dfan\" (Phillips et al., 2017). (\"max\" (Martignon et al., 2008), \"zigzag\" (Martignon et al., 2008) longer supported). max.levels: Changes maximum number levels allowed tree. following arguments apply using “ifan” “dfan” algorithms creating new FFTs: goal.chase: goal.chase argument changes statistic maximized tree construction (\"ifan\" \"dfan\" algorithms). Possible arguments include \"acc\", \"bacc\", \"wacc\", \"dprime\", \"cost\". default \"wacc\" sensitivity weight  0.50 (renders identical \"bacc\"). goal: goal argument changes statistic maximized selecting trees construction (\"ifan\" \"dfan\" algorithms). Possible arguments include \"acc\", \"bacc\", \"wacc\", \"dprime\", \"cost\". .tree tree.definitions: can define new tree verbal description (set sentences), manually specify sets FFTs data frame (appropriate format). See Manually specifying FFTs vignette details.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"step-3-inspect-and-summarize-ffts","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease","what":"Step 3: Inspect and summarize FFTs","title":"Tutorial: Creating FFTs for heart disease","text":"Now can inspect summarize generated decision trees. start printing FFTrees object return basic information console: output tells us several pieces information: tree highest weighted sensitivity wacc sensitivity weight  0.5 selected best tree. , best tree, FFT #1 uses three cues: thal, cp, ca. Several summary statistics tree training test data summarized. statistics evaluate tree can derived 2 x 2 confusion table: Table 1: 2x2 confusion table illustrating types frequency counts 4 possible outcomes. definitions accuracy statistics, see accuracy statistics vignette.","code":"# Print an FFTrees object: heart.fft #> Heart Disease #> FFTrees #> - Trees: 7 fast-and-frugal trees predicting diagnosis #> - Cost of outcomes: hi = 0, fa = 1, mi = 1, cr = 0 #> - Cost of cues: #> age sex cp trestbps chol fbs restecg thalach #> 1 1 1 1 1 1 1 1 #> exang oldpeak slope ca thal #> 1 1 1 1 1 #> #> FFT #1: Definition #> [1] If thal = {rd,fd}, decide High-Risk. #> [2] If cp != {a}, decide Low-Risk. #> [3] If ca > 0, decide High-Risk, otherwise, decide Low-Risk. #> #> FFT #1: Training Accuracy #> Training data: N = 150, Pos (+) = 66 (44%) #> #> | | True + | True - | Totals: #> |----------|--------|--------| #> | Decide + | hi 54 | fa 18 | 72 #> | Decide - | mi 12 | cr 66 | 78 #> |----------|--------|--------| #> Totals: 66 84 N = 150 #> #> acc = 80.0% ppv = 75.0% npv = 84.6% #> bacc = 80.2% sens = 81.8% spec = 78.6% #> #> FFT #1: Training Speed, Frugality, and Cost #> mcu = 1.74, pci = 0.87 #> cost_dec = 0.200, cost_cue = 1.740, cost = 1.940"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"step-4-visualise-the-final-fft","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease","what":"Step 4: Visualise the final FFT","title":"Tutorial: Creating FFTs for heart disease","text":"use plot(x) visualize FFT ( FFTrees object x). Using data = \"train\" evaluates  FFT training data (fitting), whereas data = \"test\" predicts performance  FFT different dataset:","code":"# Plot predictions of the best FFT when applied to test data: plot(heart.fft, # An FFTrees object data = \"test\") # data to use (i.e., either \"train\" or \"test\")?"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"other-arguments-1","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease > Step 4: Visualise the final FFT","what":"Other arguments","title":"Tutorial: Creating FFTs for heart disease","text":"plot() function FFTrees object tree: tree object beplotted? plot tree best fitting tree (FFT #1), just specify another tree integer (e.g.; plot(heart.fft, tree = 2)). data: dataset statistics shown? Either data = \"train\" (showing fitting “Training” performance default), data = \"test\" (showing prediction “Testing” performance). stats: accuracy statistics shown tree? show tree, without performance statistics, include argument stats = FALSE. comp: statistics competitive algorithms shown ROC curve? remove performance statistics competitive algorithms (e.g.; regression, random forests), include argument comp = FALSE. : parts FFTrees object visualized (e.g., , icontree tree). Using = \"roc\" plots tree performance ROC curve. show individual cue accuracies (ROC space), specify = \"cues\": See Plotting FFTrees vignette details plotting FFTs.","code":"# Plot only the tree, without accuracy statistics: plot(heart.fft, what = \"tree\") # plot(heart.fft, stats = FALSE) # The 'stats' argument has been deprecated. # Plot cue accuracies (for training data) in ROC space: plot(heart.fft, what = \"cues\") #> Plotting cue training statistics: #> — Cue accuracies ranked by bacc #>"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"advanced-functions","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease","what":"Advanced functions","title":"Tutorial: Creating FFTs for heart disease","text":"Creating sets FFTs evaluating data printing plotting individual FFTs provides core functionality FFTrees. However, package also provides advanced functions accessing, defining, using evaluating FFTs.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"accessing-outputs","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease > Advanced functions","what":"Accessing outputs","title":"Tutorial: Creating FFTs for heart disease","text":"FFTrees object contains many different outputs. Basic performance information current data set FFTs available summary() function. see access parts FFTrees object, use str() names(): Key elements FFTrees object explained vignette Creating FFTs FFTrees().","code":"# Show the names of all outputs in heart.fft: names(heart.fft) #> [1] \"criterion_name\" \"cue_names\" \"formula\" \"trees\" #> [5] \"data\" \"params\" \"competition\" \"cues\""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"predicting-for-new-data","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease > Advanced functions","what":"Predicting for new data","title":"Tutorial: Creating FFTs for heart disease","text":"predict classification outcomes new data, use standard predict() function. example, ’s predict classifications data heartdisease object (actually just combination heart.train heart.test):","code":"# Predict classifications for a new dataset: predict(heart.fft, newdata = heartdisease)"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"directly-defining-ffts","dir":"Articles","previous_headings":"Tutorial: Creating FFTs for heart disease > Advanced functions","what":"Directly defining FFTs","title":"Tutorial: Creating FFTs for heart disease","text":"define specific FFT apply data, can define tree providing verbal description .tree argument. Similarly, can define sets FFT definitions (data frame) evaluate data using tree.definitions argument FFTrees(). often start existing set FFTs, FFTrees provides set functions extracting, converting, modifying tree definitions. See vignette Manually specifying FFTs defining FFTs descriptions modifying tree definitions.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_heart.html","id":"vignettes","dir":"Articles","previous_headings":"","what":"Vignettes","title":"Tutorial: Creating FFTs for heart disease","text":"complete list vignettes available FFTrees package:","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"manually-specifying-ffts","dir":"Articles","previous_headings":"","what":"Manually specifying FFTs","title":"Manually specifying FFTs","text":"usually create fast--frugal trees (FFTs) data using FFTrees() function (see Main guide: FFTrees overview vignette Creating FFTs FFTrees() instructions). However, occasionally may want design evaluate specific FFTs (e.g., test hypothesis include exclude variables based theoretical considerations). two ways manually define fast--frugal trees FFTrees() function: sentence using .tree argument (easier way), data frame using tree.definitions argument (harder way). methods require data evaluate performance FFTs, bypass tree construction algorithms built FFTrees package. manually created FFTs optimized specific data, key difference fitting predicting disappears FFTs. Although can still use two sets ‘train’ vs. ‘test’ data, manually defined FFT fitted hence expected perform systematically better ‘train’ data ‘test’ data.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"using-my-tree","dir":"Articles","previous_headings":"Manually specifying FFTs","what":"1. Using my.tree","title":"Manually specifying FFTs","text":"first method manually defining FFT use .tree argument, .tree sentence describing (single) FFT. argument specified FFTrees(), function — rather auxiliary fftrees_wordstofftrees() function — attempts interpret verbal description convert valid definition FFT (part FFTrees object). example, let’s use heartdisease data find predictor variables (e.g., sex, age, etc.) predict criterion variable (diagnosis): Table 1: Five cues binary criterion variable diagnosis first cases heartdisease data. ’s verbally describe FFT using first three cues conditional sentences: see shortly, FFTrees() function accepts descriptions (assigned character string in_words) .tree argument, creates corresponding FFT, evaluates corresponding dataset.","code":"in_words <- \"If sex = 1, predict True. If age < 45, predict False. If thal = {fd, normal}, predict True. Otherwise, predict False.\""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"verbally-defining-ffts","dir":"Articles","previous_headings":"Manually specifying FFTs > 1. Using my.tree","what":"Verbally defining FFTs","title":"Manually specifying FFTs","text":"instructions manually specifying trees: node must start word “” correspond form: , predict . Numeric thresholds specified directly (without brackets), like age > 21. categorical variables, factor thresholds must specified within curly braces, like sex = {male}. factors sets values, categories within threshold separated commas like eyecolor = {blue,brown}. specify cue directions, standard logical comparisons =, !=, <, >= (etc.) valid. numeric cues, use >, >=, <,  <=. factors, use =  !=. Positive exits indicated True, negative exits specified False. final node FFT always bi-directional (.e., positive negative exit). description final node always mentions positive (True) exit first. text Otherwise, predict EXIT included example actually necessary (ignored).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"example","dir":"Articles","previous_headings":"Manually specifying FFTs > 1. Using my.tree","what":"Example","title":"Manually specifying FFTs","text":"Now, let’s use verbal description FFT (assigned in_words ) .tree argument FFTrees() function. creates corresponding FFT applies heartdisease data: Running FFTrees() .tree argument creates object my_fft contains one FFT. verbal description tree can printed inwords(my_fft), want print plot object evaluate tree’s performance training testing data. Let’s see well manually constructed FFT (my_fft) training data: Figure 1: FFT manually constructed using .tree argument FFTrees(). manually constructing tree, resulting FFTrees object contains single FFT. Hence, ROC plot (right bottom panel Figure 1) show range FFTs, locates constructed FFT ROC space. formal definition new FFT available FFTrees object my_fft: Note 2nd node FFT (using age cue) predicting noise outcome (.e., non-final exit value  0  FALSE, shown left). tree definitions always refer signal outcome (.e., non-final exit value  1  TRUE, shown right), direction symbol left exit (.e., 2nd node Figure 1: age < 45, predict 0 noise) must flipped relative appearance tree definition (age >= 45, predict 1 signal). Thus, plot formal definition describe  FFT. turns , performance first FFT created verbal description mixed affair: tree rather high sensitivity ( 91%), low specificity ( 10%) allows many false alarms. Consequently, accuracy measures fail exceed baseline level.","code":"# Create FFTrees from a verbal FFT description (as my.tree): my_fft <- FFTrees(formula = diagnosis ~., data = heartdisease, main = \"My 1st FFT\", my.tree = in_words) # Inspect FFTrees object: plot(my_fft, data = \"train\") # Get FFT definition(s): get_fft_df(my_fft) # my_fft$trees$definitions #> # A tibble: 1 × 7 #> tree nodes classes cues directions thresholds exits #> #> 1 1 3 n;n;c sex;age;thal =;>=;= 1;45;fd,normal 1;0;0.5"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"creating-an-alternative-fft","dir":"Articles","previous_headings":"Manually specifying FFTs > 1. Using my.tree","what":"Creating an alternative FFT","title":"Manually specifying FFTs","text":"Let’s see can come better FFT. following example uses cues thal, cp,  ca .tree argument: FFTrees aims interpret .tree argument best abilities, flexibility entering verbal description  FFT. instance, also described desired FFT flowery terms: However, vocabulary FFTrees limited, safer enter cue directions symbolic form (.e., using =, <, <=, >, >=,  !=).1 verify FFTrees interpreted .tree description intended, let’s check whether FFT inwords(my_fft_2) yields description corresponds wanted: seems (prosaic version ) wanted, let’s visualize tree (evaluate performance) briefly inspect tree definition: Figure 2: Another FFT manually constructed using .tree argument FFTrees(). alternative FFT nicely balancing sensitivity specificity performs much better overall. Nevertheless, still far perfect — check whether can create even better ones!","code":"# Create a 2nd FFT from an alternative FFT description (as my.tree): my_fft_2 <- FFTrees(formula = diagnosis ~., data = heartdisease, main = \"My 2nd FFT\", my.tree = \"If thal = {rd,fd}, predict True. If cp != {a}, predict False. If ca > 1, predict True. Otherwise, predict False.\") # Create a 2nd FFT from an alternative FFT description (as my.tree): my_fft_2 <- FFTrees(formula = diagnosis ~., data = heartdisease, main = \"My 2nd FFT\", my.tree = \"If thal equals {rd,fd}, we shall say True. When Cp differs from {a}, let's predict False. Whenever CA happens to exceed 1, we will insist on True. Else, we give up and go away.\") inwords(my_fft_2) #> [1] \"If thal = {rd,fd}, decide True.\" #> [2] \"If cp != {a}, decide False.\" #> [3] \"If ca > 1, decide True, otherwise, decide False.\" # Visualize FFT: plot(my_fft_2) # FFT definition: get_fft_df(my_fft_2) # my_fft_2$trees$definitions #> # A tibble: 1 × 7 #> tree nodes classes cues directions thresholds exits #> #> 1 1 3 c;c;n thal;cp;ca =;=;> rd,fd;a;1 1;0;0.5 # Note the flipped direction value for 2nd cue (exit = '0'): # 'if (cp = a), predict 1' in the tree definition corresponds to # 'if (cp != a), predict 0' in the my.tree description and plot."},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"using-tree-definitions","dir":"Articles","previous_headings":"Manually specifying FFTs","what":"2. Using tree.definitions","title":"Manually specifying FFTs","text":"experienced users may want define evaluate one FFT time. achieve , FFTrees() function allows providing sets tree.definitions (data frame). However, questions regarding specific trees usually arise later exploration FFTs, tree.definitions argument mostly used combination existing FFTrees object x. case, parameters (e.g., regarding formula, data various goals) FFTrees object x kept, object re-evaluated new set tree.definitions. FFTs simple transparent rules solving binary classification problems, neat directly manipulate evaluate rules. purpose, FFTrees provides set tree manipulation functions (see Figure 3 ). functions extract sets existing FFT definitions (x) convert individual FFT definitions manageable (“tidy”) format. functions allow edit trim FFT definitions (e.g., adding, changing, reordering removing nodes). Finally, functions allow re-convert individual FFT definitions sets definitions, collect re-evaluate data. basic workflow get, change, use FFT definitions contains five steps: Get (sets ) FFT definitions Select convert individual FFT tidy data format Manipulate FFT (e.g., changing nodes exits) Re-convert changed definition original data format Collect sets changed FFT definitions /evaluate data Conceptually, workflow boils first creating  FFT model data, manipulating model, finally re-evaluating data. tools involved workflow allow editing grammar FFTs.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"overview-retrieving-manipulating-and-using-fft-definitions","dir":"Articles","previous_headings":"Manually specifying FFTs > 2. Using tree.definitions","what":"Overview: Retrieving, manipulating, and using FFT definitions","title":"Manually specifying FFTs","text":"Figure 3: Overview 4 tree definition conversion functions (yellow)6 tree trimming functions (blue). Figure 3 provides overview functions provided converting manipulating FFT definitions. can distinguish three cycles: get_fft_df() extracts set current FFT definitions (x$trees$definitions). add_fft_df() adds one FFT definitions existing set FFT definitions. Thus, function allows collecting sets FFT definitions. tree.definitions argument main FFTrees() function allows evaluating sets FFT definitions data. read_fft_df() selects single FFT set FFT definitions converts tidy data format (data frame row represents node). write_fft_df() converts single FFT tidy data frame (1-row-per-node) 1-row-per FFT format used add_fft_df() tree.definitions argument FFTrees(). add_nodes() allows adding new nodes FFT; drop_nodes() allows deleting nodes FFT; edit_nodes() allows changing existing nodes FFT; flip_exits() allows changing exit direction existing nodes; reorder_nodes() allows changing order FFT nodes; select_nodes() allows filtering existing nodes FFT. following example illustrates interplay functions typical workflow. looking Figure 3, first move right side (retrieving sets FFT definitions manipulating individual FFTs) move left side (re-convert individual FFTs sets FFT definitions).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"example-1","dir":"Articles","previous_headings":"Manually specifying FFTs > 2. Using tree.definitions","what":"Example","title":"Manually specifying FFTs","text":"illustrate typical workflow redefining FFTs built Tutorial: FFTs heart disease evaluating (full) heartdisease data. obtain set existing tree definitions, use default algorithm create FFTrees object x: seen Tutorial, evaluating expression yields set 7 FFTs. Rather evaluating individually (e.g., using print(x) plot(x) commands inspect specific trees), now extract tree definitions select modify individual FFTs. definitions stored part FFTrees object x, achieved evaluating x$trees$definitions summary(x)$definitions. Alternatively, can use get_fft_df() utility function  x obtain set generated tree definitions: resulting R object tree_dfs data frame 7 variables. 7 rows defines FFT context current FFTrees object x (see vignette Creating FFTs FFTrees() help interpreting tree definitions). “ifan” algorithm responsible creating trees yields family highly similar FFTs (vary exits, may truncate cues), may want explore alternative versions trees. 7 FFTs defined tree_dfs share three cues thal, cp,  ca, order. Let’s assume reasons explore cue order thal, ca,  cp.","code":"# Create an FFTrees object x: x <- FFTrees(formula = diagnosis ~ ., # criterion and (all) predictors data = heart.train, # training data data.test = heart.test, # testing data main = \"Heart Disease 1\", # initial label decision.labels = c(\"low risk\", \"high risk\"), # exit labels quiet = TRUE) # hide user feedback # Get tree definitions of x: (tree_dfs <- get_fft_df(x)) #> # A tibble: 7 × 7 #> tree nodes classes cues directions thresholds exits #> #> 1 1 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 1;0;0.5 #> 2 2 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;0;1;0.5 #> 3 3 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 0;1;0.5 #> 4 4 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;1;0;0.5 #> 5 5 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 0;0;0.5 #> 6 6 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 0;0;0;0.5 #> 7 7 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;1;1;0.5"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"obtaining-individual-tree-definitions","dir":"Articles","previous_headings":"Manually specifying FFTs > 2. Using tree.definitions","what":"Obtaining individual tree definitions","title":"Manually specifying FFTs","text":"can apply tree editing functions, first select initial FFT want manipulate . job read_fft_df() (see Cycle 2 Figure 3): read_fft_df() selects FFT definition converts tidy data frame. present case, select convert tree 1: resulting R object fft_1 selected definition tree 1 converted tidy data frame. 3 rows defines node FFT. format can understood manipulated easily compact format used row 1 tree_dfs (formats can converted complementary functions read_fft_df() write_fft_df()).","code":"(fft_1 <- read_fft_df(ffts_df = tree_dfs, tree = 1)) #> class cue direction threshold exit #> 1 c thal = rd,fd 1 #> 2 c cp = a 0 #> 3 n ca > 0 0.5"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"manipulating-individual-tree-definitions","dir":"Articles","previous_headings":"Manually specifying FFTs > 2. Using tree.definitions","what":"Manipulating individual tree definitions","title":"Manually specifying FFTs","text":"selected one FFT converted tidy data frame fft_1, can use various tree trimming functions edit manipulate definition individual tree (see Cycle 3 Figure 3). Reordering nodes example, selected FFT uses cues thal, cp,  ca, wanted explore alternative cue order thal, ca,  cp. words, need swap order 2nd 3rd cues fft_1. purpose reorder_nodes() function: reorder_nodes() allows changing order FFT nodes. contrast read_fft_df() function , tree editing functions Cycle 3 require individual FFT-definition (tidy data frame) first argument fft. case reorder_nodes(), second argument order specifies numeric vector desired node positions (.e., integers  1 nrow(fft) order). Thus, swapping order 2nd 3rd nodes fft_1 achieved follows: Swapping final two nodes implies final node fft_1 (using numerical cue ca) becomes non-final cue, whereas previous middle node (using categorical cue cp) becomes final cue (see corresponding feedback message). default, previous exit cue becomes signal exit (: exit 1, .e., predicting TRUE value diagnosis criterion). Saving resulting tree definition (stored tidy data frame format fft_1)  R object my_fft_1 allow us collect modified FFTs later. Flipping exits specific exit structure mind deciding explore cue order thal, ca,  cp, explore possible exit directions. every non-final node allows two alternative exits, tree containing nn nodes 2(n−1)2^{(n-1)} exit structures (.e., 22=42^2 = 4 3 cues). 33 exit structures addition my_fft_1 can obtained flipping exit directions first, second, non-final nodes. alternative can achieved applying flip_exits() function my_fft_1: flip_exits() allows changing exit direction existing nodes. instance, tree definition signal exit first node my_fft_1 can reversed non-signal node follows:","code":"(my_fft_1 <- reorder_nodes(fft = fft_1, order = c(1, 3, 2))) #> reorder_nodes: Former exit node now is node 2 #> #> class cue direction threshold exit #> 1 c thal = rd,fd 1 #> 2 n ca > 0 1 #> 3 c cp = a 0.5 (my_fft_2 <- flip_exits(my_fft_1, nodes = 1)) #> class cue direction threshold exit #> 1 c thal = rd,fd 0 #> 2 n ca > 0 1 #> 3 c cp = a 0.5"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"using-magrittr-pipes-to-combine-steps","dir":"Articles","previous_headings":"Manually specifying FFTs > 2. Using tree.definitions","what":"Using magrittr pipes to combine steps","title":"Manually specifying FFTs","text":"tree conversion editing functions need used separately. first argument represents data object manipulated, can viewed verbs tree manipulation language chained longer command sequences using magrittr pipe operator. instance, reversing exit 2nd cue my_fft_1 achieved follows: Similarly, five steps FFTrees object x tree definition alternative exit structure my_fft_4 chained single pipe follows: evaluate four alternative tree definitions, need re-convert 1-line-per-FFT format (using write_fft_df()) gather single data frame (using add_fft_df()). Figure 3, corresponds moving upwards left (individual FFT definitions tidy data frame combining sets FFT definitions single data frame).","code":"library(magrittr) (my_fft_3 <- my_fft_1 %>% flip_exits(nodes = 2)) #> class cue direction threshold exit #> 1 c thal = rd,fd 1 #> 2 n ca > 0 0 #> 3 c cp = a 0.5 (my_fft_4 <- x %>% get_fft_df() %>% read_fft_df(tree = 1) %>% reorder_nodes(order = c(1, 3, 2)) %>% flip_exits(nodes = c(1, 2))) #> reorder_nodes: Former exit node now is node 2 #> #> class cue direction threshold exit #> 1 c thal = rd,fd 0 #> 2 n ca > 0 0 #> 3 c cp = a 0.5"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"re-converting-and-collecting-sets-of-tree-definitions","dir":"Articles","previous_headings":"Manually specifying FFTs > 2. Using tree.definitions","what":"Re-converting and collecting sets of tree definitions","title":"Manually specifying FFTs","text":"created four modified tree definitions (.e., my_fft_1 my_fft_4), now want re-convert tidy data frame (row representing FFT node) (non-tidy) data frame format (row represents entire FFT). compact format allows us gather several FFT definitions one data frame, can evaluate together data call main FFTrees() function. Figure 3, corresponding steps shown left sides Cycle 2 Cycle 1. re-convert two tree definition formats (stored data frames), use write_fft_df() function: write_fft_df() converts single FFT tidy data frame (1-row-per-node) 1-row-per FFT format used add_fft_df() tree.definitions argument FFTrees(). addition FFT definition convert (e.g., my_fft_1), tree argument allows providing numeric ID later allow us identify FFT within set: creates R object my_tree_dfs (non-tidy) data frame definition my_fft_1 occupies one row. Next, add FFT definitions my_tree_dfs data frame. can achieved add_fft_df() function: add_fft_df() adds one FFT definitions existing set FFT definitions. Thus, function allows collecting sets FFT definitions. However, first requires converting tidy FFT definitions compact 1-row-per FFT format, use series command pipes. pipe starts tidy FFT definition applies write_fft_df() ( ID) add_fft_df (my_tree_dfs), re-assigning modified data frame my_tree_dfs : resulting data frame my_tree_dfs contains 4 FFT definitions 4 rows. Per design (), differ values tree ID structures exits.","code":"(my_tree_dfs <- write_fft_df(my_fft_1, tree = 1)) #> tree nodes classes cues directions thresholds exits #> 1 1 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 1;1;0.5 my_tree_dfs <- my_fft_2 %>% write_fft_df(tree = 2) %>% add_fft_df(my_tree_dfs) my_tree_dfs <- my_fft_3 %>% write_fft_df(tree = 3) %>% add_fft_df(my_tree_dfs) my_tree_dfs <- my_fft_4 %>% write_fft_df(tree = 4) %>% add_fft_df(my_tree_dfs) my_tree_dfs #> tree nodes classes cues directions thresholds exits #> 1 1 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 1;1;0.5 #> 2 2 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 0;1;0.5 #> 3 3 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 1;0;0.5 #> 4 4 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 0;0;0.5"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"applying-sets-of-tree-definitions-to-data","dir":"Articles","previous_headings":"Manually specifying FFTs > 2. Using tree.definitions","what":"Applying sets of tree definitions to data","title":"Manually specifying FFTs","text":"edited collected set tree definitions, now can evaluate corresponding FFTs data. can providing set tree definitions (stored my_tree_dfs data frame) tree.definitions argument main FFTrees() function: tree.definitions argument main FFTrees() function allows evaluating sets FFT definitions data. using main FFTrees() function set tree.definitions (data frame line contains definition one FFT), can provide existing FFTrees object (e.g., x ). Importantly, however, input tree.definitions prevents generation new FFTs (via “ifan” “dfan” algorithms) instead evaluates FFT definitions provided data specified:2 can see feedback messages, providing FFTrees object (x) re-uses datasets, parameters, labels, unless overwritten new values. resulting FFTrees object y contains summary statistics resulting applying 4 FFT definitions my_tree_dfs datasets used create x (.e., data = heart.train data.test = heart.test). now can assess visualize performance FFTs usual ways, e.g., summary(), print() plot() functions y trees: Comparing accuracy statistics new FFTs (object y) original FFTs (object x) shows swapping 2nd 3rd cue hardly effect. Upon reflection, surprising: people still classified categories . However, evaluate costs classification (e.g., considering  pci  mcu measures cost measures cue usage), still detect differences FFTs show accuracy.","code":"# Evaluate new tree.definitions for an existing FFTrees object x: y <- FFTrees(object = x, # existing FFTrees object x tree.definitions = my_tree_dfs, # new set of FFT definitions main = \"Heart Disease 2\" # new label ) summary(y) #> Heart Disease 2 #> #> FFTrees #> - Trees: 4 fast-and-frugal trees predicting diagnosis #> - Parameters: algorithm = 'ifan', max.levels = 4, #> stopping.rule = 'exemplars', stopping.par = 0.1, #> goal = 'bacc', goal.chase = 'bacc', goal.threshold = 'bacc'. #> #> #> Table: Tree definitions. #> #> | tree| nodes|classes |cues |directions |thresholds |exits | #> |----:|-----:|:-------|:----------|:----------|:----------|:-------| #> | 1| 3|c;n;c |thal;ca;cp |=;>;= |rd,fd;0;a |1;0;0.5 | #> | 2| 3|c;n;c |thal;ca;cp |=;>;= |rd,fd;0;a |0;1;0.5 | #> | 3| 3|c;n;c |thal;ca;cp |=;>;= |rd,fd;0;a |1;1;0.5 | #> | 4| 3|c;n;c |thal;ca;cp |=;>;= |rd,fd;0;a |0;0;0.5 | #> #> #> Table: Tree statistics on training data [p(True) = 44%]. #> #> | tree| n| hi| fa| mi| cr| sens| spec| far| ppv| npv| dprime| acc| bacc| wacc| cost_dec| cost_cue| cost| pci| mcu| #> |----:|---:|--:|--:|--:|--:|----:|----:|----:|----:|----:|------:|----:|----:|----:|--------:|--------:|----:|----:|----:| #> | 1| 150| 54| 18| 12| 66| 0.82| 0.79| 0.21| 0.75| 0.85| 1.69| 0.80| 0.80| 0.80| 0.20| 1.76| 1.96| 0.86| 1.76| #> | 2| 150| 44| 7| 22| 77| 0.67| 0.92| 0.08| 0.86| 0.78| 1.79| 0.81| 0.79| 0.79| 0.19| 1.58| 1.77| 0.88| 1.58| #> | 3| 150| 63| 42| 3| 42| 0.95| 0.50| 0.50| 0.60| 0.93| 1.66| 0.70| 0.73| 0.73| 0.30| 1.98| 2.28| 0.85| 1.98| #> | 4| 150| 28| 2| 38| 82| 0.42| 0.98| 0.02| 0.93| 0.68| 1.74| 0.73| 0.70| 0.70| 0.27| 1.68| 1.95| 0.87| 1.68| #> #> #> Table: Tree statistics on test data [p(True) = 48%]. #> #> | tree| n| hi| fa| mi| cr| sens| spec| far| ppv| npv| dprime| acc| bacc| wacc| cost_dec| cost_cue| cost| pci| mcu| #> |----:|---:|--:|--:|--:|--:|----:|----:|----:|----:|----:|------:|----:|----:|----:|--------:|--------:|----:|----:|----:| #> | 1| 153| 64| 19| 9| 61| 0.88| 0.76| 0.24| 0.77| 0.87| 1.86| 0.82| 0.82| 0.82| 0.18| 1.69| 1.87| 0.87| 1.69| #> | 2| 153| 49| 8| 24| 72| 0.67| 0.90| 0.10| 0.86| 0.75| 1.71| 0.79| 0.79| 0.79| 0.21| 1.70| 1.91| 0.87| 1.70| #> | 3| 153| 70| 45| 3| 35| 0.96| 0.44| 0.56| 0.61| 0.92| 1.55| 0.69| 0.70| 0.70| 0.31| 1.90| 2.22| 0.85| 1.90| #> | 4| 153| 28| 0| 45| 80| 0.38| 1.00| 0.00| 1.00| 0.64| 2.44| 0.71| 0.69| 0.69| 0.29| 1.71| 2.01| 0.87| 1.71| # Visualize individual FFTs: # plot(y, tree = 1)"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"details","dir":"Articles","previous_headings":"Manually specifying FFTs > 2. Using tree.definitions","what":"Details","title":"Manually specifying FFTs","text":"just created new FFTrees object y using FFTrees object x set customized FFTs defined tree.definitions argument. circumvented FFT building algorithms used provided FFT definitions instead. Thus, ordinary distinction training test data longer applies context: model fitted , sets used evaluate FFTs tree.definitions data. Acknowledging , may use full dataset heartdisease, rather splitting two distinct subsets: , can evaluate performance FFTs obtaining summary, printing plotting individual FFTs FFTrees object z: Finally, mostly care comparing new FFTs automatically created ones, added new set my_tree_dfs old set (tree_dfs, obtained  x ). (e.g., using add_fft_df() function) creates superset 11 tree definitions, can evaluated together heartdisease data: Evaluating performance corresponding FFTs (e.g., summary()) shows reversing final two cues little effects accuracy (note minor differences costs, e.g., mcu).3","code":"# Create a new FFTrees object z: z <- FFTrees(formula = diagnosis ~ ., data = heartdisease, # using full dataset tree.definitions = my_tree_dfs, # new set of FFT definitions main = \"Heart Disease 3\" # new label ) # Summarize results: summary(z) # Visualize an FFT: plot(z, tree = 1) (all_fft_dfs <- add_fft_df(my_tree_dfs, tree_dfs)) #> # A tibble: 11 × 7 #> tree nodes classes cues directions thresholds exits #> #> 1 1 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 1;0;0.5 #> 2 2 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;0;1;0.5 #> 3 3 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 0;1;0.5 #> 4 4 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;1;0;0.5 #> 5 5 3 c;c;n thal;cp;ca =;=;> rd,fd;a;0 0;0;0.5 #> 6 6 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 0;0;0;0.5 #> 7 7 4 c;c;n;c thal;cp;ca;slope =;=;>;= rd,fd;a;0;flat,down 1;1;1;0.5 #> 8 8 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 1;1;0.5 #> 9 9 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 0;1;0.5 #> 10 10 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 1;0;0.5 #> 11 11 3 c;n;c thal;ca;cp =;>;= rd,fd;0;a 0;0;0.5 # Create a new FFTrees object a: all <- FFTrees(formula = diagnosis ~ ., data = heartdisease, # using full dataset tree.definitions = all_fft_dfs, # new set of FFT definitions main = \"Heart Disease 4\", # new label ) # Summarize results: summary(all)"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_mytree.html","id":"vignettes","dir":"Articles","previous_headings":"","what":"Vignettes","title":"Manually specifying FFTs","text":"complete list vignettes available FFTrees package:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_plot.html","id":"visualizing-fftrees","dir":"Articles","previous_headings":"","what":"Visualizing FFTrees","title":"Visualising FFTs","text":"FFTrees package makes easy visualize evaluate fast--frugal trees (FFTs): Use main FFTrees() function create set FFTs (e.g., R object x type FFTrees). Visualize tree  x evaluating plot(x). two key arguments plotting tree: Whereas tree argument allows selecting different trees  x (using tree = 1 default), argument distinguishes five main types plots: plot(x, = '') visualizes tree corresponding performance statistics. also default evaluating plot(x). plot(x, = 'tree') visualizes tree diagram selected tree (without performance statistics). plot(x, = 'icontree') visualizes tree diagram selected tree icon arrays exit nodes (additional options show.iconguide n.per.icon. plot(x, = 'cues') visualizes current cue accuracies ROC space (calling showcues() function). plot(x, = 'roc') visualizes performance comparison FFTs competing algorithms ROC space. arguments plot.FFTrees() function allow customization plot (e.g., defining labels parameters, selectively hiding showing elements). following, illustrate ways creating FFTs based titanic data (included FFTrees package).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_plot.html","id":"the-titanic-data","dir":"Articles","previous_headings":"Visualizing FFTrees","what":"The Titanic data","title":"Visualising FFTs","text":"titanic dataset contains basic survival statistics Titanic passengers. passenger, know class s/traveled, well binary categories specifying age, sex, survival information. get first impression, inspect random sample cases: sample 10 observations titanic data. current goal fit FFTs dataset. essentially asks: Can use information cues class, age sex decide whether passenger survived? First, let’s create FFTrees object (called titanic.fft) titanic dataset: Note used entire titanic data (.e., 2201 cases) train titanic.fft, rather specifying train.p set aside proportion specifying dedicated data.test set predictive purposes. implies present goal fit FFTs historic data, rather create use FFTs predict new cases.","code":"set.seed(12) # reproducible randomness rcases <- sort(sample(1:nrow(titanic), 10)) # Sample of data: knitr::kable(titanic[rcases, ], caption = \"A sample of 10 observations from the `titanic` data.\") # Create FFTs for the titanic data: titanic.fft <- FFTrees(formula = survived ~., data = titanic, main = \"Surviving the Titanic\", decision.labels = c(\"Died\", \"Survived\"))"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_plot.html","id":"visualising-cue-accuracies","dir":"Articles","previous_headings":"Visualizing FFTrees","what":"Visualising cue accuracies","title":"Visualising FFTs","text":"can visualize individual cue accuracies (specifically sensitivities specificities) including = 'cues' argument within plot() function. Let’s apply function titanic.fft object see accurate cues predicting survival: Figure 1: Cue accuracies FFTs predicting survival titanic dataset. Given axes plot, good performing cues near top left corner graph (.e., exhibit low false alarm rate high hit rate). titanic data, implies none cues predicts well . best individual cue appears sex (indicated  1), followed class (2). contrast, age (3) seems pretty poor cue predicting survival (despite specificity  97%). Inspecting cue accuracies can provide valuable information constructing FFTs. provide lower bounds performance trees (combining cues worthwhile yields benefit), even poor individual cues can shine combination predictors.","code":"plot(titanic.fft, what = \"cues\", main = \"Cues predicting Titanic survival\") #> Plotting cue training statistics: #> — Cue accuracies ranked by bacc #>"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_plot.html","id":"visualizing-ffts-and-their-performance","dir":"Articles","previous_headings":"Visualizing FFTrees","what":"Visualizing FFTs and their performance","title":"Visualising FFTs","text":"visualize tree FFTrees object, use plot(). Let’s plot one trees (Tree #1, .e., best one, given current goal): Figure 2: Plotting best FFT FFTrees object. resulting plot visualizes one rtitanic.ffttreestreesn\\ possible trees thetitanic.fftobject. Astree = 1corresponds best tree given currentgoalfor selecting FFTs, plotted tree specifyingtree = ‘best.train’`. Figure 2 contains lot information three distinct panels, let’s briefly consider contents: Basic dataset information: top row plot shows basic information current dataset: population size (N) baseline frequencies two categories criterion variable. FFT classification performance: middle row shows tree (center) well many cases (: persons) classified level tree (either side). example, current tree (Tree #1  4) can understood : person female, decide survived. Otherwise, person neither first second class, decide died. Finally, person child, predict survived, otherwise decide died. Accuracy performance information: bottom row shows general performance statistics  FFT: models titanic.fft trained entire titanic dataset, fitted FFTs 2201 cases, rather setting aside data predictive purposes. panel label reflects important distinction: results fitting data (.e., data used build tree) displayed, ’ll see “Training” label. testing dataset separate one used build tree used, ’ll see “Prediction” label. bottom panel provides performance information structured three subpanels: classification table (left) shows relationship true criterion states (columns) predicted decisions (rows). abbreviations hi (hits) cr (Correct rejections) denote correct decisions; mi (misses) fa (false-alarms) denote incorrect decisions. range vertical levels (middle) show tree’s cumulative performance terms two frugality measures (mcu pci) various accuracy measures (sensitivity, specificity, accuracy, balanced accuracy (see Accuracy statistics details). Finally, plot (right) shows ROC curve comparing performance trees FFTrees object. Additionally, performance logistic regression (blue) CART (red) shown. tree plotted middle panel highlighted solid green color (.e., Figure 2 shows Tree #1).","code":"plot(titanic.fft, tree = 1)"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_plot.html","id":"additional-arguments","dir":"Articles","previous_headings":"Visualizing FFTrees","what":"Additional arguments","title":"Visualising FFTs","text":"Specifying additional arguments plot() changes various elements displayed. visualized? argument selects contents plotted: = '' (default), plot shows tree diagram range corresponding performance statistics. Using one options narrows range shown: visualize bare tree diagram (without performance statistics), specify = \"tree\" (formerly stats = FALSE). visualize tree diagram icon arrays exit nodes, specify = \"icontree\" (additional options show.iconguide n.per.icon). visualize performance comparison (different FFTs competing algorithms) ROC space, specify = \"roc\". following examples illustrate wide range corresponding plots: Figure 3: FFT diagram icon arrays exit nodes. Figure 4: Performance comparison FFTs ROC space. main options suffice, various show. arguments (.e., show.header, show.tree, show.confusion, show.levels, show.roc, show.icons, show.iconguide) allow selectively turn turn specific elements overall plot. example: Figure 5: Plotting selected elements. tree: tree want plot? FFTrees objects typically contain multiple FFTs, need indicate tree want visualize. usually specify tree show integer value, tree = 2, plot corresponding tree (.e., Tree #2) FFTrees object. Alternatively, can specify tree = \"best.train\" tree = \"best.test\" visualize best training prediction tree, respectively. selects shows tree highest goal value (e.g., weighted accuracy wacc) fitting testing data. data: data want apply tree ? can specify data = \"train\" data = \"test\" distinguish training testing dataset (available) FFTrees object. FFTrees objects contain test data, data set data = \"train\" default. data tree arguments can refer datasets used training fitting (.e., “train” “test” sets), specified consistently. instance, following command visualize best training tree titanic.fft: data = \"train\" default. However, following analog expression fail: two distinct reasons: data remains unspecified, default data = \"train\". Thus, asking tree = \"best.test\" require switching data = \"test\". crucially, titanic.fft created without test data. Hence, asking best test tree make sense — plot() show best training tree (warning).","code":"# Plot tree diagram with icon arrays: plot(titanic.fft, what = \"icontree\", n.per.icon = 50, show.iconguide = TRUE) # Plot only the performance comparison in ROC space: plot(titanic.fft, what = \"roc\") # Hide some elements of the FFT plot: plot(titanic.fft, show.icons = FALSE, # hide icons show.iconguide = FALSE, # hide icon guide show.header = FALSE # hide header ) plot(titanic.fft, tree = \"best.train\") plot(titanic.fft, tree = \"best.test\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_plot.html","id":"plotting-performance-for-new-data","dir":"Articles","previous_headings":"Visualizing FFTrees","what":"Plotting performance for new data","title":"Visualising FFTs","text":"Shifting emphasis fitting prediction, primarily need specify test data used train FFTrees object. predicting performance new dataset (e.g.; data = test.data), plotting printing functions automatically apply existing FFTrees object new data compute corresponding performance statistics (using fftrees_apply() function). However, applying existing FFTs new data, changes FFTrees object stored input object, unless (invisible) output plot.FFTrees() print.FFTrees() re-assigned object. best way fit FFTs training data evaluate test data explicitly include datasets original FFTrees() command either using data.test train.p argument. example, can repeat previous analysis, now let’s create separate training test datasets including train.p = .50 argument. split dataset 50% training set, distinct 50% testing set. (Alternatively, specify dedicated test data set using data.test argument.) best training tree applied training data: Figure 6: Plotting best FFT training data. Tree #1 best training tree — also visualized plot(titanic.pred.fft, tree = \"best.train\"). tree high specificity  92%, much lower sensitivity just 51%. overall accuracy tree’s classifications  79%, exceeds baseline, far perfect. However, can see ROC table, logistic regression (LR) perform much better, CART performed even worse Tree #1. Now let’s inspect performance tree test data: Figure 7: Plotting best FFT test data. visualized tree asking plot(titanic.pred.fft, data = \"test\", tree = \"best.test\"). Note label bottom panel now switched “Accuracy (Training)” “Accuracy (Testing)”. sensitivity specificity values decreased somewhat, typical using model (fitted training data) predicting new (test) data. Let’s visualize prediction performance Tree #2, liberal tree (.e., highest sensitivity): Figure 8: Plotting Tree #2. alternative tree better sensitivity ( 63%), overall accuracy decreased baseline level ( 67%). Whereas comparing training test performance illustrates trade-offs mere fitting genuine predictive modeling, comparing performance details various FFTs illustrates typical trade-offs model solving binary classification problems engages . Importantly, types trade-offs rendered transparent using FFTrees.","code":"set.seed(100) # for replicability of the training/test split titanic.pred.fft <- FFTrees(formula = survived ~., data = titanic, train.p = .50, # use 50% to train, 50% to test main = \"Titanic\", decision.labels = c(\"Died\", \"Survived\") ) # print(titanic.pred.fft, tree = 1) plot(titanic.pred.fft, tree = 1) # print(titanic.pred.fft, data = \"test\", tree = 1) plot(titanic.pred.fft, data = \"test\", tree = 1) plot(titanic.pred.fft, data = \"test\", tree = 2)"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/FFTrees_plot.html","id":"vignettes","dir":"Articles","previous_headings":"","what":"Vignettes","title":"Visualising FFTs","text":"complete list vignettes available FFTrees package:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/guide.html","id":"fast-and-frugal-trees-ffts","dir":"Articles","previous_headings":"","what":"Fast-and-Frugal Trees (FFTs)","title":"Overview: Creating FFTs with FFTrees","text":"fast--frugal tree (FFT) (Martignon et al., 2003) set hierarchical rules solving binary classification tasks based little pieces information (usually using 4 fewer cues). contrast complex decision trees, node  FFT exactly two branches. branch can either contain another cue (.e., ask another question) lead exit (.e., yield decision prediction outcome). non-final node  FFT one exit branch final node two exit branches. FFTs simple effective decision strategies use minimal information making decisions binary classification problems (Gigerenzer et al., 1999; see Gigerenzer & Todd, 1999). FFTs often preferable complex decision strategies (logistic regression, LR) rarely -fit data (Gigerenzer & Brighton, 2009) easy interpret, implement, communicate real-world settings (Marewski & Gigerenzer, 2012). FFTs designed tackle many real world tasks making fast decisions emergency rooms (Green & Mehr, 1997) detecting depression (Jenny et al., 2013). Whereas performance success empirical questions, key theoretical advantage FFTs transparency decision makers anyone aiming understand evaluate details algorithm. words Burton et al. (2020), “human users interpret, justify, control, interact fast--frugal decision aid” (p. 229).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/guide.html","id":"using-the-fftrees-package","dir":"Articles","previous_headings":"","what":"Using the FFTrees package","title":"Overview: Creating FFTs with FFTrees","text":"FFTrees package makes easy produce, display, evaluate FFTs (Phillips et al., 2017). package’s main function FFTrees() takes formula formula dataset data arguments returns several FFTs attempt classify training cases criterion classes. FFTs created can used predict new data cross-validate performance. example using main FFTrees() function fit FFTs heart.train data: resulting FFTrees object heart.fft contains 7 FFTs fitted heart.test data. evaluate tree’s predictive performance, compare predictions un-trained heart.test data true criterion values. can apply best training FFT heart.test data: fast--frugal tree (FFT) predict heart disease status.","code":"# 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(\"Healthy\", \"Diseased\")) # Visualize predictive performance: plot(heart.fft, data = \"test\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/guide.html","id":"getting-started","dir":"Articles","previous_headings":"","what":"Getting started","title":"Overview: Creating FFTs with FFTrees","text":"start using FFTrees package, recommend studying Tutorial: Creating FFTs heart disease. tutorial illustrates basics steps creating, visualizing, evaluating fast--frugal trees (FFTs). scientific background FFTs development FFTrees described Phillips et al. (2017) (doi 10.1017/S1930297500006239 | html | PDF). following vignettes provide details related topics corresponding examples.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/guide.html","id":"vignettes","dir":"Articles","previous_headings":"Getting started","what":"Vignettes","title":"Overview: Creating FFTs with FFTrees","text":"complete list vignettes available FFTrees package:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/guide.html","id":"datasets","dir":"Articles","previous_headings":"Getting started","what":"Datasets","title":"Overview: Creating FFTs with FFTrees","text":"FFTrees package contains several datasets — mostly UCI Machine Learning Repository — allow address interesting questions exploring FFTs: blood – people donate blood? source breastcancer – patients suffer breast cancer? source car – cars acceptable? source contraceptive – factors determine whether women use contraceptives? source creditapproval – factors determine creditcard approval? source fertility – factors predict fertile sperm concentration? source forestfires – environmental conditions predict forest fires? source heartdisease – patients suffer heart disease? source iris.v – iris belongs class “virginica”? source mushrooms – features predict poisonous mushrooms? source sonar – sonar signal bounce metal cylinder (rock)? source titanic – passengers survived Titanic? source voting – U.S. congressmen vote 1984? source wine – determines ratings wine quality? source","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/guide.html","id":"details-about-the-datasets","dir":"Articles","previous_headings":"Getting started > Datasets","what":"Details about the datasets","title":"Overview: Creating FFTs with FFTrees","text":"preparing data predicted FFTs, usually distinguish several (categorical numeric) predictors (binary) criterion variable. Table 1 provides basic information datasets included FFTrees package (see documentation additional details). Table 1: Key information datasets included FFTrees.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/guide.html","id":"citing-fftrees","dir":"Articles","previous_headings":"","what":"Citing FFTrees","title":"Overview: Creating FFTs with FFTrees","text":"lot fun creating FFTrees hope like ! accessible introduction FFTs, recommend reading article journal Judgment Decision Making (2017), entitled FFTrees: toolbox create, visualize, evaluate fast--frugal decision trees (available html | PDF ). Citation (APA format): Phillips, N. D., Neth, H., Woike, J. K. & Gaissmaier, W. (2017). FFTrees: toolbox create, visualize, evaluate fast--frugal decision trees. Judgment Decision Making, 12 (4), 344–368. doi 10.1017/S1930297500006239 using FFTrees work, please cite article spread word, can continue developing package. BibTeX Citation:","code":"@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}, doi = {10.1017/S1930297500006239} }"},{"path":"https://ndphillips.github.io/FFTrees/dev/articles/guide.html","id":"contact","dir":"Articles","previous_headings":"","what":"Contact","title":"Overview: Creating FFTs with FFTrees","text":"latest release FFTrees available https://CRAN.R-project.org/package=FFTrees. latest developer version available https://github.com/ndphillips/FFTrees. comments, tips, bug reports, please post https://github.com/ndphillips/FFTrees/issues contact Nathaniel Nathaniel.D.Phillips.@gmail.com https://www.linkedin.com//nathanieldphillips/.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Nathaniel Phillips. Author. Hansjoerg Neth. Author, maintainer. Jan Woike. Author. Wolfgang Gaissmaier. Author.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Phillips, N. D., Neth, H., Woike, J. K., & Gaissmaier, W. (2017). FFTrees: toolbox create, visualize, evaluate fast--frugal decision trees. Judgment Decision Making, 12 (4), 344--368. doi 10.1017/S1930297500006239","code":"@Article{, title = {FFTrees: A toolbox to create, visualize, and evaluate fast-and-frugal decision trees}, author = {Nathaniel D Phillips and Hansjörg Neth and Jan K Woike and Wolfgang Gaissmaier}, year = {2017}, journal = {Judgment and Decision Making}, volume = {12}, number = {4}, pages = {344--368}, address = {PDF at }, note = {R package (version 2.0.0, June 6, 2023)}, url = {https://CRAN.R-project.org/package=FFTrees}, doi = {10.1017/S1930297500006239}, }"},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"fftrees-2009000-","dir":"","previous_headings":"","what":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"R package FFTrees creates, visualizes evaluates fast--frugal decision trees (FFTs) solving binary classification tasks, using algorithms methods described Phillips, Neth, Woike & Gaissmaier (2017, 10.1017/S1930297500006239).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"what-are-fast-and-frugal-trees-ffts","dir":"","previous_headings":"","what":"What are fast-and-frugal trees (FFTs)?","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"Fast--frugal trees (FFTs) simple transparent decision algorithms solving binary classification problems. key feature making FFTs faster frugal decision trees every node allows making decision. predicting novel cases, performance FFTs competes complex algorithms machine learning techniques, logistic regression (LR), support-vector machines (SVM), random forests (RF). Apart faster requiring less information, FFTs tend robust overfitting, easy interpret, use, communicate.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"latest release FFTrees available CRAN https://CRAN.R-project.org/package=FFTrees: current development version can installed GitHub repository https://github.com/ndphillips/FFTrees:","code":"install.packages(\"FFTrees\") # install.packages(\"devtools\") devtools::install_github(\"ndphillips/FFTrees\", build_vignettes = TRUE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"getting-started","dir":"","previous_headings":"","what":"Getting started","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"example, let’s create FFT predicting patients’ heart disease status (Healthy vs. Disease) based heartdisease dataset included FFTrees:","code":"library(FFTrees) # load package"},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"using-data","dir":"","previous_headings":"Getting started","what":"Using data","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"heartdisease data provides medical information 303 patients examined heart disease. full data contains binary criterion variable describing true state patient split two subsets: heart.train set fitting decision trees, heart.test set testing trees. first rows columns subsets heartdisease data: heart.train (training / fitting data) describes 150 patients: Table 1: Beginning heart.train subset (using data 150 patients fitting/training FFTs). heart.test (testing / prediction data) describes 153 different patients variables: Table 2: Beginning heart.test subset (used predict diagnosis 153 new patients). challenge predict patient’s diagnosis — column logical values indicating true state patient (.e., TRUE  FALSE, based patient suffering suffering heart disease) — values potential predictors.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"questions-answered-by-ffts","dir":"","previous_headings":"Getting started","what":"Questions answered by FFTs","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"solve binary classification problems FFTs, must answer two key questions: variables use predict criterion? use combine predictor variables FFTs? created FFTs, additional questions include: accurate predictions specific FFT? costly predictions algorithm? FFTrees package answers questions creating, evaluating, visualizing FFTs.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"creating-fast-and-frugal-trees-ffts","dir":"","previous_headings":"Getting started","what":"Creating fast-and-frugal trees (FFTs)","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"use main FFTrees() function create FFTs heart.train data evaluate predictive performance heart.test data: main FFTrees() function allows creating FFTrees object heartdisease data: Evaluating FFTrees() analyzes training data, creates several FFTs, applies test data. results stored object heart_fft, can printed, plotted summarized (options selecting specific data trees). Let’s plot FFTrees object visualize tree predictive performance (test data): Figure 1: fast--frugal tree (FFT) predicting heart disease test data performance characteristics. summary trees FFTrees object key performance statistics can obtained summary(heart_fft).","code":"# Create an FFTrees object from the heartdisease data: heart_fft <- FFTrees(formula = diagnosis ~., data = heart.train, data.test = heart.test, decision.labels = c(\"Healthy\", \"Disease\")) # Plot the best tree applied to the test data: plot(heart_fft, data = \"test\", main = \"Heart Disease\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"building-ffts-from-verbal-descriptions","dir":"","previous_headings":"Getting started","what":"Building FFTs from verbal descriptions","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"FFTs simple even can create ‘words’ apply data. example, let’s create tree following three nodes evaluate performance heart.test data: sex = 1, predict Disease. age < 45, predict Healthy. thal = {fd, normal}, predict Healthy, otherwise, predict Disease. conditions can directly supplied .tree argument FFTrees(): Figure 2: FFT predicting heart disease created verbal description. performance measures (bottom panel Figure 2) show particular tree somewhat biased: nearly perfect sensitivity (.e., good identifying cases Disease) suffers low specificity (.e., performs poorly identifying Healthy cases). Expressed terms errors, my_fft incurs misses expense many false alarms. Although accuracy custom tree still exceeds data’s baseline fair amount, FFTs heart_fft (created ) strike better balance. Overall, counts “best” tree particular problem depends many factors (e.g., goal fitting vs. predicting data trade-offs maximizing accuracy vs. incorporating costs cues errors). explore range options, FFTrees package enables us design evaluate range FFTs.","code":"# Create custom FFT 'in words' and apply it to test data: # 1. Create my own FFT (from verbal description): my_fft <- FFTrees(formula = diagnosis ~., data = heart.train, data.test = heart.test, decision.labels = c(\"Healthy\", \"Disease\"), my.tree = \"If sex = 1, predict Disease. If age < 45, predict Healthy. If thal = {fd, normal}, predict Healthy, Otherwise, predict Disease.\") # 2. Plot and evaluate my custom FFT (for test data): plot(my_fft, data = \"test\", main = \"My custom FFT\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"resources","dir":"","previous_headings":"","what":"Resources","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"following versions FFTrees corresponding resources available:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/index.html","id":"references","dir":"","previous_headings":"","what":"References","title":"Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees","text":"fun creating FFTrees package hope like ! comprehensive, yet accessible introduction FFTs, recommend article journal Judgment Decision Making (2017), entitled FFTrees: toolbox create, visualize,evaluate fast--frugal decision trees (available html | PDF ). Citation (APA format): Phillips, N. D., Neth, H., Woike, J. K. & Gaissmaier, W. (2017). FFTrees: toolbox create, visualize, evaluate fast--frugal decision trees. Judgment Decision Making, 12 (4), 344–368. doi 10.1017/S1930297500006239 encourage read article learn history FFTs FFTrees package creates, visualizes, evaluates . using FFTrees work, please cite us share experiences (e.g., GitHub) can continue developing package.  2024, 130 scientific publications used cited FFTrees (see Google Scholar full list). Examples include: Lötsch, J., Haehner, ., & Hummel, T. (2020). Machine-learning-derived rules set excludes risk Parkinson’s disease patients olfactory gustatory symptoms high accuracy. Journal Neurology, 267(2), 469–478. doi 10.1007/s00415-019-09604-6 Kagan, R., Parlee, L., Beckett, B., Hayden, J. B., Gundle, K. R., & Doung, Y. C. (2020). Radiographic parameter-driven decision tree reliably predicts aseptic mechanical failure compressive osseointegration fixation. Acta Orthopaedica, 91(2), 171–176. doi 10.1080/17453674.2020.1716295 Klement, R. J., Sonke, J. J., Allgäuer, M., Andratschke, N., Appold, S., Belderbos, J., … & Mantel, F. (2020). Correlating dose variables local tumor control stereotactic body radiotherapy early stage non-small cell lung cancer: modeling study 1500 individual treatments. International Journal Radiation Oncology * Biology * Physics. doi 10.1016/j.ijrobp.2020.03.005 Nobre, G. G., Hunink, J. E., Baruth, B., Aerts, J. C., & Ward, P. J. (2019). Translating large-scale climate variability crop production forecast Europe. Scientific Reports, 9(1), 1–13. doi 10.1038/s41598-018-38091-4 Buchinsky, F. J., Valentino, W. L., Ruszkay, N., Powell, E., Derkay, C. S., Seedat, R. Y., … & Mortelliti, . J. (2019). Age diagnosis, HPV type, strongly associated clinical course recurrent respiratory papillomatosis. PloS One, 14(6). doi 10.1371/journal.pone.0216697 [File README.Rmd last updated 2024-05-23.]","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees-package.html","id":null,"dir":"Reference","previous_headings":"","what":"FFTrees: Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees — FFTrees-package","title":"FFTrees: Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees — FFTrees-package","text":"Create, visualize, test fast--frugal decision trees (FFTs) using algorithms methods described Phillips, Neth, Woike & Gaissmaier (2017), doi:10.1017/S1930297500006239 . FFTs simple transparent decision trees solving binary classification problems. FFTs can preferable complex algorithms require little information, easy understand communicate, robust overfitting.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"FFTrees: Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees — FFTrees-package","text":"Maintainer: Hansjoerg Neth h.neth@uni.kn (ORCID) Authors: Nathaniel Phillips Nathaniel.D.Phillips.@gmail.com (ORCID) Jan Woike (ORCID) Wolfgang Gaissmaier (ORCID)","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees.guide.html","id":null,"dir":"Reference","previous_headings":"","what":"Open the FFTrees package guide — FFTrees.guide","title":"Open the FFTrees package guide — FFTrees.guide","text":"Open FFTrees package guide","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees.guide.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Open the FFTrees package guide — FFTrees.guide","text":"","code":"FFTrees.guide()"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees.guide.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Open the FFTrees package guide — FFTrees.guide","text":"return value, called side effects.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees.html","id":null,"dir":"Reference","previous_headings":"","what":"Main function to create and apply fast-and-frugal trees (FFTs) — FFTrees","title":"Main function to create and apply fast-and-frugal trees (FFTs) — FFTrees","text":"FFTrees workhorse function FFTrees package creating fast--frugal trees (FFTs). FFTs decision algorithms solving binary classification tasks, .e., predict values binary criterion variable based 1 multiple predictor variables (cues). Using FFTrees data usually generates range FFTs corresponding summary statistics (FFTrees object) can printed, plotted, examined . criterion predictor variables specified formula notation. Based settings data data.test, FFTs trained (required) training dataset (given set current goal values) evaluated (predict) (optional) test dataset. existing FFTrees object object tree.definitions provided inputs, new FFTs created. arguments provided, tree.definitions take priority FFTs existing object. Specifically, tree.definitions provided, assigned FFTs x. tree.definitions provided, existing FFTrees object object provided, trees object assigned FFTs x.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Main function to create and apply fast-and-frugal trees (FFTs) — FFTrees","text":"","code":"FFTrees( formula = NULL, data = NULL, data.test = NULL, algorithm = \"ifan\", train.p = 1, goal = NULL, goal.chase = NULL, goal.threshold = NULL, max.levels = NULL, numthresh.method = \"o\", numthresh.n = 10, repeat.cues = TRUE, stopping.rule = \"exemplars\", stopping.par = 0.1, sens.w = 0.5, cost.outcomes = NULL, cost.cues = NULL, main = NULL, decision.labels = c(\"False\", \"True\"), my.goal = NULL, my.goal.fun = NULL, my.tree = NULL, object = NULL, tree.definitions = NULL, quiet = list(ini = TRUE, fin = FALSE, mis = FALSE, set = TRUE), comp = NULL, force = NULL, rank.method = NULL, rounding = NULL, store.data = NULL, verbose = NULL, do.comp = NULL, do.cart = NULL, do.lr = NULL, do.rf = NULL, do.svm = NULL )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Main function to create and apply fast-and-frugal trees (FFTs) — FFTrees","text":"formula formula. formula specifying binary criterion variable (logical) function 1 predictor variables (cues). data data frame. dataset used training (fitting) FFTs alternative algorithms. data must contain binary criterion variable specified formula potential predictors (can categorical numeric variables). data.test data frame. optional dataset used model testing (prediction) structure data. algorithm character string. algorithm used create FFTs. Can 'ifan', 'dfan'. train.p numeric. percentage data use training data.test specified? example, train.p = .50 randomly split data 50% training set 50% test set. Default: train.p = 1 (.e., using data training). goal character string indicating statistic maximize selecting trees: \"acc\" = overall accuracy, \"bacc\" = balanced accuracy, \"wacc\" = weighted accuracy, \"dprime\" = discriminability, \"cost\" = costs (based cost.outcomes cost.cues). goal.chase character string indicating statistic maximize constructing trees: \"acc\" = overall accuracy, \"bacc\" = balanced accuracy, \"wacc\" = weighted accuracy, \"dprime\" = discriminability, \"cost\" = costs (based cost.outcomes cost.cues). goal.threshold character string indicating criterion maximize optimizing cue thresholds: \"acc\" = overall accuracy, \"bacc\" = balanced accuracy, \"wacc\" = weighted accuracy, \"dprime\" = discriminability, \"cost\" = costs (based cost.outcomes, cost.cues constant per cue). default goals set fftrees_create. max.levels integer. maximum number nodes (levels) considered FFT. combinations possible exit structures considered, larger values max.levels create larger sets FFTs. numthresh.method thresholds numeric cues determined (character)? \"o\" optimize thresholds (goal.threshold), \"m\" use median. Default: numthresh.method = \"o\". numthresh.n number numeric thresholds try (integer). Default: numthresh.n = 10. repeat.cues May cues occur multiple times within tree (logical)? Default: repeat.cues = TRUE. stopping.rule character string indicating method stop growing trees. Available options : \"exemplars\": tree grows small proportion unclassified exemplars remain; \"levels\": tree grows certain level reached; \"statdelta\": tree grows change criterion statistic goal.chase exceeds threshold level. (setting currently experimental includes first level beyond threshold. tree statistics can non-monotonic, option may yield inconsistent results.) stopping methods use stopping.par set numeric threshold value. Default: stopping.rule = \"exemplars\". stopping.par numeric. numeric parameter indicating criterion value current stopping.rule. stopping.rule \"levels\", number desired levels (integer). stopping rule \"exemplars\", smallest proportion exemplars allowed last level. stopping.rule \"statdelta\", minimum required change (goal.chase value) include level. Default: stopping.par = .10. sens.w numeric value 0 1 indicating weight sensitivity relative specificity optimizing weighted accuracy (e.g., goal = 'wacc'). Default: sens.w = .50 (.e., wacc corresponds bacc). cost.outcomes list length 4 specifying cost value one 4 possible classification outcomes. list elements must named 'hi', 'fa', 'mi', 'cr' (specifying costs hit, false alarm, miss, correct rejection, respectively) provide numeric cost value. E.g.; cost.outcomes = listc(\"hi\" = 0, \"fa\" = 10, \"mi\" = 20, \"cr\" = 0) imposes false alarm miss costs 10 20 units, respectively, correct decisions costs. cost.cues list containing cost cue (common unit). list element must name corresponding cue (.e., variable data), single (positive numeric) value. Cues data present cost.cues assumed costs (.e., cost value 0). main string. optional label dataset. Passed functions, like plot.FFTrees, print.FFTrees. decision.labels vector strings length 2 text labels negative positive decision/prediction outcomes (.e., left vs. right, noise vs. signal, 0 vs. 1, respectively, character). E.g.; decision.labels = c(\"Healthy\", \"Diseased\"). .goal name optimization measure defined .goal.fun (character string). Example: .goal = \"my_acc\" (see .goal.fun corresponding function). Default: .goal = NULL. .goal.fun definition outcome measure optimize, defined function frequency counts 4 basic classification outcomes hi, fa, mi, cr (.e., R function 4 arguments hi, fa, mi, cr). Example: .goal.fun = function(hi, fa, mi, cr){(hi + cr)/(hi + fa + mi + cr)} (.e., accuracy). Default: .goal.fun = NULL. .tree verbal description FFT, .e., \"FFT words\" (character string). example, .tree = \"age > 20, predict TRUE. sex = {m}, predict FALSE. Otherwise, predict TRUE.\". object optional existing FFTrees object. specified, new FFTs fitted, existing trees applied data data.test. formula, data data.test specified, current values object used. tree.definitions optional data.frame hard-coded FFT definitions (format x$trees$definitions FFTrees object x). specified, new FFTs fitted (.e., algorithm functions evaluating cues creating FFTs skipped). Instead, tree definitions provided used re-evaluate current FFTrees object current data. quiet list 4 logical arguments: detailed progress reports suppressed? Setting list elements FALSE helpful diagnosing errors. Default: quiet = list(ini = TRUE, fin = FALSE, mis = FALSE, set = TRUE), initial vs. final steps, missing cases, parameter settings, respectively. Providing single logical value sets elements TRUE FALSE. comp, .comp, .lr, .cart, .svm, .rf, force, rank.method, rounding, store.data, verbose Deprecated arguments (unused replaced, retired future releases).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Main function to create and apply fast-and-frugal trees (FFTs) — FFTrees","text":"FFTrees object following elements: criterion_name name binary criterion variable (character). cue_names names potential predictor variables (cues) data (character). formula formula specified creating FFTs. trees list FFTs created, details contained n, best, definitions, inwords, stats, level_stats, decisions. data original training test data (available). params list defined control parameters (e.g.; algorithm, goal, sens.w, well various thresholds, stopping rule, cost parameters). cues list cue information, details contained thresholds stats.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/FFTrees.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Main function to create and apply fast-and-frugal trees (FFTs) — FFTrees","text":"","code":"# 1. Create fast-and-frugal trees (FFTs) for heart disease: heart.fft <- FFTrees(formula = diagnosis ~ ., data = heart.train, data.test = heart.test, main = \"Heart Disease\", decision.labels = c(\"Healthy\", \"Diseased\") ) #> ✔ Created an FFTrees object. #> Ranking 13 cues: ■■■■■■■■ 23% | ETA: 1s #> Ranking 13 cues: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s #> #> ✔ Ranked 13 cues (optimizing 'bacc'). #> ✔ Created 7 FFTs with 'ifan' algorithm (chasing 'bacc'). #> ✔ Defined 7 FFTs. #> ✔ Applied 7 FFTs to 'train' data. #> ✔ Ranked 7 FFTs by 'train' data. #> ✔ Applied 7 FFTs to 'test' data. #> ✔ Expressed 7 FFTs in words. # 2. Print a summary of the result: heart.fft # same as: #> Heart Disease #> FFTrees #> - Trees: 7 fast-and-frugal trees predicting diagnosis #> - Cost of outcomes: hi = 0, fa = 1, mi = 1, cr = 0 #> - Cost of cues: #> age sex cp trestbps chol fbs restecg thalach #> 1 1 1 1 1 1 1 1 #> exang oldpeak slope ca thal #> 1 1 1 1 1 #> #> FFT #1: Definition #> [1] If thal = {rd,fd}, decide Diseased. #> [2] If cp != {a}, decide Healthy. #> [3] If ca > 0, decide Diseased, otherwise, decide Healthy. #> #> FFT #1: Training Accuracy #> Training data: N = 150, Pos (+) = 66 (44%) #> #> | | True + | True - | Totals: #> |----------|--------|--------| #> | Decide + | hi 54 | fa 18 | 72 #> | Decide - | mi 12 | cr 66 | 78 #> |----------|--------|--------| #> Totals: 66 84 N = 150 #> #> acc = 80.0% ppv = 75.0% npv = 84.6% #> bacc = 80.2% sens = 81.8% spec = 78.6% #> #> FFT #1: Training Speed, Frugality, and Cost #> mcu = 1.74, pci = 0.87 #> cost_dec = 0.200, cost_cue = 1.740, cost = 1.940 #> # print(heart.fft, data = \"train\", tree = \"best.train\") # 3. Plot an FFT applied to training data: plot(heart.fft) # same as: # plot(heart.fft, what = \"all\", data = \"train\", tree = \"best.train\") # 4. Apply FFT to (new) testing data: plot(heart.fft, data = \"test\") # predict for Tree 1 plot(heart.fft, data = \"test\", tree = 2) # predict for Tree 2 # 5. Predict classes and probabilities for new data: predict(heart.fft, newdata = heartdisease) #> ✔ Applied 7 FFTs to 'test' data. #> ✔ Generated predictions for tree 1. #> [1] TRUE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE TRUE TRUE FALSE #> [13] TRUE TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE #> [25] TRUE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE FALSE #> [37] TRUE TRUE TRUE FALSE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE #> [49] FALSE FALSE FALSE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE FALSE #> [61] TRUE FALSE TRUE FALSE TRUE TRUE FALSE TRUE TRUE FALSE FALSE TRUE #> [73] TRUE TRUE TRUE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE TRUE #> [85] FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE TRUE #> [97] TRUE TRUE FALSE FALSE FALSE FALSE TRUE FALSE TRUE TRUE TRUE TRUE #> [109] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE #> [121] TRUE TRUE FALSE TRUE FALSE FALSE TRUE TRUE FALSE FALSE TRUE TRUE #> [133] FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE #> [145] TRUE FALSE TRUE FALSE FALSE FALSE TRUE FALSE TRUE TRUE TRUE TRUE #> [157] TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE TRUE FALSE FALSE #> [169] TRUE FALSE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE FALSE FALSE #> [181] TRUE TRUE FALSE TRUE FALSE FALSE TRUE TRUE TRUE TRUE FALSE TRUE #> [193] TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE #> [205] TRUE TRUE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE TRUE TRUE #> [217] FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE #> [229] TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE #> [241] FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE TRUE TRUE #> [253] TRUE FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE #> [265] TRUE TRUE FALSE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE #> [277] FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE #> [289] TRUE FALSE TRUE FALSE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE #> [301] TRUE FALSE FALSE predict(heart.fft, newdata = heartdisease, type = \"prob\") #> ✔ Applied 7 FFTs to 'test' data. #> ✔ Generated predictions for tree 1. #> # A tibble: 303 × 2 #> prob_0 prob_1 #> #> 1 0.262 0.738 #> 2 0.273 0.727 #> 3 0.262 0.738 #> 4 0.862 0.138 #> 5 0.862 0.138 #> 6 0.862 0.138 #> 7 0.273 0.727 #> 8 0.706 0.294 #> 9 0.262 0.738 #> 10 0.262 0.738 #> # ℹ 293 more rows # 6. Create a custom tree (from verbal description) with my.tree: custom.fft <- FFTrees( formula = diagnosis ~ ., data = heartdisease, my.tree = \"If age < 50, predict False. If sex = 1, predict True. If chol > 300, predict True, otherwise predict False.\", main = \"My custom FFT\") #> ✔ Created an FFTrees object. #> ✔ Created an FFT from 'my.tree' description. #> ✔ Defined 1 FFT. #> ✔ Applied 1 FFT to 'train' data. #> ✔ Ranked 1 FFT by 'train' data. #> ✔ Expressed 1 FFT in words. # Plot the (pretty bad) custom tree: plot(custom.fft)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_fft_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Add an FFT definition to tree definitions — add_fft_df","title":"Add an FFT definition to tree definitions — add_fft_df","text":"add_fft_df adds definition(s) one FFT(s) (multi-line format FFTrees object) single FFT (tidy data frame) multi-line FFT definitions FFTrees object. add_fft_df allows collecting combining (sets ) tree definitions manipulating tree trimming functions.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_fft_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add an FFT definition to tree definitions — add_fft_df","text":"","code":"add_fft_df(fft, ffts_df = NULL, quiet = FALSE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_fft_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add an FFT definition to tree definitions — add_fft_df","text":"fft (set ) FFT definition(s) (multi-line format FFTrees object) one FFT definition (data frame tidy format, one row per node). ffts_df set FFT definitions (data frame, usually FFTrees object, suitable variable names pass verify_ffts_df. Default: ffts_df = NULL. quiet Hide feedback messages (logical)? Default: quiet = FALSE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_fft_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add an FFT definition to tree definitions — add_fft_df","text":"(set ) FFT definition(s) one line FFT definition format used FFTrees object (data frame).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_nodes.html","id":null,"dir":"Reference","previous_headings":"","what":"Add nodes to an FFT definition — add_nodes","title":"Add nodes to an FFT definition — add_nodes","text":"add_nodes allows adding one nodes existing FFT definition (tidy data frame format). add_nodes allows directly set change value(s) class, cue, direction, threshold, exit, FFT definition specified nodes. rudimentary verification plausible entries. Importantly, however, add_nodes ignorant data, values variables validated specific set data. Values nodes refer new position final FFT. Duplicate values nodes ignored (last entry used). new exit node added, exit type former final node set signal value (.e., exit_types[2]).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_nodes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add nodes to an FFT definition — add_nodes","text":"","code":"add_nodes( fft, nodes = NA, class = NA, cue = NA, direction = NA, threshold = NA, exit = NA, quiet = FALSE )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_nodes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add nodes to an FFT definition — add_nodes","text":"fft One FFT definition (data frame tidy format, one row per node). nodes FFT nodes added (integer vector). Values refer new position final FFT (.e., adding nodes fft). Default: nodes = NA. class class values nodes (character). cue cue names nodes (character). direction direction values nodes (character). threshold threshold values nodes (character). exit exit values nodes (values exit_types). quiet Hide feedback messages (logical)? Default: quiet = FALSE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_nodes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add nodes to an FFT definition — add_nodes","text":"One FFT definition (data frame tidy format, one row per node).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_stats.html","id":null,"dir":"Reference","previous_headings":"","what":"Add decision statistics to data (based on frequency counts of a 2x2 matrix of classification outcomes) — add_stats","title":"Add decision statistics to data (based on frequency counts of a 2x2 matrix of classification outcomes) — add_stats","text":"add_stats assumes input 4 essential classification outcomes (frequency counts data frame \"data\" variable names \"hi\", \"fa\", \"mi\", \"cr\") uses compute various decision accuracy measures.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_stats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add decision statistics to data (based on frequency counts of a 2x2 matrix of classification outcomes) — add_stats","text":"","code":"add_stats( data, correction = 0.25, sens.w = NULL, my.goal = NULL, my.goal.fun = NULL, cost.outcomes = NULL, cost.each = NULL )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_stats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add decision statistics to data (based on frequency counts of a 2x2 matrix of classification outcomes) — add_stats","text":"data data frame 4 frequency counts (integer values, named \"hi\", \"fa\", \"mi\", \"cr\"). correction numeric. Correction added counts calculating dprime. Default: correction = .25. sens.w numeric. Sensitivity weight (computing weighted accuracy, wacc). Default: sens.w = NULL (ensure values passed calling function). .goal Name optional, user-defined goal (character string). Default: .goal = NULL. .goal.fun User-defined goal function (4 arguments hi fa mi cr). Default: .goal.fun = NULL. cost.outcomes list. list length 4 named \"hi\", \"fa\", \"mi\", \"cr\", specifying costs hit, false alarm, miss, correct rejection, respectively. E.g.; cost.outcomes = listc(\"hi\" = 0, \"fa\" = 10, \"mi\" = 20, \"cr\" = 0) means false alarm miss cost 10 20 units, respectively, correct decisions incur costs. Default: cost.outcomes = NULL (ensure values passed calling function). cost.numeric. optional fixed cost added outputs (e.g., cost using cue). Default: cost.= NULL (ensure values passed calling function).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_stats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add decision statistics to data (based on frequency counts of a 2x2 matrix of classification outcomes) — add_stats","text":"data frame variables computed accuracy cost measures (dropping inputs).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/add_stats.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add decision statistics to data (based on frequency counts of a 2x2 matrix of classification outcomes) — add_stats","text":"Providing numeric values cost.(vector) cost.outcomes (named list) allows computing cost information counts corresponding classification decisions.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/blood.html","id":null,"dir":"Reference","previous_headings":"","what":"Blood donation data — blood","title":"Blood donation data — blood","text":"Data Blood Transfusion Service Center Hsin-Chu City Taiwan.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/blood.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Blood donation data — blood","text":"","code":"blood"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/blood.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Blood donation data — blood","text":"data frame containing 748 rows 5 columns. recency Months since last donation frequency Total number donations total Total blood donated (c.c.) time Months since first donation donation.crit Criterion: person donate blood (March 2007)? Values: 0/vs. 1/yes (76.2% vs.\\ 23.8%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/blood.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Blood donation data — blood","text":"https://archive.ics.uci.edu/ml/datasets/Blood+Transfusion+Service+Center Original owner donor: Prof. -Cheng Yeh Department Information Management Chung-Hua University","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/breastcancer.html","id":null,"dir":"Reference","previous_headings":"","what":"Breast cancer data — breastcancer","title":"Breast cancer data — breastcancer","text":"Physiological data patients tested breast cancer.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/breastcancer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Breast cancer data — breastcancer","text":"","code":"breastcancer"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/breastcancer.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Breast cancer data — breastcancer","text":"data frame containing 699 patients (rows) 9 variables (columns). thickness Clump Thickness cellsize.unif Uniformity Cell Size cellshape.unif Uniformity Cell Shape adhesion Marginal Adhesion epithelial Single Epithelial Cell Size nuclei.bare Bare Nuclei chromatin Bland Chromatin nucleoli Normal Nucleoli mitoses Mitoses diagnosis Criterion: Absence/presence breast cancer. Values: FALSE vs. TRUE (65.0% vs.\\ 35.0%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/breastcancer.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Breast cancer data — breastcancer","text":"https://archive.ics.uci.edu/ml/datasets/Breast+Cancer+Wisconsin+(Original) Original creator: Dr. William H. Wolberg (physician) University Wisconsin Hospitals Madison, Wisconsin, USA","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/breastcancer.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Breast cancer data — breastcancer","text":"made following enhancements original data improved usability: ID number cases excluded. numeric criterion value 2 benign 4 malignant converted logical (.e., TRUE/FALSE). 16 cases excluded contained NA values. , data remains consistent original dataset.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/car.html","id":null,"dir":"Reference","previous_headings":"","what":"Car acceptability data — car","title":"Car acceptability data — car","text":"dataset car evaluations based basic features, derived simple hierarchical decision model.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/car.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Car acceptability data — car","text":"","code":"car"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/car.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Car acceptability data — car","text":"data frame containing 1728 cars (rows) 7 variables (columns). buying.price price buying car, Factor (high, low, med, vhigh) maint.price price maintenance, Factor (high, low, med, vhigh) doors number doors, Factor (2, 3, 4, 5more) persons capacity terms persons carry, Factor (2, 4, ) luggage size luggage boot, Factor (big, med, small) safety estimated safety car, Factor (high, low, med) acceptability Criterion: Category acceptability rating. Values: unacc/ vgood/ good/ acc","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/car.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Car acceptability data — car","text":"http://archive.ics.uci.edu/ml/datasets/Car+Evaluation Original creators donors: Marko Bohanec Blaz Zupan","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/car.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Car acceptability data — car","text":"criterion variable car's acceptability rating. criterion dataset yet binarized. using FFTrees, prerequisite step completed based individual preferences.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/car.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Car acceptability data — car","text":"Bohanec, M., Rajkovic, V. (1990): Expert system decision making. Sistemica, 1 (1), 145–157.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/classtable.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute classification statistics for binary prediction and criterion (e.g.; truth) vectors — classtable","title":"Compute classification statistics for binary prediction and criterion (e.g.; truth) vectors — classtable","text":"main input 2 logical vectors prediction criterion values.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/classtable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute classification statistics for binary prediction and criterion (e.g.; truth) vectors — classtable","text":"","code":"classtable( prediction_v = NULL, criterion_v = NULL, correction = 0.25, sens.w = NULL, cost.outcomes = NULL, cost_v = NULL, my.goal = NULL, my.goal.fun = NULL, quiet_mis = FALSE, na_prediction_action = \"ignore\" )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/classtable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute classification statistics for binary prediction and criterion (e.g.; truth) vectors — classtable","text":"prediction_v logical. logical vector predictions. criterion_v logical. logical vector (TRUE) criterion values. correction numeric. Correction added counts calculating dprime. Default: correction = .25. sens.w numeric. Sensitivity weight parameter (0 1, computing wacc). Default: sens.w = NULL (ensure values passed calling function). cost.outcomes list. list length 4 names 'hi', 'fa', 'mi', 'cr' specifying costs hit, false alarm, miss, correct rejection, respectively. instance, cost.outcomes = listc(\"hi\" = 0, \"fa\" = 10, \"mi\" = 20, \"cr\" = 0) means false alarm miss cost 10 20, respectively, correct decisions cost. Default: cost.outcomes = NULL (ensure values passed calling function). cost_v numeric. Additional cost value decision (optional vector numeric values). Typically used include cue cost decision (constant current level FFT). Default: cost_v = NULL (ensure values passed calling function). .goal Name optional, user-defined goal (character string). Default: .goal = NULL. .goal.fun User-defined goal function (4 arguments hi fa mi cr). Default: .goal.fun = NULL. quiet_mis logical value passed hide/show NA user feedback (usually x$params$quiet$mis calling function). Default: quiet_mis = FALSE (.e., show user feedback). na_prediction_action happens prediction possible? (Experimental currently unused.)","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/classtable.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compute classification statistics for binary prediction and criterion (e.g.; truth) vectors — classtable","text":"primary confusion matrix computed confusionMatrix.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/contraceptive.html","id":null,"dir":"Reference","previous_headings":"","what":"Contraceptive use data — contraceptive","title":"Contraceptive use data — contraceptive","text":"subset 1987 National Indonesia Contraceptive Prevalence Survey.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/contraceptive.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Contraceptive use data — contraceptive","text":"","code":"contraceptive"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/contraceptive.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Contraceptive use data — contraceptive","text":"data frame containing 1473 cases (rows) 10 variables (columns). wife.age Wife's age, Numeric wife.edu Wife's education, Nummeric, (1=low, 2, 3, 4=high) hus.ed Husband's education, Nummeric, (1=low, 2, 3, 4=high) children Number children ever born, Numeric wife.rel Wife's religion, Numeric, (0=Non-Islam, 1=Islam) wife.work Wife's now working?, Nummeric, (0=Yes, 1=) hus.occ Husband's occupation, Nummeric, (1, 2, 3, 4) sol Standard--living index, Nummeric, (1=low, 2, 3, 4=high) media Media exposure, Numeric, (0=Good, 1=good) cont.crit Criterion: Use contraceptive (logical). Values: FALSE vs. TRUE (42.7% vs. 57.3%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/contraceptive.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Contraceptive use data — contraceptive","text":"https://archive.ics.uci.edu/ml/datasets/Contraceptive+Method+Choice Original creator donor: Tjen-Sien Lim","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/contraceptive.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Contraceptive use data — contraceptive","text":"samples describe married women either pregnant know pregnant time interview. problem consists predicting woman's current contraceptive method choice (: binarized cont.crit) based demographic socio-economic characteristics. made following enhancements original data improved usability: criterion binarized class attribute variable three levels (1 = -use, 2 = Long-term, 3 = Short-term), logical variable (TRUE vs. FALSE). , data remains consistent original dataset.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/creditapproval.html","id":null,"dir":"Reference","previous_headings":"","what":"Credit approval data — creditapproval","title":"Credit approval data — creditapproval","text":"data reports predictors result credit card applications. attribute names values changed symbols protect confidentiality.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/creditapproval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Credit approval data — creditapproval","text":"","code":"creditapproval"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/creditapproval.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Credit approval data — creditapproval","text":"data frame containing 690 cases (rows) 15 variables (columns). c.1 categorical: b, c.2 continuous c.3 continuous c.4 categorical: u, y, l, t c.5 categorical: g, p, gg c.6 categorical: c, d, cc, , j, k, m, r, q, w, x, e, aa, ff c.7 categorical: v, h, bb, j, n, z, dd, ff, o c.8 continuous c.9 categorical: t, f c.10 categorical: t, f c.11 continuous c.12 categorical: t, f c.13 categorical: g, p, s c.14 continuous c.15 continuous crit Criterion: Credit approval. Values: TRUE (+) vs. FALSE (-) (44.5% vs. 55.5%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/creditapproval.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Credit approval data — creditapproval","text":"https://archive.ics.uci.edu/ml/datasets/Credit+Approval","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/creditapproval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Credit approval data — creditapproval","text":"dataset contains mix attributes – continuous, nominal small sample sizes, nominal larger sample sizes. also missing values. made following enhancements original data improved usability: missing values, denoted \"?\" dataset, transformed NA values. Binary factor variables exclusive \"t\" \"f\" values converted logical vectors (TRUE/FALSE). , data remains consistent original dataset.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/describe_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Describe data — describe_data","title":"Describe data — describe_data","text":"Calculate key descriptive statistics given set data.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/describe_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Describe data — describe_data","text":"","code":"describe_data(data, data_name, criterion_name, baseline_value)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/describe_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Describe data — describe_data","text":"data data frame criterion variable criterion_name. data_name character string specifying name data. criterion_name character string specifying criterion name. baseline_value value criterion_name denoting baseline (e.g., TRUE FALSE).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/describe_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Describe data — describe_data","text":"data frame descriptive statistics.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/describe_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Describe data — describe_data","text":"","code":"data(heartdisease) describe_data(heartdisease, \"heartdisease\", criterion_name = \"diagnosis\", baseline_value = TRUE) #> # A tibble: 1 × 7 #> Name Cases_n Criterion Baseline_pct Predictors_n NAs_n NAs_pct #> #> 1 heartdisease 303 diagnosis 45.9 13 0 0"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/drop_nodes.html","id":null,"dir":"Reference","previous_headings":"","what":"Drop a node from an FFT definition — drop_nodes","title":"Drop a node from an FFT definition — drop_nodes","text":"drop_nodes deletes one nodes existing FFT definition (removing corresponding rows FFT definition tidy data frame format). dropping final node, last remaining node becomes new final node (.e., gains second exit). Duplicates nodes dropped (rather incrementally) nodes range 1:nrow(fft) ignored. Dropping nodes yields error. drop_nodes inverse function select_nodes. Inserting new nodes possible add_nodes.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/drop_nodes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Drop a node from an FFT definition — drop_nodes","text":"","code":"drop_nodes(fft, nodes = NA, quiet = FALSE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/drop_nodes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Drop a node from an FFT definition — drop_nodes","text":"fft One FFT definition (data frame tidy format, one row per node). nodes FFT nodes drop (integer vector). Default: nodes = NA. quiet Hide feedback messages (logical)? Default: quiet = FALSE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/drop_nodes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Drop a node from an FFT definition — drop_nodes","text":"One FFT definition (data frame tidy format, one row per node).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/edit_nodes.html","id":null,"dir":"Reference","previous_headings":"","what":"Edit nodes in an FFT definition — edit_nodes","title":"Edit nodes in an FFT definition — edit_nodes","text":"edit_nodes allows manipulating one nodes existing FFT definition (tidy data frame format). edit_nodes allows directly set change value(s) class, cue, direction, threshold, exit, FFT definition specified nodes. rudimentary verification plausible entries. Importantly, however, edit_nodes ignorant data, values variables validated specific set data. Repeated changes node possible (repeating corresponding integer value nodes).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/edit_nodes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Edit nodes in an FFT definition — edit_nodes","text":"","code":"edit_nodes( fft, nodes = NA, class = NA, cue = NA, direction = NA, threshold = NA, exit = NA, quiet = FALSE )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/edit_nodes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Edit nodes in an FFT definition — edit_nodes","text":"fft One FFT definition (data frame tidy format, one row per node). nodes FFT nodes edited (integer vector). Default: nodes = NA. class class values nodes (character). cue cue names nodes (character). direction direction values nodes (character). threshold threshold values nodes (character). exit exit values nodes (values exit_types). quiet Hide feedback messages (logical)? Default: quiet = FALSE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/edit_nodes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Edit nodes in an FFT definition — edit_nodes","text":"One FFT definition (data frame tidy format, one row per node).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fact_clean.html","id":null,"dir":"Reference","previous_headings":"","what":"Clean factor variables in prediction data — fact_clean","title":"Clean factor variables in prediction data — fact_clean","text":"Clean factor variables prediction data","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fact_clean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clean factor variables in prediction data — fact_clean","text":"","code":"fact_clean(data.train, data.test, show.warning = T)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fact_clean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clean factor variables in prediction data — fact_clean","text":"data.train training dataset data.test testing dataset show.warning logical","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fertility.html","id":null,"dir":"Reference","previous_headings":"","what":"Fertility data — fertility","title":"Fertility data — fertility","text":"dataset describes sample 100 volunteers providing semen sample analyzed according 2010 criteria.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fertility.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fertility data — fertility","text":"","code":"fertility"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fertility.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Fertility data — fertility","text":"data frame containing 100 rows 10 columns. season Season analysis performed. (winter, spring, summer, fall) age Age time analysis child.dis Childish diseases (ie , chicken pox, measles, mumps, polio) (yes(1), (0)) trauma Accident serious trauma (yes(1), (0)) surgery Surgical intervention (yes(1), (0)) fevers High fevers last year (less three months ago(-1), three months ago (0), . (1)) alcohol Frequency alcohol consumption (several times day, every day, several times week, week, hardly ever never) smoking Smoking habit (never(-1), occasional (0)) daily (1)) sitting Number hours spent sitting per day diagnosis Criterion: Diagnosis normal (TRUE) vs. altered (FALSE) (88.0% vs.\\ 22.0%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fertility.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Fertility data — fertility","text":"https://archive.ics.uci.edu/ml/datasets/Fertility Original contributors: David Gil Lucentia Research Group Department Computer Technology University Alicante Jose Luis Girela Department Biotechnology University Alicante","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fertility.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fertility data — fertility","text":"Sperm concentration related socio-demographic data, environmental factors, health status, life habits. made following enhancements original data improved usability: criterion redefined factor variable two levels (N = Normal, O = Altered) logical variable (TRUE vs. FALSE). , data remains consistent original dataset.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_apply.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply an FFT to data and generate accuracy statistics — fftrees_apply","title":"Apply an FFT to data and generate accuracy statistics — fftrees_apply","text":"fftrees_apply applies fast--frugal tree (FFT, FFTrees object) dataset (type mydata) generates corresponding accuracy statistics (cue levels trees). fftrees_apply called internally main FFTrees function (mydata = \"train\" — test data exists — mydata = \"test\"). Alternatively, fftrees_apply called predicting outcomes new data predict.FFTrees.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_apply.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply an FFT to data and generate accuracy statistics — fftrees_apply","text":"","code":"fftrees_apply(x, mydata = NULL, newdata = NULL, fin_NA_pred = \"majority\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_apply.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply an FFT to data and generate accuracy statistics — fftrees_apply","text":"x object FFT definitions applied current data (FFTrees object). mydata type data FFT applied (character, either \"train\" \"test\"). newdata New data FFT applied (data frame). fin_NA_pred outcome predicted final node tree cue value NA (character)? Valid options : 'noise' predict FALSE (0/left/signal) corresponding cases 'signal' predict TRUE (1/right/noise) corresponding cases 'majority' predict common criterion value (.e., TRUE base rate p(TRUE) > .50 'train' data) corresponding cases 'baseline' flip random coin biased criterion baseline p(TRUE) ('train' data) corresponding cases 'dnk' yet ToDo: abstain classifying / decide 'know' / defer (.e., tertium datur) Default: fin_NA_pred = \"majority\".","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_apply.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Apply an FFT to data and generate accuracy statistics — fftrees_apply","text":"modified FFTrees object (lists x$trees containing information FFT decisions statistics).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_create.html","id":null,"dir":"Reference","previous_headings":"","what":"Create an object of class FFTrees — fftrees_create","title":"Create an object of class FFTrees — fftrees_create","text":"fftrees_create creates FFTrees object. fftrees_create called internally main FFTrees function. main purpose verify store various parameters (e.g., denote algorithms, goals, thresholds) used maximization processes evaluation purposes (e.g., sens.w cost values).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_create.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create an object of class FFTrees — fftrees_create","text":"","code":"fftrees_create( formula = NULL, data = NULL, data.test = NULL, algorithm = NULL, goal = NULL, goal.chase = NULL, goal.threshold = NULL, max.levels = NULL, numthresh.method = NULL, numthresh.n = NULL, repeat.cues = NULL, stopping.rule = NULL, stopping.par = NULL, sens.w = NULL, cost.outcomes = NULL, cost.cues = NULL, main = NULL, decision.labels = NULL, my.goal = NULL, my.goal.fun = NULL, my.tree = NULL, quiet = NULL )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_create.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create an object of class FFTrees — fftrees_create","text":"formula formula (binary criterion variable). data Training data (data frame). data.test Data testing models/prediction (data frame). algorithm Algorithm growing FFTs (\"ifan\" \"dfan\") (character string). goal Measure used select FFTs (character string). goal.chase Measure used optimize FFT creation (character string). goal.threshold Measure used optimize cue thresholds (character string). max.levels integer. numthresh.method string. numthresh.n integer. repeat.cues logical. stopping.rule string. stopping.par numeric. sens.w numeric. cost.outcomes list. cost.cues list. main string. decision.labels string. .goal name optimization measure defined .goal.fun (character string). Example: .goal = \"my_acc\" (see .goal.fun corresponding function). Default: .goal = NULL. .goal.fun definition outcome measure optimize, defined function frequency counts 4 basic classification outcomes hi, fa, mi, cr (.e., R function 4 arguments hi, fa, mi, cr). Example: .goal.fun = function(hi, fa, mi, cr){(hi + cr)/(hi + fa + mi + cr)} (.e., accuracy). Default: .goal.fun = NULL. .tree verbal description FFT, .e., \"FFT words\" (character string). example, .tree = \"age > 20, predict TRUE. sex = {m}, predict FALSE. Otherwise, predict TRUE.\". quiet list logical elements.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_create.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create an object of class FFTrees — fftrees_create","text":"new FFTrees object.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_cuerank.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate thresholds that optimize some statistic (goal) for cues in data — fftrees_cuerank","title":"Calculate thresholds that optimize some statistic (goal) for cues in data — fftrees_cuerank","text":"fftrees_cuerank takes FFTrees object x optimizes goal.threshold (x$params) cues newdata (type data).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_cuerank.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate thresholds that optimize some statistic (goal) for cues in data — fftrees_cuerank","text":"","code":"fftrees_cuerank(x = NULL, newdata = NULL, data = \"train\", rounding = NULL)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_cuerank.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate thresholds that optimize some statistic (goal) for cues in data — fftrees_cuerank","text":"x FFTrees object. newdata dataset cues ranked (data frame). data type data cues ranked (character: 'train', 'test', 'dynamic'). Default: data = 'train'. rounding integer. integer value indicating decimal digit non-integer numeric cue thresholds rounded. Default: rounding = NULL (.e., rounding).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_cuerank.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate thresholds that optimize some statistic (goal) for cues in data — fftrees_cuerank","text":"modified FFTrees object (cue rank information current data type x$cues$stats).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_cuerank.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate thresholds that optimize some statistic (goal) for cues in data — fftrees_cuerank","text":"fftrees_cuerank creates data frame cuerank_df added x$cues$stats. Note cue directions thresholds computed FFTrees always predict positive criterion values (.e., TRUE signal, rather FALSE noise). Using thresholds negative exits (.e., predicting instances FALSE noise) usually requires reversal (e.g., negating cue direction). fftrees_cuerank called (twice) fftrees_grow_fan algorithm grow fast--frugal trees (FFTs).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_define.html","id":null,"dir":"Reference","previous_headings":"","what":"Create FFT definitions — fftrees_define","title":"Create FFT definitions — fftrees_define","text":"fftrees_define defines fast--frugal trees (FFTs) either definitions provided applying algorithms (definitions provided), returns modified FFTrees object contains definitions. use cases, fftrees_define passes new FFTrees object x either fftrees_grow_fan (create new FFTs applying algorithms data) fftrees_wordstofftrees (.tree specified). existing FFTrees object object tree.definitions provided inputs, new FFTs created. arguments provided, tree.definitions take priority FFTs existing object. Specifically, tree.definitions provided, assigned FFTs x. tree.definitions provided, existing FFTrees object object provided, trees object assigned FFTs x.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_define.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create FFT definitions — fftrees_define","text":"","code":"fftrees_define(x, object = NULL, tree.definitions = NULL)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_define.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create FFT definitions — fftrees_define","text":"x current FFTrees object (changed returned). object existing FFTrees object (tree definitions). tree.definitions data.frame. optional hard-coded definition FFTs (format FFTrees object). specified, new FFTs created, tree definitions object x replaced tree definitions provided current object re-evaluated.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_define.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create FFT definitions — fftrees_define","text":"FFTrees object tree definitions.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_ffttowords.html","id":null,"dir":"Reference","previous_headings":"","what":"Describe a fast-and-frugal tree (FFT) in words — fftrees_ffttowords","title":"Describe a fast-and-frugal tree (FFT) in words — fftrees_ffttowords","text":"fftrees_ffttowords provides verbal description tree definition (defined FFTrees object). Thus, fftrees_ffttowords translates abstract FFT definition natural language output. fftrees_ffttowords complement function fftrees_wordstofftrees, parses verbal description FFT abstract tree definition FFTrees object. final sentence (tree node) FFT's description always predicts positive criterion values (.e., TRUE instances) first, predicting negative criterion values (.e., FALSE instances). Note may require reversal exit directions, final cue predicted FALSE instances. Note cue directions thresholds computed FFTrees always predict positive criterion values (.e., TRUE signal, rather FALSE noise). Using thresholds negative exits (.e., predicting instances FALSE noise) usually requires reversal (e.g., negating cue direction).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_ffttowords.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Describe a fast-and-frugal tree (FFT) in words — fftrees_ffttowords","text":"","code":"fftrees_ffttowords(x = NULL, mydata = \"train\", digits = 2)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_ffttowords.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Describe a fast-and-frugal tree (FFT) in words — fftrees_ffttowords","text":"x FFTrees object created FFTrees. mydata type data tree applied (character string \"train\" \"test\"). Default: mydata = \"train\". digits many digits round numeric values (integer)?","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_ffttowords.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Describe a fast-and-frugal tree (FFT) in words — fftrees_ffttowords","text":"modified FFTrees object x x$trees$inwords containing list string vectors.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_ffttowords.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Describe a fast-and-frugal tree (FFT) in words — fftrees_ffttowords","text":"","code":"heart.fft <- FFTrees(diagnosis ~ ., data = heartdisease, decision.labels = c(\"Healthy\", \"Disease\") ) #> ✔ Created an FFTrees object. #> Ranking 13 cues: ■■■■■■■■ 23% | ETA: 1s #> Ranking 13 cues: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s #> #> ✔ Ranked 13 cues (optimizing 'bacc'). #> ✔ Created 7 FFTs with 'ifan' algorithm (chasing 'bacc'). #> ✔ Defined 7 FFTs. #> ✔ Applied 7 FFTs to 'train' data. #> ✔ Ranked 7 FFTs by 'train' data. #> ✔ Expressed 7 FFTs in words. inwords(heart.fft) #> [1] \"If thal = {rd,fd}, decide Disease.\" #> [2] \"If cp != {a}, decide Healthy.\" #> [3] \"If ca > 0, decide Disease, otherwise, decide Healthy.\""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_grow_fan.html","id":null,"dir":"Reference","previous_headings":"","what":"Grow fast-and-frugal trees (FFTs) using the fan algorithms — fftrees_grow_fan","title":"Grow fast-and-frugal trees (FFTs) using the fan algorithms — fftrees_grow_fan","text":"fftrees_grow_fan called fftrees_define create new FFTs applying fan algorithms (specifically, either ifan dfan) data.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_grow_fan.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Grow fast-and-frugal trees (FFTs) using the fan algorithms — fftrees_grow_fan","text":"","code":"fftrees_grow_fan(x, repeat.cues = TRUE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_grow_fan.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Grow fast-and-frugal trees (FFTs) using the fan algorithms — fftrees_grow_fan","text":"x FFTrees object. repeat.cues Can cues considered/used repeatedly (logical)? Default: repeat.cues = TRUE, relevant using dfan algorithm.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_ranktrees.html","id":null,"dir":"Reference","previous_headings":"","what":"Rank FFTs by current goal — fftrees_ranktrees","title":"Rank FFTs by current goal — fftrees_ranktrees","text":"fftrees_ranktrees ranks trees FFTrees object x based current goal (either \"cost\" specified x$params$goal). fftrees_ranktrees called main FFTrees function creating FFTs applying (training) data.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_ranktrees.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rank FFTs by current goal — fftrees_ranktrees","text":"","code":"fftrees_ranktrees(x, data = \"train\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_ranktrees.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rank FFTs by current goal — fftrees_ranktrees","text":"x FFTrees object. data type data used (character). Default: data = \"train\".","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_threshold_factor_grid.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform a grid search over factor and return accuracy statistics for a given factor cue — fftrees_threshold_factor_grid","title":"Perform a grid search over factor and return accuracy statistics for a given factor cue — fftrees_threshold_factor_grid","text":"Perform grid search factor return accuracy statistics given factor cue","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_threshold_factor_grid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform a grid search over factor and return accuracy statistics for a given factor cue — fftrees_threshold_factor_grid","text":"","code":"fftrees_threshold_factor_grid( thresholds = NULL, cue_v = NULL, criterion_v = NULL, directions = \"=\", goal.threshold = NULL, sens.w = NULL, my.goal = NULL, my.goal.fun = NULL, cost.each = NULL, cost.outcomes = NULL )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_threshold_factor_grid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform a grid search over factor and return accuracy statistics for a given factor cue — fftrees_threshold_factor_grid","text":"thresholds numeric. vector factor thresholds consider. cue_v numeric. Feature/cue values. criterion_v logical. logical vector (TRUE) criterion values. directions character. Character vector threshold directions consider. goal.threshold character string indicating criterion maximize optimizing cue thresholds: \"acc\" = overall accuracy, \"bacc\" = balanced accuracy, \"wacc\" = weighted accuracy, \"dprime\" = discriminability, \"cost\" = costs (based cost.outcomes, cost.cues constant per cue). Default: goal.threshold = \"bacc\". sens.w numeric. Sensitivity weight parameter (0 1, computing wacc). Default: sens.w = .50. .goal Name optional, user-defined goal (character string). Default: .goal = NULL. .goal.fun User-defined goal function (4 arguments hi fa mi cr). Default: .goal.fun = NULL. cost.numeric. constant cost value add value (e.g., cost cue). cost.outcomes list. list length 4 names 'hi', 'fa', 'mi', 'cr' specifying costs hit, false alarm, miss, correct rejection, respectively, common currency. instance, cost.outcomes = listc(\"hi\" = 0, \"fa\" = 10, \"mi\" = 20, \"cr\" = 0) means false alarm miss cost 10 20 units, respectively, correct decisions cost.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_threshold_factor_grid.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform a grid search over factor and return accuracy statistics for a given factor cue — fftrees_threshold_factor_grid","text":"data frame containing accuracy statistics factor thresholds.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_threshold_numeric_grid.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform a grid search over thresholds and return accuracy statistics for a given numeric cue — fftrees_threshold_numeric_grid","title":"Perform a grid search over thresholds and return accuracy statistics for a given numeric cue — fftrees_threshold_numeric_grid","text":"Perform grid search thresholds return accuracy statistics given numeric cue","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_threshold_numeric_grid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform a grid search over thresholds and return accuracy statistics for a given numeric cue — fftrees_threshold_numeric_grid","text":"","code":"fftrees_threshold_numeric_grid( thresholds, cue_v, criterion_v, directions = c(\">\", \"<=\"), goal.threshold = NULL, sens.w = NULL, my.goal = NULL, my.goal.fun = NULL, cost.each = NULL, cost.outcomes = NULL )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_threshold_numeric_grid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform a grid search over thresholds and return accuracy statistics for a given numeric cue — fftrees_threshold_numeric_grid","text":"thresholds numeric. vector thresholds consider. cue_v numeric. Feature values. criterion_v logical. logical vector (TRUE) criterion values. directions character. Possible directions consider. goal.threshold character string indicating criterion maximize optimizing cue thresholds: \"acc\" = overall accuracy, \"bacc\" = balanced accuracy, \"wacc\" = weighted accuracy, \"dprime\" = discriminability, \"cost\" = costs (based cost.outcomes, cost.cues constant per cue). Default: goal.threshold = \"bacc\". sens.w numeric. Sensitivity weight parameter (0 1, computing wacc). Default: sens.w = .50. .goal Name optional, user-defined goal (character string). Default: .goal = NULL. .goal.fun User-defined goal function (4 arguments hi fa mi cr). Default: .goal.fun = NULL. cost.numeric. constant cost value add value (e.g., cost cue). cost.outcomes list. list length 4 names 'hi', 'fa', 'mi', 'cr' specifying costs hit, false alarm, miss, correct rejection, respectively, common currency. instance, cost.outcomes = listc(\"hi\" = 0, \"fa\" = 10, \"mi\" = 20, \"cr\" = 0) means false alarm miss cost 10 20 units, respectively, correct decisions cost.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_threshold_numeric_grid.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform a grid search over thresholds and return accuracy statistics for a given numeric cue — fftrees_threshold_numeric_grid","text":"data frame containing accuracy statistics numeric thresholds.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_wordstofftrees.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert a verbal description of an FFT into an FFTrees object — fftrees_wordstofftrees","title":"Convert a verbal description of an FFT into an FFTrees object — fftrees_wordstofftrees","text":"fftrees_wordstofftrees converts verbal description FFT (provided string text) tree definition (FFTrees object). Thus, fftrees_wordstofftrees provides simple natural language parser FFTs. fftrees_wordstofftrees complement function fftrees_ffttowords, converts abstract tree definition (FFTrees object) verbal description (.e., provides natural language output). increase robustness, parsing fftrees_wordstofftrees allows lower- uppercase spellings (typographical variants) ignores else-part final sentence (.e., part beginning \"otherwise\").","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_wordstofftrees.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert a verbal description of an FFT into an FFTrees object — fftrees_wordstofftrees","text":"","code":"fftrees_wordstofftrees(x, my.tree)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_wordstofftrees.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert a verbal description of an FFT into an FFTrees object — fftrees_wordstofftrees","text":"x FFTrees object. .tree character string. verbal description (string text) defining FFT.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/fftrees_wordstofftrees.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert a verbal description of an FFT into an FFTrees object — fftrees_wordstofftrees","text":"FFTrees object new tree definition described .tree.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/flip_exits.html","id":null,"dir":"Reference","previous_headings":"","what":"Flip exits in an FFT definition — flip_exits","title":"Flip exits in an FFT definition — flip_exits","text":"flip_exits reverses exits one nodes existing FFT definition (tidy data frame format). flip_exits alters value(s) non-final exits specified nodes (0 1, 1 0). contrast, exits final nodes remain unchanged. Duplicates nodes flipped (rather repeatedly) nodes range 1:nrow(fft) ignored. flip_exits specialized function edit_nodes.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/flip_exits.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Flip exits in an FFT definition — flip_exits","text":"","code":"flip_exits(fft, nodes = NA, quiet = FALSE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/flip_exits.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Flip exits in an FFT definition — flip_exits","text":"fft One FFT definition (data frame tidy format, one row per node). nodes FFT nodes whose exits flipped (integer vector). Default: nodes = NA. quiet Hide feedback messages (logical)? Default: quiet = FALSE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/flip_exits.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Flip exits in an FFT definition — flip_exits","text":"One FFT definition (data frame tidy format, one row per node).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/forestfires.html","id":null,"dir":"Reference","previous_headings":"","what":"Forest fires data — forestfires","title":"Forest fires data — forestfires","text":"dataset forest fire statistics.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/forestfires.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forest fires data — forestfires","text":"","code":"forestfires"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/forestfires.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Forest fires data — forestfires","text":"data frame containing 517 rows 13 columns. X Integer -x-axis spatial coordinate within Montesinho park map: 1 9 Y Integer - y-axis spatial coordinate within Montesinho park map: 2 9 month Factor - month year: \"jan\" \"dec\" day Factor -day week: \"mon\" \"sun\" FFMC Numeric -FFMC index FWI system: 18.7 96.20 DMC Numeric - DMC index FWI system: 1.1 291.3 DC Numeric - DC index FWI system: 7.9 860.6 ISI Numeric - ISI index FWI system: 0.0 56.10 temp Numeric - temperature Celsius degrees: 2.2 33.30 RH Numeric - relative humidity percent: 15.0 100 wind Numeric - wind speed km/h: 0.40 9.40 rain Numeric - outside rain mm/m2 : 0.0 6.4 fire.crit Criterion: fire (greater 1.00 ha)? Values: TRUE (yes) vs. FALSE () (47.0% vs. 53.0%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/forestfires.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Forest fires data — forestfires","text":"http://archive.ics.uci.edu/ml/datasets/Forest+Fires Original creator: Prof. Paulo Cortez Aníbal Morais Department Information Systems University Minho, Portugal","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/forestfires.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forest fires data — forestfires","text":"made following enhancements original data improved usability: criterion redefined numeric variable indicated number hectares burned fire logical variable (TRUE (values >1) vs. FALSE (values <=1)). , data remains consistent original dataset.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_best_tree.html","id":null,"dir":"Reference","previous_headings":"","what":"Select the best tree (from current set of FFTs) — get_best_tree","title":"Select the best tree (from current set of FFTs) — get_best_tree","text":"get_best_tree selects (looks identifies) best tree (integer) set (“fan”) FFTs contained current FFTrees object x, existing type data ('train' 'test'), goal corresponding statistics available designated data type (x$trees$stats).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_best_tree.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select the best tree (from current set of FFTs) — get_best_tree","text":"","code":"get_best_tree(x, data, goal, my.goal.max = TRUE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_best_tree.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select the best tree (from current set of FFTs) — get_best_tree","text":"x FFTrees object. data type data consider (character: either 'train' 'test'). goal goal (character) maximized minimized selecting tree existing FFTrees object x (existing x$trees$stats). .goal.max Default direction user-defined .goal (logical): .goal maximized? Default: .goal.max = TRUE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_best_tree.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Select the best tree (from current set of FFTs) — get_best_tree","text":"integer denoting tree maximizes/minimizes goal data.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_best_tree.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Select the best tree (from current set of FFTs) — get_best_tree","text":"Importantly, get_best_tree identifies selects `tree` identifier (integer) set existing trees known statistics, rather creating new trees computing new cue thresholds. specifically, goal used identifying selecting `tree` identifier (integer) best FFT existing set FFTs, computing new cue thresholds (see goal.threshold fftrees_cuerank()) creating new trees (see goal.chase fftrees_ranktrees()).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_exit_type.html","id":null,"dir":"Reference","previous_headings":"","what":"Get exit type (from a vector x of FFT exit descriptions) — get_exit_type","title":"Get exit type (from a vector x of FFT exit descriptions) — get_exit_type","text":"get_exit_type checks converts vector x FFT exit descriptions exits FFT correspond current options exit_types (global constant).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_exit_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get exit type (from a vector x of FFT exit descriptions) — get_exit_type","text":"","code":"get_exit_type(x, verify = TRUE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_exit_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get exit type (from a vector x of FFT exit descriptions) — get_exit_type","text":"x vector FFT exit descriptions. verify flag turn verification /(logical). Default: verify = TRUE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_exit_type.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get exit type (from a vector x of FFT exit descriptions) — get_exit_type","text":"vector exit_types (error).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_exit_type.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get exit type (from a vector x of FFT exit descriptions) — get_exit_type","text":"get_exit_type also verifies exit types conform FFT (e.g., exits final node bi-directional).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_exit_type.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get exit type (from a vector x of FFT exit descriptions) — get_exit_type","text":"","code":"get_exit_type(c(0, 1, .5)) #> [1] 0.0 1.0 0.5 get_exit_type(c(FALSE, \" True \", 2/4)) #> [1] 0.0 1.0 0.5 get_exit_type(c(\"noise\", \"signal\", \"final\")) #> [1] 0.0 1.0 0.5 get_exit_type(c(\"left\", \"right\", \"both\")) #> [1] 0.0 1.0 0.5"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_fft_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Get FFT definitions (from an FFTrees object x) — get_fft_df","title":"Get FFT definitions (from an FFTrees object x) — get_fft_df","text":"get_fft_df gets FFT definitions FFTrees object x (data.frame).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_fft_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get FFT definitions (from an FFTrees object x) — get_fft_df","text":"","code":"get_fft_df(x)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_fft_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get FFT definitions (from an FFTrees object x) — get_fft_df","text":"x FFTrees object.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_fft_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get FFT definitions (from an FFTrees object x) — get_fft_df","text":"set FFT definitions (data.frame/tibble, one-line per FFT definition format used FFTrees object).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/get_fft_df.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get FFT definitions (from an FFTrees object x) — get_fft_df","text":"FFTs data.frame returned represented one-line per FFT definition format used FFTrees object. addition looking x$trees$definitions, get_fft_df verifies FFT definitions valid (given current settings).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.cost.html","id":null,"dir":"Reference","previous_headings":"","what":"Cue costs for the heartdisease data — heart.cost","title":"Cue costs for the heartdisease data — heart.cost","text":"data characterizes variables (cues) heartdisease dataset.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.cost.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cue costs for the heartdisease data — heart.cost","text":"","code":"heart.cost"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.cost.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Cue costs for the heartdisease data — heart.cost","text":"list length 13 containing cost cue heartdisease dataset (dollars). list element single (positive numeric) value.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.cost.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Cue costs for the heartdisease data — heart.cost","text":"https://archive.ics.uci.edu/ml/machine-learning-databases/heart-disease/costs/","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.test.html","id":null,"dir":"Reference","previous_headings":"","what":"Heart disease testing data — heart.test","title":"Heart disease testing data — heart.test","text":"Testing data heartdisease data. subset used test prediction performance model trained heart.train data. dataset heartdisease contains datasets.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Heart disease testing data — heart.test","text":"","code":"heart.test"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.test.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Heart disease testing data — heart.test","text":"data frame containing 153 rows 14 columns (see heartdisease details).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.test.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Heart disease testing data — heart.test","text":"https://archive.ics.uci.edu/ml/datasets/Heart+Disease","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.train.html","id":null,"dir":"Reference","previous_headings":"","what":"Heart disease training data — heart.train","title":"Heart disease training data — heart.train","text":"Training data binary prediction model (: FFT) (subset ) heartdisease data. complementary subset model testing heart.test. data heartdisease contains subsets.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.train.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Heart disease training data — heart.train","text":"","code":"heart.train"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.train.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Heart disease training data — heart.train","text":"data frame containing 150 rows 14 columns (see heartdisease details).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heart.train.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Heart disease training data — heart.train","text":"https://archive.ics.uci.edu/ml/datasets/Heart+Disease","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heartdisease.html","id":null,"dir":"Reference","previous_headings":"","what":"Heart disease data — heartdisease","title":"Heart disease data — heartdisease","text":"dataset predicting diagnosis 303 patients tested heart disease.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heartdisease.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Heart disease data — heartdisease","text":"","code":"heartdisease"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heartdisease.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Heart disease data — heartdisease","text":"data frame containing 303 rows 14 columns, following variables: diagnosis True value binary criterion: TRUE = Heart disease, FALSE = Heart disease age Age (years) sex Sex, 1 = male, 0 = female cp Chest pain type: ta = typical angina, aa = atypical angina, np = non-anginal pain, = asymptomatic trestbps Resting blood pressure (mm Hg admission hospital) chol Serum cholestoral mg/dl fbs Fasting blood sugar > 120 mg/dl: 1 = true, 0 = false restecg Resting electrocardiographic results. \"normal\" = normal, \"abnormal\" = ST-T wave abnormality (T wave inversions /ST elevation depression > 0.05 mV), \"hypertrophy\" = showing probable definite left ventricular hypertrophy Estes' criteria. thalach Maximum heart rate achieved exang Exercise induced angina: 1 = yes, 0 = oldpeak ST depression induced exercise relative rest slope slope peak exercise ST segment. ca Number major vessels (0-3) colored flourosopy thal \"normal\" = normal, \"fd\" = fixed defect, \"rd\" = reversible defect","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/heartdisease.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Heart disease data — heartdisease","text":"https://archive.ics.uci.edu/ml/datasets/Heart+Disease","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/inwords.html","id":null,"dir":"Reference","previous_headings":"","what":"Provide a verbal description of an FFT — inwords","title":"Provide a verbal description of an FFT — inwords","text":"inwords generates provides verbal description fast--frugal tree (FFT) FFTrees object. data remains unspecified, inwords look x$trees$inwords. data set either \"train\" \"test\", inwords first employs fftrees_ffttowords re-generate verbal descriptions FFTs x.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/inwords.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Provide a verbal description of an FFT — inwords","text":"","code":"inwords(x, data = NULL, tree = 1)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/inwords.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Provide a verbal description of an FFT — inwords","text":"x FFTrees object. data type data tree applied (character string \"train\" \"test\"). Default: data = NULL look x$trees$inwords. tree tree display (integer).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/inwords.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Provide a verbal description of an FFT — inwords","text":"verbal description FFT (character string).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/iris.v.html","id":null,"dir":"Reference","previous_headings":"","what":"Iris data — iris.v","title":"Iris data — iris.v","text":"famous dataset R.. Fisher (1936) simplified predict virginica class (.e., binary classification problem).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/iris.v.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Iris data — iris.v","text":"","code":"iris.v"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/iris.v.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Iris data — iris.v","text":"data frame containing 150 rows 4 columns. sep.len sepal length cm sep.wid sepal width cm pet.len petal length cm pet.wid petal width cm virginica Criterion: iris belong class \"virginica\"? Values: TRUE vs. FALSE (33.33% vs.66.67%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/iris.v.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Iris data — iris.v","text":"https://archive.ics.uci.edu/ml/datasets/Iris","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/iris.v.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Iris data — iris.v","text":"improve usability, made following changes: criterion binarized factor variable three levels (Iris-setosa, Iris-versicolor, Iris-virginica), logical variable (.e., TRUE instances Iris-virginica FALSE two levels). , data remains consistent original dataset.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/iris.v.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Iris data — iris.v","text":"Fisher, R.. (1936): use multiple measurements taxonomic problems. Annual Eugenics, 7, Part II, pp. 179–188.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/mushrooms.html","id":null,"dir":"Reference","previous_headings":"","what":"Mushrooms data — mushrooms","title":"Mushrooms data — mushrooms","text":"Data describing poisonous vs. non-poisonous mushrooms.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/mushrooms.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Mushrooms data — mushrooms","text":"","code":"mushrooms"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/mushrooms.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Mushrooms data — mushrooms","text":"data frame containing 8,124 rows 23 columns. See http://archive.ics.uci.edu/ml/machine-learning-databases/mushroom/agaricus-lepiota.names column descriptions. poisonous Criterion: mushroom poisonous? Values: TRUE (poisonous) vs. FALSE (eatable) (48.2% vs.\\ 52.8%). cshape cap-shape, character (bell=b, conical=c, convex=x, flat=f, knobbed=k, sunken=s) csurface cap-surface, character (fibrous=f, grooves=g, scaly=y, smooth=s) ccolor cap-color, character (brown=n, buff=b, cinnamon=c, gray=g, green=r, pink=p, purple=u, red=e, white=w, yellow=y) bruises bruises? logical (TRUE/FALSE) odor character (almond=, anise=l, creosote=c, fishy=y, foul=f, musty=m, none=n, pungent=p, spicy=s) gattach gill-attachment, character (attached=, descending=d, free=f, notched=n) gspace gill-spacing, character (close=c, crowded=w, distant=d) gsize gill-size, character (broad=b, narrow=n) gcolor gill-color, character (black=k, brown=n, buff=b, chocolate=h, gray=g, green=r, orange=o, pink=p, purple=u, red=e, white=w, yellow=y) sshape stalk-shape, character (enlarging=e, tapering=t) sroot stalk-root, character (bulbous=b ,club=c, cup=u, equal=e, rhizomorphs=z, rooted=r) ssaring stalk-surface--ring, character (fibrous=f, scaly=y, silky=k, smooth=s) ssbring stalk-surface--ring, character (fibrous=f, scaly=y, silky=k, smooth=s) scaring stalk-color--ring, character (brown=n, buff=b, cinnamon=c, gray=g, orange=o, pink=p, red=e, white=w, yellow=y) scbring stalk-color--ring, character (brown=n, buff=b, cinnamon=c, gray=g, orange=o, pink=p, red=e, white=w, yellow=y) vtype veil-type, character (partial=p, universal=u) vcolor veil-color, character (brown=n, orange=o, white=w, yellow=y) ringnum character (none=n, one=o, two=t) ringtype character (cobwebby=c, evanescent=e, flaring=f, large=l, none=n, pendant=p, sheathing=s, zone=z) sporepc spore-print-color, character (black=k, brown=n, buff=b, chocolate=h, green=r, orange=o, purple=u, white=w, yellow=y) population character(abundant=, clustered=c, numerous=n, scattered=s, several=v, solitary=y) habitat character (grasses=g, leaves=l, meadows=m, paths=p, urban=u, waste=w, woods=d)","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/mushrooms.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Mushrooms data — mushrooms","text":"https://archive.ics.uci.edu/ml/datasets/Mushroom","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/mushrooms.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Mushrooms data — mushrooms","text":"dataset includes descriptions hypothetical samples corresponding 23 species gilled mushrooms Agaricus Lepiota Family. species classified poisonous (True False). Guide clearly states simple rule determining edibility mushroom; rule like “leaflets three, let ” Poisonous Oak Ivy. made following enhancements original data improved usability: missing values, denoted \"?\" dataset, transformed NAs. Binary factor variables exclusive \"t\" \"f\" values converted logical TRUE/FALSE vectors. binary factor criterion variable exclusive \"p\" \"e\" values converted logical TRUE/FALSE vector. , data remains consistent original dataset.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/mushrooms.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Mushrooms data — mushrooms","text":"Mushroom records drawn Audubon Society Field Guide North American Mushrooms (1981). G.H. Lincoff (Pres.), New York: .. Knopf.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/plot.FFTrees.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot an FFTrees object — plot.FFTrees","title":"Plot an FFTrees object — plot.FFTrees","text":"plot.FFTrees visualizes FFTrees object created FFTrees function. plot.FFTrees main plotting function FFTrees package called evaluating generic plot FFTrees object. plot.FFTrees visualizes selected FFT, key data characteristics, various aspects classification performance. x may contain test data, plot.FFTrees default plots performance characteristics training data (.e., fitting), rather test data (.e., prediction). test data available, specifying data = \"test\" plots prediction performance. Whenever sensitivity weight (sens.w) set default sens.w = 0.50, level shows balanced accuracy (bacc). , however, sens.w deviates default, level shows tree's weighted accuracy value (wacc) current sens.w value (level). Many aspects plot (e.g., panels) FFT's appearance (e.g., labels nodes exits) can customized setting corresponding arguments.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/plot.FFTrees.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot an FFTrees object — plot.FFTrees","text":"","code":"# S3 method for class 'FFTrees' plot( x = NULL, data = \"train\", what = \"all\", tree = 1, main = NULL, cue.labels = NULL, decision.labels = NULL, truth.labels = NULL, cue.cex = NULL, threshold.cex = NULL, decision.cex = 1, comp = TRUE, show.header = NULL, show.tree = NULL, show.confusion = NULL, show.levels = NULL, show.roc = NULL, show.icons = NULL, show.iconguide = NULL, hlines = TRUE, label.tree = NULL, label.performance = NULL, n.per.icon = NULL, level.type = \"bar\", which.tree = NULL, decision.names = NULL, stats = NULL, grayscale = FALSE, ... )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/plot.FFTrees.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot an FFTrees object — plot.FFTrees","text":"x FFTrees object created FFTrees function. data type data x plotted (string) test dataset (data frame). valid data string must either 'train' (fitting performance) 'test' (prediction performance). valid data frame, specified tree evaluated plotted data ('test' data), global FFTrees object x remains unchanged unless re-assigned. default, data = 'train' (x may contain test data). plotted (character string)? Valid options : '' Plot tree diagram corresponding guides performance statistics, excluding cue accuracies. 'cues' Plot marginal accuracy cues ROC space. Note cue accuracies shown calling = '' use showcues function. 'icontree' Plot tree diagram icon arrays exit nodes. Consider also setting n.per.icon show.iconguide. 'tree' Plot tree diagram. 'roc' Plot performance tree(s) (comparison algorithms) ROC space. Default: = ''. tree tree plotted (integer, valid corresponding tree argument non-empty). Default: tree = 1. plot best training best test tree respect goal specified FFT construction, use 'best.train' 'best.test', respectively. main main plot label (character string). cue.labels optional string labels cues / nodes (character vector). decision.labels character vector length 2 indicating content-specific names noise vs. signal predictions/exits. truth.labels character vector length 2 indicating content-specific names true noise vs. signal cases (using `decision.labels` unspecified). cue.cex size cue labels (numeric). threshold.cex size threshold labels (numeric). decision.cex size decision labels (numeric). comp performance competitive algorithms (e.g.; logistic regression, random forests, etc.) shown ROC plot (available, logical)? show.header Show header basic data properties (top panel, logical)? show.tree Show nodes exits FFT (middle panel, logical)? show.confusion Show 2x2 confusion matrix (bottom panel, logical)? show.levels Show performance levels (bottom panel, logical)? show.roc Show ROC curve (bottom panel, logical)? show.icons Show exit cases icon arrays (middle panel, logical)? show.iconguide Show icon guide (middle panel, logical)? hlines Show horizontal panel separation lines (logical)? Default: hlines = TRUE. label.tree label FFT (optional, character string). label.performance label performance section (optional, character string). n.per.icon number cases represented icon (numeric). level.type type performance levels drawn bottom (character string, either \"bar\" \"line\". Default: level.type = \"bar\". .tree Deprecated argument. Use tree instead. decision.names Deprecated argument. Use decision.labels instead. stats Deprecated argument. statistical information plotted (logical)? Use = \"\" include performance statistics = \"tree\" plot tree diagram. grayscale logical. TRUE, plot shown grayscale. ... Graphical parameters (passed text panel titles, showcues = 'cues', title = 'roc').","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/plot.FFTrees.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot an FFTrees object — plot.FFTrees","text":"invisible FFTrees object x plot visualizing describing FFT (side effect).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/plot.FFTrees.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot an FFTrees object — plot.FFTrees","text":"","code":"# Create FFTs (for heartdisease data): heart_fft <- FFTrees(formula = diagnosis ~ ., data = heart.train) #> ✔ Created an FFTrees object. #> Ranking 13 cues: ■■■■■■■■ 23% | ETA: 1s #> Ranking 13 cues: ■■■■■■■■■■■■■■■■■■■■■■■■■■ 85% | ETA: 0s #> Ranking 13 cues: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s #> #> ✔ Ranked 13 cues (optimizing 'bacc'). #> ✔ Created 7 FFTs with 'ifan' algorithm (chasing 'bacc'). #> ✔ Defined 7 FFTs. #> ✔ Applied 7 FFTs to 'train' data. #> ✔ Ranked 7 FFTs by 'train' data. #> ✔ Expressed 7 FFTs in words. # Visualize the default FFT (Tree #1, what = 'all'): plot(heart_fft, main = \"Heart disease\", decision.labels = c(\"Absent\", \"Present\")) # Visualize cue accuracies (in ROC space): plot(heart_fft, what = \"cues\", main = \"Cue accuracies for heart disease data\") #> Plotting cue training statistics: #> — Cue accuracies ranked by bacc #> # Visualize tree diagram with icon arrays on exit nodes: plot(heart_fft, what = \"icontree\", n.per.icon = 2, main = \"Diagnosing heart disease\") # Visualize performance comparison in ROC space: plot(heart_fft, what = \"roc\", main = \"Performance comparison for heart disease data\") # Visualize predictions of FFT #2 (for new test data) with custom options: plot(heart_fft, tree = 2, data = heart.test, main = \"Predicting heart disease\", cue.labels = c(\"1. thal?\", \"2. cp?\", \"3. ca?\", \"4. exang\"), decision.labels = c(\"ok\", \"treat\"), truth.labels = c(\"Healthy\", \"Sick\"), n.per.icon = 2, show.header = TRUE, show.confusion = TRUE, show.levels = TRUE, show.roc = TRUE, hlines = FALSE, font = 3, col = \"steelblue\") #> Applying FFTrees object x to new test data... #> ✔ Applied 7 FFTs to 'test' data. #> Success, but re-assign output to x or use fftrees_apply() to globally change x # # For details, see # vignette(\"FFTrees_plot\", package = \"FFTrees\")"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/predict.FFTrees.html","id":null,"dir":"Reference","previous_headings":"","what":"Predict classification outcomes or probabilities from data — predict.FFTrees","title":"Predict classification outcomes or probabilities from data — predict.FFTrees","text":"predict.FFTrees predicts binary classification outcomes probabilities newdata FFTrees object.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/predict.FFTrees.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Predict classification outcomes or probabilities from data — predict.FFTrees","text":"","code":"# S3 method for class 'FFTrees' predict( object = NULL, newdata = NULL, tree = 1, type = \"class\", sens.w = NULL, method = \"laplace\", data = NULL, ... )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/predict.FFTrees.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Predict classification outcomes or probabilities from data — predict.FFTrees","text":"object FFTrees object created FFTrees function. newdata dataframe. data frame test data. tree integer. tree object used? default, tree = 1 used. type string. predicted? Can \"class\", returns vector class predictions, \"prob\" returns matrix class probabilities, \"\" returns matrix class probability predictions. sens.w, data deprecated method string. Method calculating class probabilities. Either 'laplace', applies Laplace correction, 'raw' applies correction. ... Additional arguments passed predict.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/predict.FFTrees.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Predict classification outcomes or probabilities from data — predict.FFTrees","text":"Either logical vector predictions, matrix class probabilities.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/predict.FFTrees.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Predict classification outcomes or probabilities from data — predict.FFTrees","text":"","code":"# Create training and test data: set.seed(100) breastcancer <- breastcancer[sample(nrow(breastcancer)), ] breast.train <- breastcancer[1:150, ] breast.test <- breastcancer[151:303, ] # Create an FFTrees object from the training data: breast.fft <- FFTrees( formula = diagnosis ~ ., data = breast.train ) #> ✔ Created an FFTrees object. #> ✔ Ranked 9 cues (optimizing 'bacc'). #> ✔ Created 6 FFTs with 'ifan' algorithm (chasing 'bacc'). #> ✔ Defined 6 FFTs. #> ✔ Applied 6 FFTs to 'train' data. #> ✔ Ranked 6 FFTs by 'train' data. #> ✔ Expressed 6 FFTs in words. # Predict classification outcomes for test data: breast.fft.pred <- predict(breast.fft, newdata = breast.test ) #> ✔ Applied 6 FFTs to 'test' data. #> ✔ Generated predictions for tree 1. # Predict class probabilities for test data: breast.fft.pred <- predict(breast.fft, newdata = breast.test, type = \"prob\" ) #> ✔ Applied 6 FFTs to 'test' data. #> ✔ Generated predictions for tree 1."},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/print.FFTrees.html","id":null,"dir":"Reference","previous_headings":"","what":"Print basic information of fast-and-frugal trees (FFTs) — print.FFTrees","title":"Print basic information of fast-and-frugal trees (FFTs) — print.FFTrees","text":"print.FFTrees prints basic information FFTs FFTrees object x. x may contain test data, print.FFTrees default prints performance characteristics training data (.e., fitting), rather test data (.e., prediction). test data available, specify data = \"test\" print prediction performance.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/print.FFTrees.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print basic information of fast-and-frugal trees (FFTs) — print.FFTrees","text":"","code":"# S3 method for class 'FFTrees' print(x = NULL, tree = 1, data = \"train\", ...)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/print.FFTrees.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print basic information of fast-and-frugal trees (FFTs) — print.FFTrees","text":"x FFTrees object created FFTrees. tree tree printed (integer, valid corresponding tree argument non-empty). Default: tree = 1. print best training best test tree respect goal specified FFT construction, use \"best.train\" \"best.test\", respectively. data type data x printed (string) test dataset (data frame). valid data string must either 'train' (fitting performance) 'test' (prediction performance). valid data frame, specified tree evaluated printed data ('test' data), global FFTrees object x remains unchanged unless re-assigned. default, data = 'train' (x may contain test data). ... additional arguments passed print.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/print.FFTrees.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print basic information of fast-and-frugal trees (FFTs) — print.FFTrees","text":"invisible FFTrees object x summary information FFT printed console (side effect).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/read_fft_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Read an FFT definition from tree definitions — read_fft_df","title":"Read an FFT definition from tree definitions — read_fft_df","text":"read_fft_df reads returns definition single FFT (tidy data frame) multi-line FFT definitions FFTrees object. read_fft_df allows reading individual tree definitions manipulate tree trimming functions. write_fft_df provides inverse functionality.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/read_fft_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read an FFT definition from tree definitions — read_fft_df","text":"","code":"read_fft_df(ffts_df, tree = 1)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/read_fft_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read an FFT definition from tree definitions — read_fft_df","text":"ffts_df set FFT definitions (data frame, usually FFTrees object, suitable variable names pass verify_ffts_df. tree ID --selected FFT (integer), corresponding tree ffts_df. Default: tree = 1.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/read_fft_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read an FFT definition from tree definitions — read_fft_df","text":"One FFT definition (data frame tidy format, one row per node).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/reorder_nodes.html","id":null,"dir":"Reference","previous_headings":"","what":"Reorder nodes in an FFT definition — reorder_nodes","title":"Reorder nodes in an FFT definition — reorder_nodes","text":"reorder_nodes allows reordering nodes existing FFT definition (tidy data frame format). reorder_nodes allows directly set change node order FFT definition specifying nodes. former non-final node becomes final node, exit type former final node set signal value (.e., exit_types[2]).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/reorder_nodes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reorder nodes in an FFT definition — reorder_nodes","text":"","code":"reorder_nodes(fft, order = NA, quiet = FALSE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/reorder_nodes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reorder nodes in an FFT definition — reorder_nodes","text":"fft One FFT definition (data frame tidy format, one row per node). order desired node order (integer vector). values order must permutation 1:nrow(fft). Default: order = NA. quiet Hide feedback messages (logical)? Default: quiet = FALSE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/reorder_nodes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reorder nodes in an FFT definition — reorder_nodes","text":"One FFT definition (data frame tidy format, one row per node).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/select_nodes.html","id":null,"dir":"Reference","previous_headings":"","what":"Select nodes from an FFT definition — select_nodes","title":"Select nodes from an FFT definition — select_nodes","text":"select_nodes selects one nodes existing FFT definition (filtering corresponding row(s) FFT definition tidy data frame format). selecting final node, last selected node becomes new final node (.e., gains second exit). Duplicates nodes selected (rather incrementally) nodes range 1:nrow(fft) ignored. select_nodes inverse function drop_nodes.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/select_nodes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select nodes from an FFT definition — select_nodes","text":"","code":"select_nodes(fft, nodes = NA, quiet = FALSE)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/select_nodes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select nodes from an FFT definition — select_nodes","text":"fft One FFT definition (data frame tidy format, one row per node). nodes FFT nodes select (integer vector). Default: nodes = NA. quiet Hide feedback messages (logical)? Default: quiet = FALSE.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/select_nodes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Select nodes from an FFT definition — select_nodes","text":"One FFT definition (data frame tidy format, one row per node).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/showcues.html","id":null,"dir":"Reference","previous_headings":"","what":"Visualize cue accuracies (as points in ROC space) — showcues","title":"Visualize cue accuracies (as points in ROC space) — showcues","text":"showcues plots cue accuracies FFTrees object created FFTrees function (points ROC space). optional arguments cue.accuracies alt.goal specified, values take precedence corresponding settings FFTrees object x (change x). showcues called main plot.FFTrees function set = \"cues\".","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/showcues.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Visualize cue accuracies (as points in ROC space) — showcues","text":"","code":"showcues( x = NULL, cue.accuracies = NULL, alt.goal = NULL, main = NULL, top = 5, quiet = list(ini = TRUE, fin = FALSE, set = TRUE), ... )"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/showcues.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Visualize cue accuracies (as points in ROC space) — showcues","text":"x FFTrees object created FFTrees function. cue.accuracies optional data frame specifying cue accuracies directly (without specifying FFTrees object x). alt.goal optional alternative goal sort current cue accuracies (without using goal FFTrees object x). main main plot title (character string). top many top cues highlighted (integer)? quiet user feedback messages suppressed (list 3 logical arguments)? Default: quiet = list(ini = TRUE, fin = FALSE, set = FALSE). ... Graphical parameters (passed plot).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/showcues.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Visualize cue accuracies (as points in ROC space) — showcues","text":"plot showing cue accuracies (FFTrees object) (points ROC space).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/showcues.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Visualize cue accuracies (as points in ROC space) — showcues","text":"","code":"# Create fast-and-frugal trees (FFTs) for heart disease: heart.fft <- FFTrees(formula = diagnosis ~ ., data = heart.train, data.test = heart.test, main = \"Heart Disease\", decision.labels = c(\"Healthy\", \"Diseased\") ) #> ✔ Created an FFTrees object. #> Ranking 13 cues: ■■■■■■■■ 23% | ETA: 1s #> Ranking 13 cues: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s #> #> ✔ Ranked 13 cues (optimizing 'bacc'). #> ✔ Created 7 FFTs with 'ifan' algorithm (chasing 'bacc'). #> ✔ Defined 7 FFTs. #> ✔ Applied 7 FFTs to 'train' data. #> ✔ Ranked 7 FFTs by 'train' data. #> ✔ Applied 7 FFTs to 'test' data. #> ✔ Expressed 7 FFTs in words. # Show cue accuracies (in ROC space): showcues(heart.fft, main = \"Predicting heart disease\") #> Plotting cue training statistics: #> — Cue accuracies ranked by bacc #>"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/sonar.html","id":null,"dir":"Reference","previous_headings":"","what":"Sonar data — sonar","title":"Sonar data — sonar","text":"file contains patterns sonar signals bounced metal cylinder bounced roughly cylindrical rock various angles various conditions. transmitted sonar signal frequency-modulated chirp, rising frequency.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/sonar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sonar data — sonar","text":"","code":"sonar"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/sonar.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Sonar data — sonar","text":"data frame containing 208 rows 60 columns. V1 Number range 0.0 1.0 represents energy within particular frequency band, integrated certain period time. V2 (see V1) V3 (see V1) V4 (see V1) V5 (see V1) V6 (see V1) V7 (see V1) V8 (see V1) V9 (see V1) V10 (see V1) V11 (see V1) V12 (see V1) V13 (see V1) V14 (see V1) V15 (see V1) V16 (see V1) V17 (see V1) V18 (see V1) V19 (see V1) V20 (see V1) V21 (see V1) V22 (see V1) V23 (see V1) V24 (see V1) V25 (see V1) V26 (see V1) V27 (see V1) V28 (see V1) V29 (see V1) V30 (see V1) V31 (see V1) V32 (see V1) V33 (see V1) V34 (see V1) V35 (see V1) V36 (see V1) V37 (see V1) V38 (see V1) V39 (see V1) V40 (see V1) V41 (see V1) V42 (see V1) V43 (see V1) V44 (see V1) V45 (see V1) V46 (see V1) V47 (see V1) V48 (see V1) V49 (see V1) V50 (see V1) V51 (see V1) V52 (see V1) V53 (see V1) V54 (see V1) V55 (see V1) V56 (see V1) V57 (see V1) V58 (see V1) V59 (see V1) V60 (see V1) mine.crit Criterion: sonar signal bounce metal cylinder (rock)? Values: TRUE (metal cylinder) vs. FALSE (rock) (53.37% vs.\\ 46.63%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/sonar.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Sonar data — sonar","text":"https://archive.ics.uci.edu/ml/datasets/Connectionist+Bench+(Sonar,+Mines+vs.+Rocks)","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/sonar.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Sonar data — sonar","text":"made following enhancements original data improved usability: binary factor criterion variable exclusive \"m\" \"r\" values converted logical TRUE/FALSE vector. , data remains consistent original dataset.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/sonar.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Sonar data — sonar","text":"Gorman, R. P., Sejnowski, T. J. (1988). Analysis hidden units layered network trained classify sonar targets. Neural Networks, 1, pp. 75–89.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/summary.FFTrees.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize an FFTrees object — summary.FFTrees","title":"Summarize an FFTrees object — summary.FFTrees","text":"summary.FFTrees summarizes key contents FFTrees object.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/summary.FFTrees.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize an FFTrees object — summary.FFTrees","text":"","code":"# S3 method for class 'FFTrees' summary(object, tree = NULL, ...)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/summary.FFTrees.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize an FFTrees object — summary.FFTrees","text":"object FFTrees object. tree tree summarize (integer, may vector). tree = NULL (per default) exceeding possible range 1:object$trees$n, information trees object returned. ... Additional arguments (currently ignored).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/summary.FFTrees.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarize an FFTrees object — summary.FFTrees","text":"invisible list elements containing definitions performance stats FFT(s) specified tree(s).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/summary.FFTrees.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Summarize an FFTrees object — summary.FFTrees","text":"Given FFTrees object x, summary.FFTrees selects key parameters x$params provides definitions performance statistics tree x$trees. Inspect query x additional details. summary.FFTrees returns invisible list containing two elements: definitions corresponding performance measures trees; stats decision frequencies, derived probabilities, costs (separated train test). header prints descriptive information FFTrees object (console): main title, number trees (object$trees$n), name criterion variable (object$criterion_name). Per default, information available trees shown returned. Specifying tree filters output list elements corresponding tree(s). single tree specified, printed header includes verbal description corresponding tree. summary.FFTrees provides key details specified tree(s), individual decisions (stored object$trees$decisions) shown returned.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/titanic.html","id":null,"dir":"Reference","previous_headings":"","what":"Titanic survival data — titanic","title":"Titanic survival data — titanic","text":"Data indicating survived Titanic.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/titanic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Titanic survival data — titanic","text":"","code":"titanic"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/titanic.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Titanic survival data — titanic","text":"data frame containing 2,201 rows 4 columns. class Factor - Class (first, second, third, crew) age Factor - Age group (child adult) sex Factor - Sex (male female) survived Logical - Whether passenger survived (TRUE) (FALSE)","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/titanic.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Titanic survival data — titanic","text":"https://www.encyclopedia-titanica.org","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/titanic.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Titanic survival data — titanic","text":"See Titanic R datasets package details data (4-dimensional table).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/titanic.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Titanic survival data — titanic","text":"Dawson, Robert J. MacG. (1995). ‘Unusual Episode’ Data Revisited. Journal Statistics Education, 3. https://doi.org/10.1080/10691898.1995.11910499.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/voting.html","id":null,"dir":"Reference","previous_headings":"","what":"Voting data — voting","title":"Voting data — voting","text":"dataset votes U.S. House Representatives Congressmen 16 key votes identified CQA.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/voting.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Voting data — voting","text":"","code":"voting"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/voting.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Voting data — voting","text":"data frame containing 435 rows 16 columns. handicapped handicapped-infants, logical (TRUE, FALSE) water water-project-cost-sharing, logical (TRUE, FALSE) adoption adoption---budget-resolution, logical (TRUE, FALSE) physician physician-fee-freeze, logical (TRUE, FALSE) elsalvador el-salvador-aid, logical (TRUE, FALSE) religionschool religious-groups--schools, logical (TRUE, FALSE) satellite anti-satellite-test-ban, logical (TRUE, FALSE) nicaraguan aid--nicaraguan-contras, logical (TRUE, FALSE) mxmissile mxmissile, logical (TRUE, FALSE) immigration immigration, logical (TRUE, FALSE) synfuels synfuels-corporation-cutback, logical (TRUE, FALSE) education education-spending, logical (TRUE, FALSE) superfund superfund-right--sue, logical (TRUE, FALSE) crime crime, logical (TRUE, FALSE) dutyfree duty-free-exports, logical (TRUE, FALSE) southafrica export-administration-act-south-africa, logical (TRUE, FALSE) party.crit Criterion: voters democratic (republican) congressmen? Values: TRUE (democrat) / FALSE (republican) (61.52% vs. 38.48%).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/voting.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Voting data — voting","text":"https://archive.ics.uci.edu/ml/datasets/Congressional+Voting+Records","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/voting.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Voting data — voting","text":"CQA lists nine different types votes: Voted , paired , announced (three simplified yea), voted , paired , announced (three simplified nay), voted present, voted present avoid conflict interest, vote otherwise make position known (three simplified unknown disposition). made following enhancements original data improved usability: missing values, denoted \"?\" dataset, transformed NAs. Binary factor variables exclusive \"y\" \"n\" values converted logical TRUE/FALSE vectors. binary character criterion variable exclusive \"democrat\" \"republican\" values converted logical TRUE/FALSE vector. , data remains consistent original dataset.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/voting.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Voting data — voting","text":"Congressional Quarterly Almanac, 98th Congress, 2nd session 1984, Congressional Quarterly Inc., Volume XL. Washington, D.C., 1985.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/wine.html","id":null,"dir":"Reference","previous_headings":"","what":"Wine tasting data — wine","title":"Wine tasting data — wine","text":"Chemical tasting data wines Northern Portugal.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/wine.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wine tasting data — wine","text":"","code":"wine"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/wine.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Wine tasting data — wine","text":"data frame containing 6497 rows 13 columns. fixed.acidity fixed acidity (nummeric) volatile.acidity volatile acidity (nummeric) citric.acid citric acid (nummeric) residual.sugar residual sugar (nummeric) chlorides chlorides (nummeric) free.sulfur.dioxide free sulfur dioxide (nummeric) total.sulfur.dioxide total sulfur dioxide (nummeric) density density (nummeric) pH PH Value (nummeric) sulphates Sulphates (nummeric) alcohol Alcohol (nummeric) quality Quality (nummeric, score 0 10) type Criterion: wine red white? (24.61% vs.75.39%)","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/wine.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Wine tasting data — wine","text":"http://archive.ics.uci.edu/ml/datasets/Wine+Quality","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/wine.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Wine tasting data — wine","text":"P. Cortez, . Cerdeira, F. Almeida, T. Matos J. Reis (2009). Modeling wine preferences data mining physicochemical properties. Decision Support Systems, 47 (4), 547–553. https://doi.org/10.1016/j.dss.2009.05.016","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/write_fft_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Write an FFT definition to tree definitions — write_fft_df","title":"Write an FFT definition to tree definitions — write_fft_df","text":"write_fft_df writes definition single FFT (tidy data frame) one-line FFT definition used FFTrees object. write_fft_df allows turning individual tree definitions one-line FFT definition format used FFTrees object. read_fft_df provides inverse functionality.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/write_fft_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Write an FFT definition to tree definitions — write_fft_df","text":"","code":"write_fft_df(fft, tree = -99L)"},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/write_fft_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Write an FFT definition to tree definitions — write_fft_df","text":"fft One FFT definition (data frame tidy format, one row per node). tree ID --written FFT (integer). Default: tree = -99L.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/reference/write_fft_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Write an FFT definition to tree definitions — write_fft_df","text":"FFT definition one line FFT definition format used FFTrees object (data frame).","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"fftrees-2009000","dir":"Changelog","previous_headings":"","what":"FFTrees 2.0.0.9000","title":"FFTrees 2.0.0.9000","text":"current development version FFTrees, available https://github.com/ndphillips/FFTrees.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"breaking-changes-2-0-0-9000","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"FFTrees 2.0.0.9000","text":"Deprecated applications non-FFT competitive algorithms (.e., LR, SVM, RF) FFT creation. now , consider using packages parsnip tidymodels create evaluate models.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"major-changes-2-0-0-9000","dir":"Changelog","previous_headings":"","what":"Major changes","title":"FFTrees 2.0.0.9000","text":"Added support handling NA values.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"minor-changes-2-0-0-9000","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"FFTrees 2.0.0.9000","text":"Plotting: plot.FFTrees() now labels row 2x2 confusion matrix “Prediction” using “test” data. plot.FFTrees() now truth.labels argument , set, distinguishes labels true (signal vs. noise) cases decision outcomes. plot.FFTrees() now grayscale argument , TRUE, creates grayscale plot. Decision costs: Increased value cost_cues_default 0 1, default cue costs correspond mcu.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"details-2-0-0-9000","dir":"Changelog","previous_headings":"","what":"Details","title":"FFTrees 2.0.0.9000","text":"Fix bug missing plot title. Added @aliases FFTrees-package documentation main FFTrees() function. Removed redundant data_old folder.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"fftrees-200","dir":"Changelog","previous_headings":"","what":"FFTrees 2.0.0","title":"FFTrees 2.0.0","text":"CRAN release: 2023-06-05 FFTrees version 2.0.0 released CRAN [2023-06-06]. version adds functionality, improves consistency, increases robustness. Changes since last release:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"major-changes-2-0-0","dir":"Changelog","previous_headings":"","what":"Major changes","title":"FFTrees 2.0.0","text":"tree definition conversion functions: get_fft_df, read_fft_df, write_fft_df, add_fft_df tree trimming functions: add_nodes, drop_nodes, edit_nodes, flip_exits, reorder_nodes, select_nodes enabled stopping.rule = \"statdelta\" fixed bug fftrees_grow_fan() prevented ifan algorithm stopping finding perfect FFT (given current goal.chase parameter) NA values categorical (.e., character/factor/logical) predictors treated factor levels NA values numeric predictors either ignored (default) imputed (mean corresponding predictor) creating using FFTs decide/predict (possible) NA values criterion variable yet dealt ","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"minor-changes-2-0-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"FFTrees 2.0.0","text":"get_best_tree() retrieves ID best tree FFTrees object (given goal) get_exit_type() converts vector exit descriptions FFT exits (given exit_types) get_fft_df() retrieves tree definitions FFTrees object Added cost information printing FFTs (print.FFTrees()). Improved user feedback (making quiet list four options). Increased vocabulary interpreting verbal FFT descriptions (using .tree). Improved documentation included data (e.g., FFTrees.guide()).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"details-2-0-0","dir":"Changelog","previous_headings":"","what":"Details","title":"FFTrees 2.0.0","text":"Added global constants utility functions. Added progress bar cli package (removing dependency progress). Added exit_types global constant. Improved data cleaning (consistent training test data). Revised documentation, vignettes, tests.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_190-1-9","dir":"Changelog","previous_headings":"","what":"1.9.0","title":"FFTrees 1.9","text":"FFTrees version 1.9.0 released CRAN [2023-02-08]. Apart adding functionality fixing minor bugs, version improves consistency, robustness, transparency. Changes since last release:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"major-changes-1-9","dir":"Changelog","previous_headings":"1.9.0","what":"Major changes","title":"FFTrees 1.9","text":"Enabled optimizing user-defined .goal cue tree levels (defined .goal.fun). Enabled optimizing dprime cue tree levels (using \"dprime\" goal.threshold, goal.chase, goal values). Increased vocabulary interpreting verbal FFT descriptions (using .tree). Included current goal cost values (\"cost\" occurs goals). Included criterion base rates (performance statistics train test data).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"minor-changes-1-9","dir":"Changelog","previous_headings":"1.9.0","what":"Minor changes","title":"FFTrees 1.9","text":"Included dprime values cue level statistics (x$cues$thresholds x$cues$stats). Included dprime values competition statistics (x$competition$train x$competition$test). Improved user feedback combinations goal cost values. Prepared modular tree translation editing functions (util_gfft.R). Prepared global tree notation separator (fft_node_sep). Added decision outcome cue costs asif_results (fftrees_grow_fan()).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"details-1-9","dir":"Changelog","previous_headings":"1.9.0","what":"Details","title":"FFTrees 1.9","text":"Added verification functions (checking integrity objects validity inputs). Deprecated rounding argument FFTrees(). Re-arranged arguments key functions (FFTrees() fftrees_create()) functionality. Re-arranged cleaned code (main helper functions). Re-defined local constants global constants (util_const.R). Revised status badges README. Tweaked plotting parameters. Fixed bugs revised vignettes.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_180-1-8","dir":"Changelog","previous_headings":"","what":"1.8.0","title":"FFTrees 1.8","text":"FFTrees version 1.8.0 released CRAN [2023-01-06]. version mostly extends improves existing functionality. Changes since last release:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"major-changes-1-8","dir":"Changelog","previous_headings":"1.8.0","what":"Major changes","title":"FFTrees 1.8","text":"Enabled manually defining FFTs tree.definitions using FFTs object FFTrees(). Enabled setting goal = 'dprime' select FFTs FFTrees(). Added improved user feedback (quiet = FALSE).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"minor-changes-1-8","dir":"Changelog","previous_headings":"1.8.0","what":"Minor changes","title":"FFTrees 1.8","text":"Show n.per.icon legend = 'icontree'. Bug fix: Removed clipping titles labels. Tweaked spacing parameters. Trimmed white space elements tree definitions (fftrees_apply.R). Added check cues occur current data (verify_all_cues_in_data()).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"details-1-8","dir":"Changelog","previous_headings":"1.8.0","what":"Details","title":"FFTrees 1.8","text":"Removed anova stats imports. Replaced expect_is() precise testthat inheritance functions. Replaced crayon package cli package. Revised documentation vignettes. Fixed bugs revised code increase robustness.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_175-1-7","dir":"Changelog","previous_headings":"","what":"1.7.5","title":"FFTrees 1.7","text":"FFTrees version 1.7.5 released CRAN [2022-09-15]. version contains mostly bug fixes, also improves revises existing functionality. Changes since last release:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"major-changes-1-7","dir":"Changelog","previous_headings":"1.7.5","what":"Major changes","title":"FFTrees 1.7","text":"Added distinctions FFTs “decide” vs. “predict” using corresponding labels plots verbal descriptions. Improved plotting printing FFTs (plot.FFTrees() print.FFTrees()): Added new plotting options (e.g., = '' vs. = 'tree' = 'icontree'). Added distinction header icon guide FFTs “decide” (training data) vs. “predict” (test data). Enabled applying tree new test data providing data frame data. Enabled passing graphical parameters (e.g., col, font, adj) text panel titles. Return invisible FFTrees object x (allow re-assigning global x using new test data).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"minor-changes-1-7","dir":"Changelog","previous_headings":"1.7.5","what":"Minor changes","title":"FFTrees 1.7","text":"Added wacc measures computed competing algorithms. Plotting plot.FFTrees(): Adjusted space title width main argument. Deprecated stats argument. Moved utility functions helper_plot.R.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"details-1-7","dir":"Changelog","previous_headings":"1.7.5","what":"Details","title":"FFTrees 1.7","text":"Revised documentation vignettes. Renamed internal functions variables.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_170-1-7","dir":"Changelog","previous_headings":"","what":"1.7.0","title":"FFTrees 1.7","text":"FFTrees version 1.7.0 released CRAN [2022-08-31]. version contains numerous bug fixes improves revises existing functionality. Changes since last release:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"major-changes-1-7-1","dir":"Changelog","previous_headings":"1.7.0","what":"Major changes","title":"FFTrees 1.7","text":"Added data argument print FFT’s training performance (default) prediction performance (test data available). Enabled setting tree \"best.train\" \"best.test\" (plotting FFTs). Reporting bacc wacc Accuracy section (sens.w, deviating default 0.50). Improved readability 2x2 confusion table (right-justifying digits). Moved cost information Accuracy Speed, Frugality, Cost section. Improved plot = 'ROC' analogous = 'cues'. Reporting bacc wacc Accuracy section (sens.w value, deviating default 0.50). Fixed bug re-enable setting tree \"best.train\" \"best.test\". Fixed bug show correct point labels ROC curve panel. Using current goal object x cue ranking criterion (rather always using wacc). Subtitle now shows sens.w value goal == 'wacc'. Cue legend now accommodates 0 < top < 10. Removed redundant data argument (FFTrees objects contain cue training data). Added alt.goal argument (allow ranking cue accuracies alternative goals). Added quiet argument (hide feedback messages). Added subtitle (signal current cue accuracy ranking criterion). Print tree performance summary goal information (console). Return tree definitions stats (list). Fixed bug forced reversals final exits final node manually creating FFTs .tree fftrees_wordstofftrees().","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"minor-changes-1-7-1","dir":"Changelog","previous_headings":"1.7.0","what":"Minor changes","title":"FFTrees 1.7","text":"Changed tree statistics test data data frames tibbles. Improved feedback missing decision labels creating FFTs descriptions .tree fftrees_wordstofftrees(). Deprecated store.data argument FFTrees().","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"details-1-7-1","dir":"Changelog","previous_headings":"1.7.0","what":"Details","title":"FFTrees 1.7","text":"Changed primary package maintainer Hansjoerg Neth, Nathaniel Phillips still board. Revised text, examples, links vignettes. Reduced clutter recycling code combining files. Cleanup code documentation.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"fftrees-16","dir":"Changelog","previous_headings":"","what":"FFTrees 1.6","title":"FFTrees 1.6","text":"FFTrees version 1.6.6 released CRAN [2022-07-18]. Changes since last release:","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_166-1-6","dir":"Changelog","previous_headings":"","what":"1.6.6","title":"FFTrees 1.6","text":"Fixed bug causing plot.FFTrees() display plots properly.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_165-1-6","dir":"Changelog","previous_headings":"","what":"1.6.5","title":"FFTrees 1.6","text":"Cleanup get package back CRAN failed submission July 17, 2022.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_164-1-6","dir":"Changelog","previous_headings":"","what":"1.6.4","title":"FFTrees 1.6","text":"Cleanup get package back CRAN failed submission July 16, 2022.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_163-1-6","dir":"Changelog","previous_headings":"","what":"1.6.3","title":"FFTrees 1.6","text":"Additional cleanup get package back CRAN failed submission July 12, 2022.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_162-1-6","dir":"Changelog","previous_headings":"","what":"1.6.2","title":"FFTrees 1.6","text":"Internal cleanup get package back CRAN.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_161-1-6","dir":"Changelog","previous_headings":"","what":"1.6.1","title":"FFTrees 1.6","text":"plot.FFTrees() longer saves graphic params changed par(). plot.FFTRrees(): test = 'best.test' test data provided, information text returned message() rather print(). Deprecation notes plot.FFTrees() now returned warnings, messages.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_157-1-5","dir":"Changelog","previous_headings":"","what":"1.5.7","title":"FFTrees 1.5","text":"Officially deprecated \"max\" \"zigzag\" algorithms. Minor cleanup throughout.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_150-1-5","dir":"Changelog","previous_headings":"","what":"1.5.0","title":"FFTrees 1.5","text":"Fixed warnings CRAN submission. FFTrees objects now nicer internal structure. Added tests throughout (finally). Extensive code cleanup, speed things . New print method includes ASCII confusion matrix.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_140-1-4","dir":"Changelog","previous_headings":"","what":"1.4.0","title":"FFTrees 1.4","text":"Big hood changes make code efficient (prepare C++). Code ~50% faster. Many inputs cost.cues cost.outcomes now specified named lists avoid confusion. New cost outputs separate costs cues, outcomes, total costs. Changes input defaults goal goal.chase.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_136-1-3","dir":"Changelog","previous_headings":"","what":"1.3.6","title":"FFTrees 1.3","text":"Bug fixes.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_135-1-3","dir":"Changelog","previous_headings":"","what":"1.3.5","title":"FFTrees 1.3","text":"Bug fixes.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_134-1-3","dir":"Changelog","previous_headings":"","what":"1.3.4","title":"FFTrees 1.3","text":"Added class probability predictions predict.FFTrees(type = \"prob\"). Updated print.FFTrees() display FFT #1 ‘words’ (inwords(x) function).","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_133-1-3","dir":"Changelog","previous_headings":"","what":"1.3.3","title":"FFTrees 1.3","text":"Added show.X arguments plot.FFTrees() allow selectively turn turn elements plotting FFTrees object. Added label.tree, label.performance arguments plot.FFTrees() allow specify plot (sub) labels. Bug fixes: Issues passing existing FFTrees object new call FFTrees().","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_130-1-3","dir":"Changelog","previous_headings":"","what":"1.3.0","title":"FFTrees 1.3","text":"Many additional vignettes (e.g.; Accuracy Statistics Heart Disease Tutorial) updates existing vignettes. Added cost.outcomes cost.cues allow user specify specify cost outcomes cues. Also added cost statistic throughout outputs. Added inwords(), function converts FFTrees object words. Added .tree argument FFTrees() allows user specify FFT verbally. E.g., .tree = 'age > 30, predict True. sex = {m}, predict False. Otherwise, predict True'. Added positive predictive value ppv, negative predictive value npv balanced predictive value bpv, primary accuracy statistics throughout. Added support two FFT construction algorithms Martignon et al. (2008): \"zigzag\" \"max\". algorithms contained file heuristic_algorithm.R can implemented FFTrees() arguments algorithm.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_123-1-2","dir":"Changelog","previous_headings":"","what":"1.2.3","title":"FFTrees 1.2","text":"Added sens.w argument allow differential weighting sensitivities specificities selecting applying trees. Fixed bug calculating importance weightings FFForest() outputs.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_120-1-2","dir":"Changelog","previous_headings":"","what":"1.2.0","title":"FFTrees 1.2","text":"Changed wording statistics throughout package: hr (hit rate) far (false alarm rate) (based classification frequency values hi  fa), now sens sensitivity spec specificity (1 −-far), respectively. rank.method argument now deprecated. Use algorithm instead. Added stats argument plot.FFTrees(). stats = FALSE, tree plotted without reference statistical output. Grouped competitive algorithm results (regression, cart, random forests, support vector machines) new x.fft$comp slot rather separate first level list algorithm. Also replaced separate algorithm wrappers one general comp_pred() wrapper function. Added FFForest(), function creating forests FFTs, plot.FFForest(), visualizing forests FFTs. (function experimental still development.) Added random forests support vector machines comparison FFTrees() using randomForest e1071 packages. Changed logistic regression algorithm default glm() version glmnet() regularized version. predict.FFTrees() now returns vector predictions specific tree rather creating entirely new FFTrees object. can now plot cue accuracies within plot.FFTrees() function including plot.FFTrees(= 'cues') argument. (replaces former showcues() function.) Many cosmetic changes plot.FFTrees() (e.g.; gray levels, distinct classification balls). can also control whether results competing algorithms displayed comp argument. Bug-fixes: Fixed bug levels classifications plotted correctly.","code":""},{"path":[]},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_117-1-1","dir":"Changelog","previous_headings":"","what":"1.1.7","title":"FFTrees 1.1","text":"Trees can now use cue multiple times within tree. , set rank.method = \"c\" repeat.cues = TRUE. Bug-fixes: can (!) now column NAs criterion test datasets represent data criterion unknown. FFTrees() now supports single predictor (e.g.; formula = diagnosis ~ age) previously work.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_116-1-1","dir":"Changelog","previous_headings":"","what":"1.1.6","title":"FFTrees 1.1","text":"Streamlined code improve cohesion functions. may cause issues FFTrees objects created earlier versions package. need re-created. Updated, clearer print.FFTrees() method see important info FFTrees object matrix format. Training testing statistics now separate objects (e.g., data$train vs. data$test) avoid confusion. Bug-fixes: predict.FFTrees() now works much better passing new dataset (data.test) test dataset existing FFTrees object.","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_115-1-1","dir":"Changelog","previous_headings":"","what":"1.1.5","title":"FFTrees 1.1","text":"Plotting parameters mar layout now reset running plot.FFTrees()","code":""},{"path":"https://ndphillips.github.io/FFTrees/dev/news/index.html","id":"id_114-1-1","dir":"Changelog","previous_headings":"","what":"1.1.4","title":"FFTrees 1.1","text":"Plotting longer fails one branch tree. Changed .tree argument plot.FFTrees() tree conform blog posts. predict.FFTrees() now works better tibble inputs. Changed fft label FFTrees throughout package avoid confusion fast fourier transform. Thus, main tree building function now FFTrees() new tree object class FFTrees. [File NEWS.md last updated 2024-09-04.]","code":""}]