Skip to content

nested_fit_resamples() refuses a metric set that does not suit the model's mode - #132

Merged
jmgirard merged 7 commits into
mainfrom
m117-fit-resamples-metrics-mode
Sep 24, 2026
Merged

jmgirard merged 7 commits into
mainfrom
m117-fit-resamples-metrics-mode

Conversation

@jmgirard

Copy link
Copy Markdown
Collaborator

nested_fit_resamples() now stops with an error of class nestedtune_metrics_mode before any fold runs when the metric set does not suit the model's mode (for example, a classification metric on a regression model). Before, every fold ran and failed, and the call only warned.

nested_workflow_map() makes the same refusal in its pre-check for workflows it routes to nested_fit_resamples(), before any workflow runs.

  • nested_loop() runs the mode check for every tuner and keeps the selecting metric's name only for a tuner that selects.
  • Tests for both functions in tests/testthat/test-selection-metric.R.
  • Help for both functions and the unreleased NEWS bullet updated.

Local: devtools::test() passes (11503 expectations), devtools::check() gives 0 errors, 0 warnings, 0 notes.

@jmgirard
jmgirard merged commit 2aac289 into main Sep 24, 2026
15 checks passed
@jmgirard
jmgirard deleted the m117-fit-resamples-metrics-mode branch September 24, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant