This is the abstract base class for measures like MeasureClassif and MeasureRegr.

Measures are classes around tailored around two functions:

1. A function calculate which calculates the predictive performance of an Experiment by comparing true and predicted response.

2. A function aggregator which combines multiple performance values returned by calculate to a single numeric value.

In addition to these two functions, meta-information about the performance measure is stored.

Predefined measures are stored in mlr_measures.

## Format

R6::R6Class object.

## Construction

Note: This object is typically constructed via a derived classes, e.g. MeasureClassif or MeasureRegr.

m = Measure$new(id, task_type, range, minimize, predict_type = "response", task_properties = character(0L), na_score = FALSE, packages = character(0L))  • id :: character(1) Identifier for the measure. • task_type :: character(1) Type of the task the measure can operator on. E.g., "classif" or "regr". • range :: numeric(2) Feasible range for this measure as c(lower_bound, upper_bound). Both bounds may be infinite. • minimize :: logical(1) Set to TRUE if good predictions correspond to small values, and to FALSE if good predictions correspond to large values. If set to NA, tuning with this measure is not possible. • aggregator :: function(x) Function to aggregate individual performance values x where x is a numeric vector. If NULL, defaults to base::mean(). • predict_type :: character(1) Required predict type of the Learner. Possible values are stored in mlr_reflections$learner_predict_types.

• task_properties :: character()

• na_score :: logical(1)
Is the measure expected to return NA in some cases? Default is FALSE.

• packages :: character()
Set of required packages. Note that these packages will be loaded via requireNamespace(), and are not attached.

## Fields

• id :: character(1)
Identifier of the measure.

• minimize :: logical(1)
Is TRUE if the best value is reached via minimization and FALSE by maximization.

• packages :: character()
Stores the names of required packages.

• range :: numeric(2)
Stores the feasible range of the measure.

• task_type :: character(1)
Stores the required type of the Task.

• task_properties :: character()
Stores required properties of the Task.

## Methods

• aggregate(rr)
ResampleResult -> numeric(1)
Aggregates multiple performance scores into a single score using the aggregator function of the measure. Operates on a ResampleResult as returned by resample.

• calculate(experiment = NULL, prediction = experiment\$prediction)
(Experiment, Prediction) -> numeric(1)
Takes an Experiment and a Prediction (defaults to prediction stored in experiment), and calculates a numeric score.

Other Measure: MeasureClassif, MeasureRegr, mlr_measures