Skip to contents

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

The predict method cuts the tree at the current k via protoclust::protocut() and assigns each new observation to the cluster of its nearest prototype, using the same distance method as during training. The model is therefore a list containing the fitted protoclust::protoclust() object, along with the training data and the arguments passed to stats::dist().

Custom mlr3 parameters

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\([0, \infty)\)
verblogicalFALSETRUE, FALSE-
kinteger-\([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.

See also

Other Learner: mlr_learners_clust.MBatchKMeans, mlr_learners_clust.SimpleKMeans, mlr_learners_clust.agnes, mlr_learners_clust.ap, mlr_learners_clust.bico, mlr_learners_clust.birch, mlr_learners_clust.clara, mlr_learners_clust.cmeans, mlr_learners_clust.cobweb, mlr_learners_clust.dbscan, mlr_learners_clust.dbscan_fpc, mlr_learners_clust.diana, mlr_learners_clust.em, mlr_learners_clust.fanny, mlr_learners_clust.featureless, mlr_learners_clust.ff, mlr_learners_clust.flexmix, mlr_learners_clust.genie, mlr_learners_clust.gmeans, mlr_learners_clust.hclust, mlr_learners_clust.hdbscan, mlr_learners_clust.kcca, mlr_learners_clust.kkmeans, mlr_learners_clust.kmeans, mlr_learners_clust.kmeans_rcpp, mlr_learners_clust.kmodes, mlr_learners_clust.kproto, mlr_learners_clust.mclust, mlr_learners_clust.meanshift, mlr_learners_clust.movMF, mlr_learners_clust.optics, mlr_learners_clust.pam, mlr_learners_clust.skmeans, mlr_learners_clust.som, mlr_learners_clust.specc, mlr_learners_clust.stdbscan, mlr_learners_clust.tclust, mlr_learners_clust.xmeans

Super classes

mlr3::Learner -> LearnerClust -> LearnerClustProtoclust

Active bindings

native_model

(protoclust)
The fitted model returned by protoclust::protoclust().

Methods

Inherited methods


LearnerClustProtoclust$new()

Creates a new instance of this R6 class.


LearnerClustProtoclust$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', predict_raw = 'FALSE'

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

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

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

# Make predictions for the task
prediction = learner$predict(task)

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