spsanderson / healthyR.ai

healthyR.ai - AI package for the healthyverse
http://www.spsanderson.com/healthyR.ai/
Other
16 stars 6 forks source link

Enhancement `hai_default_regression_metric_set()` #220

Closed spsanderson closed 2 years ago

spsanderson commented 2 years ago

Create a default metric set function

Function:

hai_default_regression_metric_set <- function(){

  yardstick::metric_set(
    yardstick::mae,
    yardstick::mape,
    yardstick::mase,
    yardstick::smape,
    yardstick::rmse,
    yardstick::rsq
  )
}

Example:

> hai_default_regression_metric_set()
# A tibble: 6 x 3
  metric class          direction
  <chr>  <chr>          <chr>    
1 mae    numeric_metric minimize 
2 mape   numeric_metric minimize 
3 mase   numeric_metric minimize 
4 smape  numeric_metric minimize 
5 rmse   numeric_metric minimize 
6 rsq    numeric_metric maximize