Helper function to return only the scoring rules selected by the user from a list of possible functions.
Examples
select_metrics(
metrics = get_metrics(example_binary),
select = "brier_score"
)
#> $brier_score
#> function (observed, predicted)
#> {
#> assert_input_binary(observed, predicted)
#> observed <- as.numeric(observed) - 1
#> brierscore <- (observed - predicted)^2
#> return(brierscore)
#> }
#> <bytecode: 0x56416acdd598>
#> <environment: namespace:scoringutils>
#>
select_metrics(
metrics = get_metrics(example_binary),
exclude = "log_score"
)
#> $brier_score
#> function (observed, predicted)
#> {
#> assert_input_binary(observed, predicted)
#> observed <- as.numeric(observed) - 1
#> brierscore <- (observed - predicted)^2
#> return(brierscore)
#> }
#> <bytecode: 0x56416acdd598>
#> <environment: namespace:scoringutils>
#>