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

Use rlang type checkers #519

Open
EmilHvitfeldt opened this issue Oct 25, 2024 · 0 comments
Open

Use rlang type checkers #519

EmilHvitfeldt opened this issue Oct 25, 2024 · 0 comments
Labels
upkeep maintenance, infrastructure, and similar

Comments

@EmilHvitfeldt
Copy link
Member

Once #517 is merged, we can use the type checkers for the couple of places where metrics have another argument. They can all be found here:

library(yardstick)
library(tidyverse)

fns <- lsf.str("package:yardstick")
fn_args <- lapply(fns, formals)
names(fn_args) <- fns

map(fn_args, ~ tibble(arg = names(.x))) |>
  list_rbind(names_to = "fn") |>
  filter(str_detect(fn, "_vec$")) |>
  filter(!arg %in% c("truth", "estimate", "na_rm", "case_weights", "...", 
                     "estimator", "event_level"))
#> # A tibble: 14 × 2
#>    fn                      arg       
#>    <chr>                   <chr>     
#>  1 ccc_vec                 bias      
#>  2 classification_cost_vec costs     
#>  3 f_meas_vec              beta      
#>  4 huber_loss_pseudo_vec   delta     
#>  5 huber_loss_vec          delta     
#>  6 kap_vec                 weighting 
#>  7 mase_vec                m         
#>  8 mase_vec                mae_train 
#>  9 mn_log_loss_vec         sum       
#> 10 npv_vec                 prevalence
#> 11 ppv_vec                 prevalence
#> 12 roc_auc_vec             options   
#> 13 roc_aunp_vec            options   
#> 14 roc_aunu_vec            options

Created on 2024-10-24 with reprex v2.1.0

@EmilHvitfeldt EmilHvitfeldt added the upkeep maintenance, infrastructure, and similar label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upkeep maintenance, infrastructure, and similar
Projects
None yet
Development

No branches or pull requests

1 participant