select_metrics: Select metrics from a list of functions

View source: R/metrics.R

select_metricsR Documentation

Select metrics from a list of functions

Description

Helper function to return only the scoring rules selected by the user from a list of possible functions.

Usage

select_metrics(metrics, select = NULL, exclude = NULL)

Arguments

metrics

A list of scoring functions.

select

A character vector of scoring rules to select from the list. If select is NULL (the default), all possible scoring rules are returned.

exclude

A character vector of scoring rules to exclude from the list. If select is not NULL, this argument is ignored.

Value

A list of scoring functions.

Examples

select_metrics(
  metrics = get_metrics(example_binary),
  select = "brier_score"
)
select_metrics(
  metrics = get_metrics(example_binary),
  exclude = "log_score"
)

epiforecasts/scoringutils documentation built on Nov. 6, 2024, 8:49 a.m.