Skip to content

Commit a5145af

Browse files
committed
Only continue when all predictors are present
1 parent c322825 commit a5145af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/mlPrediction.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ is.jaspMachineLearning <- function(x) {
286286
dataset <- jaspBase::excludeNaListwise(dataset, options[["predictors"]])
287287
# Select only the predictors in the model to prevent accidental double column names
288288
dataset <- dataset[, which(decodeColNames(colnames(dataset)) %in% model[["jaspVars"]][["decoded"]]$predictors), drop = FALSE]
289-
if (NCOL(dataset) > 0) {
289+
if (NCOL(dataset) == length(model[["jaspVars"]][["decoded"]]$predictors)) {
290290
# Ensure the column names in the dataset match those in the training data
291291
colnames(dataset) <- .matchDecodedNames(colnames(dataset), model)
292292
# Scale the features with the same scaling as the original dataset

0 commit comments

Comments
 (0)