Skip to contents

Hierarchical clustering using minimax linkage with prototypes. Calls protoclust::protoclust() from package protoclust.

Dictionary

This mlr3::Learner can be instantiated via the dictionary mlr3::mlr_learners or with the associated sugar function mlr3::lrn():

mlr_learners$get("clust.protoclust")
lrn("clust.protoclust")

Meta Information

  • Task type: “clust”

  • Predict Types: “partition”

  • Feature Types: “logical”, “integer”, “numeric”

  • Required Packages: mlr3, mlr3cluster, protoclust

Parameters

IdTypeDefaultLevelsRange
methodcharactereuclideaneuclidean, maximum, manhattan, canberra, binary, minkowski-
diaglogicalFALSETRUE, FALSE-
upperlogicalFALSETRUE, FALSE-
pnumeric2\((-\infty, \infty)\)
verblogicalFALSETRUE, FALSE-
kintegerNULL\([1, \infty)\)

References

Bien, Jacob, Tibshirani, Robert (2011). “Hierarchical Clustering with Prototypes via Minimax Linkage.” Journal of the American Statistical Association, 106(495), 1075–1084.

Super classes

mlr3::Learner -> mlr3cluster::LearnerClust -> LearnerClustProtoclust

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerClustProtoclust$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner and set parameter values
learner = lrn("clust.protoclust")
print(learner)
#> 
#> ── <LearnerClustProtoclust> (clust.protoclust): Prototype Hierarchical Clusterin
#> • Model: -
#> • Parameters: k=2
#> • Packages: mlr3, mlr3cluster, and protoclust
#> • Predict Types: [partition]
#> • Feature Types: logical, integer, and numeric
#> • Encapsulation: none (fallback: -)
#> • Properties: complete, exclusive, and hierarchical
#> • Other settings: use_weights = 'error'

# Define a Task
task = tsk("usarrests")

# Train the learner on the task
learner$train(task)

# Print the model
print(learner$model)
#> 
#> Call:
#> protoclust::protoclust(d = d)
#> 
#> Cluster method   : minimax 
#> Distance         : euclidean 
#> Number of objects: 50 
#> 

# Make predictions for the task
prediction = learner$predict(task)
#> Warning: 
#>  Learner 'clust.protoclust' doesn't predict on new data and predictions may
#>   not make sense on new data.
#> → Class: Mlr3WarningInput

# Score the predictions
prediction$score(task = task)
#> clust.dunn 
#>  0.1532626