Skip to content

Commit 4abd845

Browse files
committed
Add clarifying comment
1 parent 945a1ef commit 4abd845

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
@@ -297,7 +297,7 @@ is.jaspMachineLearning <- function(x) {
297297
trainingSet <- model[["explainer"]]$data
298298
# Check for factor levels in the test set that are not in the training set
299299
.checkForNewFactorLevelsInPredictionSet(trainingSet, dataset, "prediction", model)
300-
# Ensure factor variables in dataset have same levels as those in the training data
300+
# Ensure that factor variables in the dataset have their levels ordered the same way as in the training data
301301
factorColumns <- colnames(dataset)[sapply(dataset, is.factor)]
302302
dataset[factorColumns] <- lapply(factorColumns, function(i) factor(dataset[[i]], levels = levels(trainingSet[[i]])))
303303
}

0 commit comments

Comments
 (0)