Skip to contents

Calculates the cross-entropy, or negative log-likelihood (NLL) or logarithmic (log), loss.

Details

The Log Loss, in the context of probabilistic predictions, is defined as the negative log probability density function, \(f\), evaluated at the observation time (event or censoring), \(t\), $$L_{NLL}(f, t) = -log(f(t))$$

The standard error of the Log Loss, L, is approximated via, $$se(L) = sd(L)/\sqrt{N}$$ where \(N\) are the number of observations in the test set, and \(sd\) is the standard deviation.

The Re-weighted Negative Log-Likelihood (RNLL) or IPCW Log Loss is defined by $$L_{RNLL}(f, t, \Delta) = -\Delta log(f(t))/G(t)$$ where \(\Delta\) is the censoring indicator and G is the Kaplan-Meier estimator of the censoring distribution. So only observations that have experienced the event are taking into account for RNLL and both \(f(t), G(t)\) are calculated only at the event times. If only censored observations exist in the test set, NaN is returned.

If task and train_set are passed to $score then G is fit on training data, otherwise testing data. The first is likely to reduce any bias caused by calculating parts of the measure on the test data it is evaluating. The training data is automatically used in scoring resamplings.

Dictionary

This Measure can be instantiated via the dictionary mlr_measures or with the associated sugar function msr():

MeasureSurvLogloss$new()
mlr_measures$get("surv.logloss")
msr("surv.logloss")

Parameters

IdTypeDefaultLevelsRange
epsnumeric1e-15\([0, 1]\)
selogicalFALSETRUE, FALSE-
IPCWlogicalTRUETRUE, FALSE-
ERVlogicalFALSETRUE, FALSE-

Meta Information

  • Type: "surv"

  • Range: \([0, \infty)\)

  • Minimize: TRUE

  • Required prediction: distr

Parameter details

  • eps (numeric(1))
    Very small number to substitute zero values in order to prevent errors in e.g. log(0) and/or division-by-zero calculations. Default value is 1e-15.

  • se (logical(1))
    If TRUE then returns standard error of the measure otherwise returns the mean across all individual scores, e.g. the mean of the per observation scores. Default is FALSE (returns the mean).

  • ERV (logical(1))
    If TRUE then the Explained Residual Variation method is applied, which means the score is standardized against a Kaplan-Meier baseline. Default is FALSE.

  • IPCW (logical(1))
    If TRUE (default) then returns the \(L_{RNLL}\) score (which is proper), otherwise the \(L_{NLL}\) score (improper).

Super classes

mlr3::Measure -> mlr3proba::MeasureSurv -> MeasureSurvLogloss

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage

MeasureSurvLogloss$new(ERV = FALSE)

Arguments

ERV

(logical(1))
Standardize measure against a Kaplan-Meier baseline (Explained Residual Variation)


Method clone()

The objects of this class are cloneable with this method.

Usage

MeasureSurvLogloss$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.