|
753 | 753 | purpose <- "classification"
|
754 | 754 | }
|
755 | 755 | predictors <- model[["jaspVars"]][["encoded"]]$predictors
|
| 756 | + predictorNames <- model[["jaspVars"]][["decoded"]]$predictors |
756 | 757 | } else {
|
757 | 758 | predictors <- options[["predictors"]]
|
| 759 | + predictorNames <- options[["predictors"]] |
758 | 760 | }
|
759 | 761 | table$position <- position
|
760 | 762 | table$dependOn(options = c(
|
|
767 | 769 | ))
|
768 | 770 | table$addColumnInfo(name = "id", title = gettext("Case"), type = "integer")
|
769 | 771 | if (purpose == "regression") {
|
770 |
| - table$addColumnInfo(name = "pred", title = gettext("Predicted"), type = "number") |
| 772 | + table$addColumnInfo(name = "pred_jaspname", title = gettext("Predicted"), type = "number") |
771 | 773 | } else {
|
772 |
| - table$addColumnInfo(name = "pred", title = gettext("Predicted (Prob.)"), type = "string") |
| 774 | + table$addColumnInfo(name = "pred_jaspname", title = gettext("Predicted (Prob.)"), type = "string") |
773 | 775 | }
|
774 | 776 | table$addColumnInfo(name = "avg", title = gettext("Base"), type = "number")
|
775 |
| - for (i in predictors) { |
| 777 | + for (i in predictorNames) { |
776 | 778 | table$addColumnInfo(name = i, title = i, type = "number")
|
777 | 779 | }
|
778 | 780 | jaspResults[["tableShap"]] <- table
|
|
791 | 793 | from <- min(c(options[["fromIndex"]], options[["toIndex"]] - 1, nrow(x_test)))
|
792 | 794 | to <- min(c(options[["toIndex"]], nrow(x_test)))
|
793 | 795 | out <- as.data.frame(matrix(NA, nrow = length(from:to), ncol = 3 + length(predictors)))
|
794 |
| - colnames(out) <- c("id", "pred", "avg", predictors) |
| 796 | + colnames(out) <- c("id", "pred_jaspname", "avg", predictorNames) |
795 | 797 | p <- try({
|
796 | 798 | for (i in seq_along(from:to)) {
|
797 | 799 | out[i, 1] <- (from:to)[i]
|
|
0 commit comments