metric {mlexperiments}R Documentation

metric

Description

Returns a metric function which can be used for the experiments (especially the cross-validation experiments) to compute the performance.

Usage

metric(name)

Arguments

name

A metric name. Accepted names are the names of the metric function exported from the mlr3measures R package.

Details

This function is a utility function to select performance metrics from the mlr3measures R package and to reformat them into a form that is required by the mlexperiments R package. For mlexperiments it is required that a metric function takes the two arguments ground_truth, and predictions, as well as additional names arguments that are necessary to compute the performance, which are provided via the ellipsis argument (...). When using the performance metric with an experiment of class "MLCrossValidation", such arguments can be defined as a list provided to the field performance_metric_args of the R6 class. The main purpose of mlexperiments::metric() is convenience and to re-use already existing implementations of the metrics. However, custom functions can be provided easily to compute the performance of the experiments, simply by providing a function that takes the above mentioned arguments and returns one performance metric value.

Value

Returns a function that can be used as function to calculate the performance metric throughout the experiments.

Examples

metric("auc")


[Package mlexperiments version 0.0.4 Index]