This measure specializes mlr3::Measure for cluster analysis:
task_typeis set to"clust".Possible values for
predict_typeare"partition"and"prob".
Predefined measures can be found in the mlr3misc::Dictionary mlr3::mlr_measures.
See also
Example cluster measures: clust.dunn
Super class
mlr3::Measure -> MeasureClust
Methods
MeasureClust$new()
Creates a new instance of this R6 class.
Usage
MeasureClust$new(
id,
param_set = ps(),
range,
minimize = NA,
average = "macro",
aggregator = NULL,
properties = character(),
predict_type = "partition",
predict_sets = "test",
task_properties = character(),
packages = character(),
label = NA_character_,
man = NA_character_
)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 toTRUEif good predictions correspond to small values, and toFALSEif good predictions correspond to large values. If set toNA(default), tuning this measure is not possible.average(
character(1))
How to average multiple mlr3::Predictions from a ResampleResult.The default,
"macro", calculates the individual performances scores for each mlr3::Prediction and then uses the function defined in$aggregatorto average them to a single number."macro_weighted"is similar to"macro", but uses weighted averages. Weights are taken from theweights_measurecolumn of the resampled mlr3::Task if present. Note that"macro_weighted"can differ from"macro"even if no weights are present or if$use_weightsis set to"ignore", since then aggregation is done using uniform sample weights, which result in non-uniform weights for mlr3::Predictions if they contain different numbers of samples.If set to
"micro", the individual mlr3::Prediction objects are first combined into a single new mlr3::Prediction object which is then used to assess the performance. The function in$aggregatoris not used in this case.aggregator(
function()|NULL)
Function to aggregate over multiple iterations. The role of this function depends on the value of field"average":"macro": A numeric vector of scores (one per iteration) is passed. The aggregate function defaults tomean()in this case."micro": Theaggregatorfunction is not used. Instead, predictions from multiple iterations are first combined and then scored in one go."custom": A ResampleResult is passed to the aggregate function.
properties(
character())
Properties of the measure. Must be a subset of mlr_reflections$measure_properties. Supported bymlr3:"requires_task"(requires the complete mlr3::Task),"requires_learner"(requires the trained mlr3::Learner),"requires_model"(requires the trained mlr3::Learner, including the fitted model),"requires_train_set"(requires the training indices from the mlr3::Resampling),"na_score"(the measure is expected to occasionally returnNAorNaN),"weights"(support weighted scoring using sample weights from task, column roleweights_measure),"primary_iters"(the measure explicitly handles resamplings that only use a subset of their iterations for the point estimate), and"requires_no_prediction"(No prediction is required; This usually means that the measure extracts some information from the learner state.).
predict_type(
character(1))
Required predict type of the mlr3::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_setsfrom the ResampleResult. Multiple predict sets are calculated by the respective mlr3::Learner duringresample()/benchmark(). Must be a non-empty subset of{"train", "test", "internal_valid"}. If multiple sets are provided, these are first combined to a single prediction object. Default is"test".task_properties(
character())
Required task properties, see mlr3::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().