Skip to content
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

Refactored functions to evaluate/check metric and eval time arguments #780

Merged
merged 44 commits into from
Dec 11, 2023

Conversation

topepo
Copy link
Member

@topepo topepo commented Dec 6, 2023

This includes reworked versions of the argument checking code used by a family of functions: fit_resamples(), tune_*(), and last_fit().

I've wholesale copied parsnip::.filter_eval_time to use here; we should probably export that.

For testing tune_bayes(), we'll need an additional engine so that will have to go into extratests.

An updated itinerary of PRs

  1. Tools for selecting a default evaluation time #768
  2. Refactor choose_metric #777
  3. Refactored functions to select single evaluation times #778
  4. (you are here) refactor metric input checking code in the tune_* functions, fit_resamples(). etc.
  5. update finetune to use these changes
  6. put unit tests that can't go into tune in the extratests repo
  7. add additional functions that return (potentially) multiple evaluation times (eg autoplot())
  8. write an article on tidymodels.org about this.

@topepo topepo requested a review from hfrick December 6, 2023 22:17
@topepo topepo marked this pull request as ready for review December 6, 2023 22:19
Copy link
Member

@hfrick hfrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of questions about future directions, collected from the comments:

  • what is the plan for for check_metrics() vs check_metrics_arg() and check_eval_time() vs check_eval_time_arg()?
  • are we still aiming to remove tune's dependency on censored?
  • we could include parsnip's .filter_eval_time() in the standalone file for survival utilities
  • .get_metric_time() is now unused - let's remove/deprecate it?

A consistency comment

  • warn instead of error on <2 time points for integrated survival metric?

An oversight

  • the snapshot test for last_fit needs to be properly updated

tests/testthat/_snaps/last-fit.new.md Outdated Show resolved Hide resolved
tests/testthat/test-eval-time-args.R Show resolved Hide resolved
tests/testthat/test-eval-time-args.R Outdated Show resolved Hide resolved
tests/testthat/test-eval-time-args.R Show resolved Hide resolved
R/metric-selection.R Show resolved Hide resolved
R/metric-selection.R Outdated Show resolved Hide resolved
R/metric-selection.R Show resolved Hide resolved
R/metric-selection.R Outdated Show resolved Hide resolved
R/tune_bayes.R Show resolved Hide resolved
tests/testthat/test-metric-args.R Show resolved Hide resolved
@topepo topepo merged commit 585e01d into main Dec 11, 2023
9 checks passed
@topepo topepo deleted the new-surv-arg-checking branch December 11, 2023 18:43
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants