Default Metric Sets with {healthyR.ai}

code
rtip
healthyrai
Author

Steven P. Sanderson II, MPH

Published

November 28, 2022

Introduction

When modeling it is always good to understand your model performance against some metric The {tidymodels} package {yardstick} is a great resource for this.

In my R package {healthyR.ai} there are two functions that allow you to either minimize or maximize some cost function against your modeling problem.

These functions are: * hai_default_regression_metric_set() * hai_default_classification_metric_set()

Function

The functions themselves are {yardstick} metric set functions. Let’s take a look at them.

library(healthyR.ai)

hai_default_classification_metric_set()
# A tibble: 11 × 3
   metric       class        direction
   <chr>        <chr>        <chr>    
 1 sensitivity  class_metric maximize 
 2 specificity  class_metric maximize 
 3 recall       class_metric maximize 
 4 precision    class_metric maximize 
 5 mcc          class_metric maximize 
 6 accuracy     class_metric maximize 
 7 f_meas       class_metric maximize 
 8 kap          class_metric maximize 
 9 ppv          class_metric maximize 
10 npv          class_metric maximize 
11 bal_accuracy class_metric maximize 
hai_default_regression_metric_set()
# A tibble: 6 × 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 

Voila!