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

metric_sets #30

Open
topepo opened this issue May 18, 2019 · 0 comments
Open

metric_sets #30

topepo opened this issue May 18, 2019 · 0 comments
Labels
feature a feature request or enhancement

Comments

@topepo
Copy link
Member

topepo commented May 18, 2019

yardstick will return multiple metrics in a stacked format. We should have an option to use this format directly.

library(tidymodels)
#> ── Attaching packages ──────────────────────────────────────────────────────────────────────────────────── tidymodels 0.0.2 ──
#> ✔ broom     0.5.1       ✔ purrr     0.3.2  
#> ✔ dials     0.0.2       ✔ recipes   0.1.5  
#> ✔ dplyr     0.8.0.1     ✔ rsample   0.0.4  
#> ✔ ggplot2   3.1.1       ✔ tibble    2.1.1  
#> ✔ infer     0.4.0       ✔ yardstick 0.0.2  
#> ✔ parsnip   0.0.2
#> ── Conflicts ─────────────────────────────────────────────────────────────────────────────────────── tidymodels_conflicts() ──
#> ✖ purrr::discard() masks scales::discard()
#> ✖ dplyr::filter()  masks stats::filter()
#> ✖ dplyr::lag()     masks stats::lag()
#> ✖ recipes::step()  masks stats::step()

# Multiple regression metrics
multi_metric <- metric_set(rmse, rsq, ccc)

# The returned function has arguments:
# fn(data, truth, estimate, na_rm = TRUE, ...)
multi_metric(solubility_test, truth = solubility, estimate = prediction)
#> # A tibble: 3 x 3
#>   .metric .estimator .estimate
#>   <chr>   <chr>          <dbl>
#> 1 rmse    standard       0.722
#> 2 rsq     standard       0.879
#> 3 ccc     standard       0.934

Created on 2019-05-18 by the reprex package (v0.2.1)

@topepo topepo added the feature a feature request or enhancement label Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant