@@ -106,7 +106,7 @@ mlClassificationLogisticMultinomial <- function(jaspResults, dataset, options, .
106
106
result [[" model" ]] <- trainingFit
107
107
result [[" confTable" ]] <- table(" Pred" = testPredictions , " Real" = testSet [, options [[" target" ]]])
108
108
result [[" testAcc" ]] <- sum(diag(prop.table(result [[" confTable" ]])))
109
- # result[["auc"]] <- .classificationCalcAUC(testSet, trainingSet, options, " logisticClassification")
109
+ result [[" auc" ]] <- .classificationCalcAUC(testSet , trainingSet , options , if ( family == " binomial " ) " logisticClassification" else " multinomialClassification " )
110
110
result [[" ntrain" ]] <- nrow(trainingSet )
111
111
result [[" ntest" ]] <- nrow(testSet )
112
112
result [[" testReal" ]] <- testSet [, options [[" target" ]]]
@@ -207,7 +207,7 @@ mlClassificationLogisticMultinomial <- function(jaspResults, dataset, options, .
207
207
table [[" lower" ]] <- coefs [, " lower" ]
208
208
table [[" upper" ]] <- coefs [, " upper" ]
209
209
}
210
- if (options [[" formula" ]]) {
210
+ if (options [[" formula" ]]) { # TODO FOR MULTINOMIAL
211
211
one_cat <- levels(factor (classificationResult [[" train" ]][[options [[" target" ]]]]))[2 ]
212
212
if (options [[" intercept" ]]) {
213
213
regform <- paste0(" logit(p<sub>" , options [[" target" ]], " = " , one_cat , " </sub>) = " , round(as.numeric(coefs [, 1 ])[1 ], 3 ))
0 commit comments