This measure specializes Measure for survival problems.
task_type
is set to"surv"
.Possible values for
predict_type
are"distr"
,"lp"
,"crank"
, and"response"
.
Predefined measures can be found in the dictionary mlr3::mlr_measures.
See also
Default survival measure: surv.cindex
Other Measure:
MeasureDens
Super class
mlr3::Measure
-> MeasureSurv
Methods
Method new()
Creates a new instance of this R6 class.
Usage
MeasureSurv$new(
id,
param_set = ps(),
range,
minimize = NA,
average = "macro",
aggregator = NULL,
obs_loss = NULL,
properties = character(),
predict_type = "distr",
predict_sets = "test",
task_properties = character(),
packages = character(),
label = NA_character_,
man = NA_character_,
trafo = NULL
)
Arguments
id
(
character(1)
)
Identifier for the new instance.param_set
(paradox::ParamSet)
Set of hyperparameters.range
(
numeric(2)
)
Feasible range for this measure asc(lower_bound, upper_bound)
. Both bounds may be infinite.minimize
(
logical(1)
)
Set toTRUE
if good predictions correspond to small values, and toFALSE
if good predictions correspond to large values. If set toNA
(default), tuning this measure is not possible.average
(
character(1)
)
How to average multiple Predictions from a ResampleResult.The default,
"macro"
, calculates the individual performances scores for each Prediction and then uses the function defined in$aggregator
to average them to a single number.If set to
"micro"
, the individual Prediction objects are first combined into a single new Prediction object which is then used to assess the performance. The function in$aggregator
is not used in this case.aggregator
(
function(x)
)
Function to aggregate individual performance scoresx
wherex
is a numeric vector. IfNULL
, defaults tomean()
.obs_loss
(
function
orNULL
)
The observation-wise loss function, e.g. zero-one for classification error.properties
(
character()
)
Properties of the measure. Must be a subset of mlr_reflections$measure_properties. Supported bymlr3
:"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 returnNA
orNaN
).
predict_type
(
character(1)
)
Required predict type of the Learner. Possible values are stored in mlr_reflections$learner_predict_types.predict_sets
(
character()
)
Prediction sets to operate on, used inaggregate()
to extract the matchingpredict_sets
from the ResampleResult. Multiple predict sets are calculated by the respective Learner duringresample()
/benchmark()
. Must be a non-empty subset of{"train", "test"}
. If multiple sets are provided, these are first combined to a single prediction object. Default is"test"
.task_properties
(
character()
)
Required task properties, see Task.packages
(
character()
)
Set of required packages. A warning is signaled by the constructor if at least one of the packages is not installed, but loaded (not attached) later on-demand viarequireNamespace()
.label
(
character(1)
)
Label for the new instance.man
(
character(1)
)
String in the format[pkg]::[topic]
pointing to a manual page for this object. The referenced help package can be opened via method$help()
.trafo
(
list()
orNULL
)
An optional list with two elements, containing the transformation"fn"
and its derivative"deriv"
. The transformation function is the function that is applied after aggregating the pointwise losses, i.e. this requires an$obs_loss
to be present. An example issqrt
for RMSE (regression).