Skip to content

feat: better error message when incorrectly configuring validation data #1268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# mlr3 (development version)

* feat: Add `score_roc_measures()` to score a prediction on various roc measures.
* feat: A better error message is thrown when incorrectly configuring the `validate` field
of a `GraphLearner`

# mlr3 0.23.0

Expand All @@ -13,7 +15,7 @@
* BREAKING CHANGE: `Learner$predict_types` is read-only now.
* docs: Clear up behavior of `Learner$predict_type` after training.
* feat: Add callbacks to `resample()` and `benchmark()`.
* fix: Internal tuning and validation now works when the model requires marshaling (#1256).
* fix: Internal tuning and validation now works when the model requires marshaling (#1256)

# mlr3 0.22.1

Expand Down
2 changes: 1 addition & 1 deletion R/worker.R
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ create_internal_valid_task = function(validate, task, test_row_ids, prev_valid,
if (is.character(validate)) {
if (validate == "predefined") {
if (is.null(task$internal_valid_task)) {
stopf("Parameter 'validate' is set to 'predefined' but no internal validation task is present.")
stopf("Parameter 'validate' is set to 'predefined' but no internal validation task is present. This commonly happens in GraphLearners and can be avoided by configuring the GraphLearner via `set_validate(<glrn>, validate = <value>)`. See https://mlr3book.mlr-org.com/chapters/chapter15/predsets_valid_inttune.html for more information.")
}
if (!identical(task$target_names, task$internal_valid_task$target_names)) {
stopf("Internal validation task '%s' has different target names than primary task '%s', did you modify the task after creating the internal validation task?",
Expand Down