How to add beta parameter to F1 Score for fit_resample in TidyModel

273 views Asked by At

I am using the fit_resamples() function in TidyModels to get the F1 metrics as below. I would like to know how to pass the beta parameter whose default is set at 1 at the moment.

glm_workflow %>%
  fit_resamples(resamples = trainDatFolds,
                metrics = metric_set(roc_auc, pr_auc,
                                     accuracy, f_meas),
                control = control_resamples(save_pred = TRUE) %>%
  collect_metrics()

Thanks a lot!

Zarni

1

There are 1 answers

0
topepo On

You'll need a simple wrapper for the metric. See ?metric_set. The examples include one where the ccc() function is used with an argument.