Environment which stores various information to allow objects to examine and introspect their structure and properties (c.f. Reflections).
This environment be modified by third-party packages, e.g. by adding information about new task types or by extending the set of allowed feature types.
Third-party packages that modify the reflections must register themselves in the loaded_packages
field.
The following objects are set by mlr3:
task_types
(data.table()
)
Table with task type ("type"
), the implementing package ("pkg"
), and the names of the generators of the corresponding Task ("task"
), Learner ("learner"
), Prediction ("prediction"
), Measure ("measure"
) and fallback Learner.task_feature_types
(namedcharacter()
)
Vector of base R types supported as Task features, named with a 3 letter abbreviation.task_row_roles
(character()
)
Vector of supported row roles for a Task.task_col_roles
(list ofcharacter()
)
List of vectors of supported column roles for a Task, named by their task type.task_properties
(list ofcharacter()
)
List of vectors of supported Task properties, named by their task type.task_mandatory_properties
(list ofcharacter()
)
List of vectors of Task properties which necessarily must be supported by the Learner. I.e., if the task property is not found in the set of the learner properties, an exception is raised.task_print_col_roles
(list of namedcharacter()
)
Vector of column roles to print viaprint(task)
if the role is not empty, either before or after the task's target, properties and features. The names of the column roles are the values, the names correspond to the labels to use in the printer.learner_properties
(list ofcharacter()
)
List of vectors of supported Learner properties, named by their task type.learner_predict_types
(list of list ofcharacter()
)
List of lists of supported Learner predict_types, named by their task type. The inner list translates the"predict_type"
to all predict types returned, e.g. predict type"prob"
for a LearnerClassif provides the probabilities as well as the predicted labels, therefore"prob"
maps toc("response", "prob")
.learner_predict_types
(list of list ofcharacter()
)
List of lists of supported Learner predict_types, named by their task type.learner_param_tags
(character()
)
Character vector of allowed 'tags' for the paradox::ParamSets of a Learner.predict_sets
(character()
)
Vector of possible predict sets. Currently supported are"train"
,"test"
and"holdout"
.measure_properties
(list ofcharacter()
)
List of vectors of supported Measure properties, named by their task type.default_measures
(list ofcharacter()
)
List of keys for the default Measures, named by their task type.rr_names
(character()
)
Names of the objects stored in a ResampleResult.auto_converters
(environment()
)
Environment of converter functions used forrbind
-ing data to tasks. Functions are named using the pattern"[from_type]___[to_type]"
. Can be extended by third-party with additional converters.
Examples
ls.str(mlr_reflections)
#> auto_converters : <environment: 0x564e379359c8>
#> default_measures : List of 3
#> $ classif : chr "classif.ce"
#> $ regr : chr "regr.mse"
#> $ unsupervised: chr NA
#> learner_param_tags : chr [1:7] "train" "predict" "hotstart" "importance" "threads" "required" ...
#> learner_predict_types : List of 2
#> $ classif:List of 2
#> $ regr :List of 4
#> learner_properties : List of 2
#> $ classif: chr [1:13] "featureless" "missings" "weights" "importance" ...
#> $ regr : chr [1:11] "featureless" "missings" "weights" "importance" ...
#> loaded_packages : chr "mlr3"
#> loggers : List of 1
#> $ mlr3:Classes 'Logger', 'Filterable', 'R6' <Logger> [warn] mlr3 inherited appenders: console: <AppenderConsole> [all] -> console
#> measure_properties : List of 2
#> $ classif: chr [1:7] "na_score" "requires_task" "requires_learner" "requires_model" ...
#> $ regr : chr [1:7] "na_score" "requires_task" "requires_learner" "requires_model" ...
#> package_version : Classes 'package_version', 'numeric_version' hidden list of 1
#> $ : int [1:4] 0 21 1 9000
#> predict_sets : chr [1:3] "train" "test" "internal_valid"
#> rr_names : chr [1:4] "task" "learner" "resampling" "iteration"
#> task_col_roles : List of 3
#> $ regr : chr [1:7] "feature" "target" "name" "order" ...
#> $ classif : chr [1:7] "feature" "target" "name" "order" ...
#> $ unsupervised: chr [1:3] "feature" "name" "order"
#> task_feature_types : Named chr [1:7] "logical" "integer" "numeric" "character" "factor" ...
#> task_mandatory_properties : List of 1
#> $ classif: chr [1:2] "twoclass" "multiclass"
#> task_print_col_roles : List of 2
#> $ before: chr(0)
#> $ after : Named chr [1:4] "order" "stratum" "group" "weight"
#> task_properties : List of 3
#> $ classif : chr [1:5] "strata" "groups" "weights" "twoclass" ...
#> $ regr : chr [1:3] "strata" "groups" "weights"
#> $ unsupervised: chr(0)
#> task_row_roles : chr "use"
#> task_types : Classes ‘data.table’ and 'data.frame': 3 obs. of 7 variables:
#> $ type : chr "classif" "regr" "unsupervised"
#> $ package : chr "mlr3" "mlr3" "mlr3"
#> $ task : chr "TaskClassif" "TaskRegr" "TaskUnsupervised"
#> $ learner : chr "LearnerClassif" "LearnerRegr" "Learner"
#> $ prediction : chr "PredictionClassif" "PredictionRegr" NA
#> $ prediction_data: chr "PredictionDataClassif" "PredictionDataRegr" NA
#> $ measure : chr "MeasureClassif" "MeasureRegr" NA