Skip to contents

Select the best configuration from a tuning table

Usage

select_best_from_grid(
  tuning_df,
  selection_metric = c("euclid", "rmse", "r2", "rpiq")
)

Arguments

tuning_df

Data frame containing RMSE_val, R2_val, and RPIQ_val.

selection_metric

One of: "euclid", "rmse", "r2", "rpiq".

Value

List with best (one-row data frame) and best_score.

Examples

tuning_df <- data.frame(
  cfg_id   = 1:3,
  RMSE_val = c(0.5, 0.3, 0.4),
  R2_val   = c(0.8, 0.9, 0.85),
  RPIQ_val = c(2.0, 3.0, 2.5)
)
best <- select_best_from_grid(tuning_df, selection_metric = "rmse")
best$best
#>   cfg_id RMSE_val R2_val RPIQ_val
#> 2      2      0.3    0.9        3