-
-
Notifications
You must be signed in to change notification settings - Fork 94
Use new condition system for errors and warnings #1398
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
Changes from 12 commits
db7dd45
df49f1a
5608581
ce4cfbc
5542372
28b5634
5947cb7
8a1747c
b788315
24022e0
7b5c2b6
a073ba9
4d7d1de
dee838f
0b3bd3a
2835ef2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,7 +64,7 @@ LearnerRegrDebug = R6Class("LearnerRegrDebug", inherit = LearnerRegr, | |
| #' @return Named `numeric()`. | ||
| importance = function() { | ||
| if (is.null(self$model)) { | ||
| stopf("No model stored") | ||
| error_learner("No model stored") | ||
| } | ||
| fns = self$state$feature_names | ||
| set_names(rep(0, length(fns)), fns) | ||
|
|
@@ -75,7 +75,7 @@ LearnerRegrDebug = R6Class("LearnerRegrDebug", inherit = LearnerRegr, | |
| #' @return `character()`. | ||
| selected_features = function() { | ||
| if (is.null(self$model)) { | ||
| stopf("No model stored") | ||
| error_learner("No model stored") | ||
| } | ||
| character(0) | ||
| } | ||
|
|
@@ -88,13 +88,13 @@ LearnerRegrDebug = R6Class("LearnerRegrDebug", inherit = LearnerRegr, | |
| } | ||
|
|
||
| if (roll("message_train")) { | ||
| message("Message from classif.debug->train()") | ||
| message("Message from regr.debug->train()") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Incorrect learner name in debug messageThe training message for |
||
| } | ||
| if (roll("warning_train")) { | ||
| warningf("Warning from classif.debug->train()") | ||
| warning_mlr3("Warning from regr.debug->train()") | ||
| } | ||
| if (roll("error_train")) { | ||
| stopf("Error from classif.debug->train()") | ||
| error_learner_train("Error from regr.debug->train()") | ||
| } | ||
| if (roll("segfault_train")) { | ||
| get("attach")(structure(list(), class = "UserDefinedDatabase")) | ||
|
|
@@ -131,13 +131,13 @@ LearnerRegrDebug = R6Class("LearnerRegrDebug", inherit = LearnerRegr, | |
| } | ||
|
|
||
| if (roll("message_predict")) { | ||
| message("Message from classif.debug->predict()") | ||
| message("Message from regr.debug->predict()") | ||
| } | ||
| if (roll("warning_predict")) { | ||
| warningf("Warning from classif.debug->predict()") | ||
| warning_mlr3("Warning from regr.debug->predict()") | ||
| } | ||
| if (roll("error_predict")) { | ||
| stopf("Error from classif.debug->predict()") | ||
| error_learner_predict("Error from regr.debug->predict()") | ||
| } | ||
| if (roll("segfault_predict")) { | ||
| get("attach")(structure(list(), class = "UserDefinedDatabase")) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Wrong error type for quantile configuration
The errors when setting
quantilesandquantile_responsefields useerror_learner_predictbut should useerror_config. These errors occur during configuration when a user tries to set quantile-related fields on a learner that doesn't support quantile prediction, not during actual prediction. Usingerror_learner_predictincorrectly categorizes this as a prediction failure rather than a configuration error.Additional Locations (1)
R/LearnerRegr.R#L153-L154