| LearnerClust | R Documentation |
This Learner specializes mlr3::Learner for cluster problems:
task_type is set to "clust".
Creates mlr3::Predictions of class PredictionClust.
Possible values for predict_types are:
"partition": Integer indicating the cluster membership.
"prob": Probability for belonging to each cluster.
Additional learner properties include:
"exclusive": The method natively assigns each observation to exactly one cluster.
"overlapping": The method natively assigns observations to multiple clusters.
"fuzzy": The method natively produces soft cluster memberships, e.g. fuzzy or probabilistic model-based
methods. The hard partition is derived from the memberships.
"complete": Every observation is assigned to a cluster.
"partial": Observations may be left unassigned, e.g. as noise points.
"partitional": The method divides the data into non-nested clusters.
"hierarchical": The method produces a nested hierarchy of clusters.
"density": The method finds clusters as dense regions in the feature space.
These properties describe the nature of the underlying method, not its interface capabilities: whether a learner
can return soft memberships is encoded by the "prob" predict type, which "exclusive" learners may also
support via derived scores.
Predefined learners can be found in the mlr3misc::Dictionary mlr3::mlr_learners.
mlr3::Learner -> LearnerClust
assignments(NULL | vector())
Cluster assignments from learned model.
save_assignments(logical(1))
Should assignments for 'train' data be saved in the learner?
Default is TRUE.
LearnerClust$new()Creates a new instance of this R6 class.
LearnerClust$new( id, param_set = ps(), predict_types = "partition", feature_types = character(), properties = character(), packages = character(), label = NA_character_, man = NA_character_ )
id(character(1))
Identifier for the new instance.
param_set(paradox::ParamSet)
Set of hyperparameters.
predict_types(character())
Supported predict types. Must be a subset of mlr_reflections$learner_predict_types.
feature_types(character())
Feature types the learner operates on. Must be a subset of mlr_reflections$task_feature_types.
properties(character())
Set of properties of the mlr3::Learner.
Must be a subset of mlr_reflections$learner_properties.
The following properties are currently standardized and understood by learners in mlr3:
"missings": The learner can handle missing values in the data.
"weights": The learner supports observation weights.
"offset": The learner can incorporate offset values to adjust predictions.
"importance": The learner supports extraction of importance scores, i.e. comes with an $importance() extractor function (see section on optional extractors in mlr3::Learner).
"selected_features": The learner supports extraction of the set of selected features, i.e. comes with a $selected_features() extractor function (see section on optional extractors in mlr3::Learner).
"oob_error": The learner supports extraction of estimated out of bag error, i.e. comes with a oob_error() extractor function (see section on optional extractors in mlr3::Learner).
"validation": The learner can use a validation task during training.
"internal_tuning": The learner is able to internally optimize hyperparameters (those are also tagged with "internal_tuning").
"marshal": To save learners with this property, you need to call $marshal() first.
If a learner is in a marshaled state, you call first need to call $unmarshal() to use its model, e.g. for prediction.
"hotstart_forward": The learner supports to hotstart a model forward.
"hotstart_backward": The learner supports hotstarting a model backward.
"featureless": The learner does not use features.
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 via requireNamespace().
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().
LearnerClust$reset()Reset assignments field before calling parent's reset().
LearnerClust$reset()
LearnerClust$clone()The objects of this class are cloneable with this method.
LearnerClust$clone(deep = FALSE)
deepWhether to make a deep clone.
library(mlr3)
library(mlr3cluster)
ids = mlr_learners$keys("^clust")
ids
# get a specific learner from mlr_learners:
learner = lrn("clust.kmeans")
print(learner)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.