Skip to content

Commit 140e5db

Browse files
committed
Update
1 parent 1818d85 commit 140e5db

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

R/commonMachineLearningClassification.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
"rpart" = gettext("Decision Tree Classification"),
120120
"svm" = gettext("Support Vector Machine Classification"),
121121
"naivebayes" = gettext("Naive Bayes Classification"),
122-
"logistic" = gettext("Logistic / Multinomial Regression")
122+
"logistic" = gettext("Logistic / Multinomial Regression Classification")
123123
)
124124
tableTitle <- gettextf("Model Summary: %1$s", title)
125125
table <- createJaspTable(tableTitle)
@@ -318,6 +318,11 @@
318318
)
319319
table$addRows(row)
320320
} else if (type == "logistic") {
321+
if (classificationResult[["family"]] == "binomial") {
322+
table$title <- gettext("Model Summary: Logistic Regression Classification")
323+
} else {
324+
table$title <- gettext("Model Summary: Multinomial Regression Classification")
325+
}
321326
row <- data.frame(
322327
family = classificationResult[["family"]],
323328
nTrain = nTrain,

R/mlClassificationLogistic.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,12 @@ mlClassificationLogistic <- function(jaspResults, dataset, options, ...) {
168168
table[["upper"]] <- coefs[, "upper"]
169169
}
170170
if (options[["formula"]]) {
171+
one_cat <- levels(factor(classificationResult[["train"]][[options[["target"]]]]))[2]
171172
if (options[["intercept"]]) {
172-
regform <- paste0("logit(", options[["target"]], ") = ", round(as.numeric(coefs[, 1])[1], 3))
173+
regform <- paste0("logit(p<sub>", options[["target"]], " = ", one_cat, "</sub>) = ", round(as.numeric(coefs[, 1])[1], 3))
173174
start <- 2
174175
} else {
175-
regform <- paste0("logit(", options[["target"]], ") = ")
176+
regform <- paste0("logit(p<sub>", options[["target"]], " = ", one_cat, "</sub>) = ")
176177
start <- 1
177178
}
178179
for (i in start:nrow(coefs)) {

inst/Description.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Description
100100
Analysis
101101
{
102102
menu: qsTr("Logistic / Multinomial")
103-
title: qsTr("Logistic / Multinomial Classification")
103+
title: qsTr("Logistic / Multinomial Regression Classification")
104104
func: "mlClassificationLogistic"
105105
}
106106
Analysis

0 commit comments

Comments
 (0)