View source: R/utils_metrics.R
metric | R Documentation |
Returns a metric function which can be used for the experiments (especially the cross-validation experiments) to compute the performance.
metric(name)
name |
A metric name. Accepted names are the names of the metric
function exported from the |
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.
Returns a function that can be used as function to calculate the performance metric throughout the experiments.
metric("auc")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.