Skip to content

Conversation

EmilHvitfeldt
Copy link
Member

to close #536

library(yardstick)
library(dplyr)

data(hpc_cv)

# Making outcome ordered
hpc_cv$obs <- as.ordered(hpc_cv$obs)

cls_mtr <- metric_set(ranked_prob_score, brier_class, kap, roc_auc)
cls_mtr(hpc_cv, obs, VF:L, estimate = pred)
#> # A tibble: 4 × 3
#>   .metric           .estimator .estimate
#>   <chr>             <chr>          <dbl>
#> 1 kap               multiclass    0.508 
#> 2 ranked_prob_score multiclass    0.0857
#> 3 brier_class       multiclass    0.211 
#> 4 roc_auc           hand_till     0.829

Created on 2025-03-11 with reprex v2.1.1

Copy link
Member

@topepo topepo left a comment

Choose a reason for hiding this comment

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

Looks great (and air formatting).

Can you add to the news file?

@EmilHvitfeldt
Copy link
Member Author

done

@EmilHvitfeldt EmilHvitfeldt merged commit 1dbbdfe into main Mar 12, 2025
14 checks passed
@EmilHvitfeldt EmilHvitfeldt deleted the ordered-metrics-in-matric-sets branch March 12, 2025 15:55
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 this pull request may close these issues.

allow mixing of metrics for ordered and unordered factors
2 participants