This is the abstract base class for measures like MeasureClassif and MeasureRegr.
Measures are classes around tailored around two functions:
score which quantifies the performance by comparing true and predicted response.
aggregator which combines multiple performance scores returned by
calculate to a single numeric value.
In addition to these two functions, meta-information about the performance measure is stored.
Note: This object is typically constructed via a derived classes, e.g. MeasureClassif or MeasureRegr.
Identifier for the measure.
Type of the task the measure can operator on. E.g.,
Feasible range for this measure as
Both bounds may be infinite.
TRUE if good predictions correspond to small values,
FALSE if good predictions correspond to large values.
If set to
NA (default), tuning this measure is not possible.
Function to aggregate individual performance scores
x is a numeric vector.
NULL, defaults to
Properties of the measure. Must be a subset of mlr_reflections$measure_properties. Supported by
"requires_task" (requires the complete Task),
"requires_learner" (requires the trained Learner),
"requires_train_set" (requires the training indices from the Resampling), and
"na_score" (the measure is expected to occasionally return
Required predict type of the Learner. Possible values are stored in mlr_reflections$learner_predict_types.
Prediction sets to operate on, used in
aggregate() to extract the matching
predict_sets from the ResampleResult.
Multiple predict sets are calculated by the respective Learner during
Must be a non-empty subset of
If multiple sets are provided, these are first combined to a single prediction object.
Required task properties, see Task.
Set of required packages. Note that these packages will be loaded via
requireNamespace(), and are not attached.
All variables passed to the constructor.
Aggregates multiple performance scores into a single score using the
aggregator function of the measure.
Operates on the Predictions of ResampleResult with matching
score(prediction, task = NULL, learner = NULL, train_set = NULL)
((named list of) Prediction, Task, Learner,
Takes a Prediction (or a list of Prediction objects named with valid
and calculates a numeric score.
If the measure if flagged with the properties
"requires_train_set", you must additionally
pass the respective Task, the trained Learner or the training set indices.
This is handled internally during
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.