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

tune_race_anova() throws same warning twice #91

Closed
hfrick opened this issue Jan 16, 2024 · 0 comments · Fixed by #94
Closed

tune_race_anova() throws same warning twice #91

hfrick opened this issue Jan 16, 2024 · 0 comments · Fixed by #94

Comments

@hfrick
Copy link
Member

hfrick commented Jan 16, 2024

Part of tidymodels/tune#704

It would be nice if this warning is only thrown once. (One of them comes from tune_grid() but is irrelevant to the user.)

library(tidymodels)
library(censored)
#> Loading required package: survival
library(finetune)

lung_surv <- lung %>% 
  dplyr::mutate(surv = Surv(time, status), .keep = "unused")

# mode is not censored regression 
set.seed(2193)
tune_res <-
  linear_reg(penalty = tune(), engine = "glmnet") %>%
  tune_race_anova(
    mpg ~ .,
    resamples = vfold_cv(mtcars, 5),
    metrics = metric_set(rmse),
    eval_time = 10
  )
#> Warning in tune::tune_grid(., tmp_resamples, param_info = param_info, grid = grid, : Evaluation times are only required when the model mode is "censored regression"
#> (and will be ignored).
#> Warning in tune_race_anova(., mpg ~ ., resamples = vfold_cv(mtcars, 5), : Evaluation times are only required when the model mode is "censored regression"
#> (and will be ignored).


# static metric 
set.seed(2193)
tune_res <-
  proportional_hazards(penalty = tune(), engine = "glmnet") %>%
  tune_race_anova(
    surv ~ .,
    resamples = vfold_cv(lung_surv, 5),
    metrics = metric_set(concordance_survival),
    eval_time = 10
  )
#> Warning in tune::tune_grid(., tmp_resamples, param_info = param_info, grid = grid, : Evaluation times are only required when dynmanic or integrated metrics are used
#> (and will be ignored here).
#> Warning in tune_race_anova(., surv ~ ., resamples = vfold_cv(lung_surv, : Evaluation times are only required when dynmanic or integrated metrics are used
#> (and will be ignored here).

Created on 2024-01-16 with reprex v2.0.2

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 a pull request may close this issue.

1 participant