Skip to content

Commit

Permalink
Enforce scale in test set indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
koenderks committed Nov 30, 2024
1 parent f4d175b commit 9b2330d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 0 additions & 4 deletions R/commonMachineLearningRegression.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@
if (length(unlist(options[["predictors"]])) > 0 && options[["scaleVariables"]]) {
dataset[, options[["predictors"]]] <- .scaleNumericData(dataset[, options[["predictors"]], drop = FALSE])
}
# Make sure the test set indicator is numeric
if (options[["testSetIndicatorVariable"]] != "" && options[["holdoutData"]] == "testSetIndicator")
dataset[[options[["testSetIndicatorVariable"]]]] <- as.numeric(dataset[[options[["testSetIndicatorVariable"]]]])

return(dataset)
}

Expand Down
3 changes: 2 additions & 1 deletion inst/qml/common/ui/DataSplit.qml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Section
name: "testSetIndicator"
label: qsTr("Test set indicator")
childrenOnSameRow: true
info: qsTr("Use an indicator variable to select data for the test set. This indicator should be a column in your data that consists of only 0 (excluded from the test set) and 1 (included in the test set). The data will then be split into a training (and validation if requested) set (0), and a test set (1) according to your indicator.")
info: qsTr("Use an indicator variable to select data for the test set. This indicator should be a column of type scale in your data that consists of only 0 (excluded from the test set) and 1 (included in the test set). The data will then be split into a training (and validation if requested) set (0), and a test set (1) according to your indicator.")

DropDown
{
Expand All @@ -94,6 +94,7 @@ Section
addEmptyValue: true
placeholderText: qsTr("None")
info: qsTr("The variable in the data set that is used as the test set indicator.")
source: [ { model: columnsModel, use: "type=scale"} ]
}
}
}
Expand Down

0 comments on commit 9b2330d

Please sign in to comment.