From 73d412865d7ad508715983a8bfc626820a58892d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hansj=C3=B6rg=20Neth?= Date: Wed, 4 Sep 2024 11:04:06 +0200 Subject: [PATCH] Bug fix: Adjust row_lbl of 2x2 confusion matrix to read "Prediction" when using "test" data, but keep default of "Decision" otherwise. --- R/plotFFTrees_function.R | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/R/plotFFTrees_function.R b/R/plotFFTrees_function.R index 8fe72957..4cec1f39 100644 --- a/R/plotFFTrees_function.R +++ b/R/plotFFTrees_function.R @@ -1640,7 +1640,7 @@ plot.FFTrees <- function(x = NULL, # print(lloc) # 4debugging - # Classification table: ---- + # Classification table: 2x2 matrix / confusion matrix: ---- if (show.confusion) { @@ -1695,16 +1695,19 @@ plot.FFTrees <- function(x = NULL, decision.labels[1], adj = 1 ) + # Adjust row category label: + if (data == "test") { + row_lbl <- "Prediction" + } else { # default: + row_lbl <- "Decision" + } + text( x = final_classtable_x[1] - .065, y = mean(final_classtable_y), cex = header_cex, - "Decision" + row_lbl ) - # text(x = final_classtable_x[1] - .05, - # y = mean(final_classtable_y), cex = header_cex, - # "Decision", srt = 90, pos = 3) - # Add final frequencies: ----