Skip to content

Commit 1c3f2af

Browse files
authored
Fix confusion-matrix plot:
use valid palette name “Greens” correct swapped train/test titles
1 parent 260bd43 commit 1c3f2af

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

R/eCM_plot.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ eCM_plot <- function(task,
6161
trained_model,
6262
splits,
6363
add_sums = TRUE,
64-
palette = "Green") {
64+
palette = "Greens") {
6565
# library(ggplot2)
6666
mydata <- task$data()
6767
mydata <- as.data.frame(mydata)
@@ -88,7 +88,7 @@ eCM_plot <- function(task,
8888
label = "Total",
8989
tc_tile_border_color = "black"
9090
)
91-
) + ggtitle("Confusion matrix for the train set")
91+
) + ggtitle("Confusion matrix for the test set")
9292
CM_plt_test[["labels"]][["x"]] <- "Truth (observation)"
9393
CM_plt_test[["labels"]][["y"]] <- "Prediction (model output)"
9494
CM_plt_test[["theme"]][["text"]][["size"]] <- 9
@@ -117,7 +117,7 @@ eCM_plot <- function(task,
117117
label = "Total",
118118
tc_tile_border_color = "black"
119119
)
120-
) + ggtitle("Confusion matrix for the test set")
120+
) + ggtitle("Confusion matrix for the train set")
121121
CM_plt_train[["labels"]][["x"]] <- "Truth (observation)"
122122
CM_plt_train[["labels"]][["y"]] <- "Prediction (model output)"
123123
CM_plt_train[["theme"]][["text"]][["size"]] <- 9

0 commit comments

Comments
 (0)