Skip to content

Commit

Permalink
Fix prediction anlaysis with one predictor
Browse files Browse the repository at this point in the history
  • Loading branch information
koenderks committed Feb 4, 2025
1 parent c923409 commit 628cfba
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
10 changes: 0 additions & 10 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
import(jaspBase)
S3method(.decodeJaspMLobject,kknn)
S3method(.decodeJaspMLobject,lda)
S3method(.decodeJaspMLobject,lm)
S3method(.decodeJaspMLobject,gbm)
S3method(.decodeJaspMLobject,randomForest)
S3method(.decodeJaspMLobject,cv.glmnet)
S3method(.decodeJaspMLobject,nn)
S3method(.decodeJaspMLobject,rpart)
S3method(.decodeJaspMLobject,svm)
S3method(.decodeJaspMLobject,naiveBayes)
S3method(.mlPredictionGetModelType,kknn)
S3method(.mlPredictionGetModelType,lda)
S3method(.mlPredictionGetModelType,lm)
Expand Down
2 changes: 1 addition & 1 deletion R/mlPrediction.R
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ is.jaspMachineLearning <- function(x) {
dataset <- .scaleNumericData(dataset)
}
# Select only the predictors in the model to prevent accidental double column names
dataset <- dataset[, which(decodeColNames(colnames(dataset)) %in% model[["jaspVars"]][["decoded"]]$predictors)]
dataset <- dataset[, which(decodeColNames(colnames(dataset)) %in% model[["jaspVars"]][["decoded"]]$predictors), drop = FALSE]
# Ensure the column names in the dataset match those in the training data
colnames(dataset) <- .matchDecodedNames(colnames(dataset), model)
# Retrieve the training set
Expand Down
2 changes: 1 addition & 1 deletion inst/qml/mlRegressionKnn.qml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Form
KNN.WeightFunction { }
}

UI.ExportResults { enabled: vars.predictorCount > 1 && vars.targetCount > 0 }
UI.ExportResults { enabled: vars.predictorCount > 0 && vars.targetCount > 0 }

UI.DataSplit { trainingValidationSplit: !optim.isManual }

Expand Down
2 changes: 1 addition & 1 deletion inst/qml/mlRegressionLinear.qml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Form
FIG.PredictivePerformance { }
}

UI.ExportResults { enabled: vars.predictorCount > 1 > 0 && vars.targetCount > 0 }
UI.ExportResults { enabled: vars.predictorCount > 0 && vars.targetCount > 0 }
UI.DataSplit { trainingValidationSplit: false }

Section
Expand Down

0 comments on commit 628cfba

Please sign in to comment.