diff --git a/NAMESPACE b/NAMESPACE index 7efc6821..4f91a67e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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) diff --git a/R/mlPrediction.R b/R/mlPrediction.R index dfae59ac..5128061f 100644 --- a/R/mlPrediction.R +++ b/R/mlPrediction.R @@ -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 diff --git a/inst/qml/mlRegressionKnn.qml b/inst/qml/mlRegressionKnn.qml index e9cb9b88..e95b7f3b 100644 --- a/inst/qml/mlRegressionKnn.qml +++ b/inst/qml/mlRegressionKnn.qml @@ -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 } diff --git a/inst/qml/mlRegressionLinear.qml b/inst/qml/mlRegressionLinear.qml index ef7e35b8..3dd82086 100644 --- a/inst/qml/mlRegressionLinear.qml +++ b/inst/qml/mlRegressionLinear.qml @@ -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