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

address duplicate eval_time warnings #94

Merged
merged 2 commits into from
Jan 19, 2024
Merged

Conversation

simonpcouch
Copy link
Contributor

Closes #91. Closes #92. :)

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

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

set.seed(1)
folds <- vfold_cv(mtcars, 5)
lr <- linear_reg(penalty = tune(), engine = "glmnet")
form <- mpg ~ .

# mode is not censored regression 
set.seed(1)
tune_res <- tune_race_anova(lr, form, folds, eval_time = 10)
#> Warning in tune_race_anova(lr, form, folds, eval_time = 10): Evaluation times are only required when the model mode is "censored regression"
#> (and will be ignored).

set.seed(1)
tune_res <- tune_sim_anneal(lr, form, folds, eval_time = 10)
#> Warning in tune_sim_anneal(lr, form, folds, eval_time = 10): Evaluation times are only required when the model mode is "censored regression"
#> (and will be ignored).
#> Optimizing rmse
#> Initial best: 3.25360
#> 1 ♥ new best           rmse=2.7579 (+/-0.247)
#> 2 ─ discard suboptimal rmse=3.9981 (+/-0.4455)
#> 3 ♥ new best           rmse=2.748 (+/-0.4719)
#> 4 ◯ accept suboptimal  rmse=3.0369 (+/-0.1987)
#> 5 ─ discard suboptimal rmse=4.2031 (+/-0.4614)
#> 6 + better suboptimal  rmse=2.9428 (+/-0.1971)
#> 7 ♥ new best           rmse=2.6956 (+/-0.3407)
#> 8 ─ discard suboptimal rmse=3.7762 (+/-0.3859)
#> 9 ─ discard suboptimal rmse=3.0156 (+/-0.1956)
#> 10 ─ discard suboptimal rmse=3.486 (+/-0.2823)

set.seed(1)
tune_res <- tune_race_win_loss(lr, form, folds, eval_time = 10)
#> Warning in tune_race_win_loss(lr, form, folds, eval_time = 10): Evaluation times are only required when the model mode is "censored regression"
#> (and will be ignored).

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

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.

Nice! Could you please add the examples from the original issues as test cases to extratests? 🙏

@simonpcouch simonpcouch merged commit f952b4b into main Jan 19, 2024
8 checks passed
@simonpcouch simonpcouch deleted the eval-time-warn-91-92 branch January 19, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants