mlr3measures — MeasureSimple" />

The following measures from mlr3measures are interfaced using a simple utility class:

Binary classification (inheriting from MeasureClassif):

  • auc: Area Under the ROC Curve

  • dor: Diagnostic Odds Ratio

  • fbeta: F-beta score

  • fdr: False Discovery Rate

  • fn: False Negatives

  • fnr: False Negative Rate

  • fomr: False Omission Rate

  • fp: False Positives

  • fpr: False Positive Rate

  • mcc: Matthews Correlation Coefficient

  • npv: Negative Predictive Value

  • ppv: Positive Predictive Value

  • precision: Precision

  • recall: Recall

  • sensitivity: Sensitivity

  • specificity: Specificity

  • tn: True Negatives

  • tnr: True Negative Rate

  • tp: True Positives

  • tpr: True Positive Rate

Multiclass classification (inheriting from MeasureClassif):

  • acc: Classification Accuracy

  • ce: Classification Error

  • logloss: Log Loss

Regression (inheriting from MeasureRegr):

  • bias: Bias

  • ktau: Kendall's tau

  • mae: Mean Absolute Errors

  • mape: Mean Absolute Percent Error

  • maxae: Max Absolute Error

  • maxse: Max Squared Error

  • medae: Median Absolute Errors

  • medse: Median Squared Error

  • mse: Mean Squared Error

  • msle: Mean Squared Log Error

  • pbias: Percent Bias

  • rae: Relative Absolute Error

  • rmse: Root Mean Squared Error

  • rmsle: Root Mean Squared Log Error

  • rrse: Root Relative Squared Error

  • rse: Relative Squared Error

  • rsq: R Squared

  • sae: Sum of Absolute Errors

  • smape: Symmetric Mean Absolute Percent Error

  • srho: Spearman's rho

  • sse: Sum of Squared Errors

Details about the implementation of the respective measures can be found on the corresponding help page in mlr3measures. It is possible to customize the value of each measure which is returned if the measure is not defined for the input by setting the public field na_value to an arbitrary numeric(1) (default is NaN).

Format

R6::R6Class() inheriting from Measure.

Construction

The measures can be retrieved from the dictionary mlr_measures. With "<id>" being the name of the measure to construct:

mlr_measures$get("<id>")
msr("<id>")

See also

Dictionary of Measures: mlr_measures

as.data.table(mlr_measures) for a complete table of all (also dynamically created) Measure implementations.

Examples

mse = msr("regr.mse") print(mse)
#> <MeasureRegrSimple:regr.mse> #> * Packages: mlr3measures #> * Range: [0, Inf] #> * Minimize: TRUE #> * Properties: - #> * Predict type: response
# score prediction on mtcars task = tsk("mtcars") pred = lrn("regr.featureless")$train(task)$predict(task) mse$score(pred)
#> [1] 35.18897
# rae: not defined for constant truth pred = PredictionRegr$new(row_ids = 1:10, truth = rep(0, 10), response = runif(10)) rae = msr("regr.rae") rae$score(pred)
#> [1] NaN
# return worst possible value instead of NaN rae$na_value = rae$range[2] rae$score(pred)
#> [1] Inf