Skip to contents

A LearnerClust for agglomerative hierarchical clustering implemented in cluster::agnes(). The predict method uses stats::cutree() which cuts the tree resulting from hierarchical clustering into specified number of groups (see parameter k). The default number for k is 2.

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.agnes")
lrn("clust.agnes")

Meta Information

  • Task type: “clust”

  • Predict Types: “partition”

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

  • Required Packages: mlr3, mlr3cluster, cluster

Parameters

IdTypeDefaultLevelsRange
metriccharactereuclideaneuclidean, manhattan-
standlogicalFALSETRUE, FALSE-
methodcharacteraverageaverage, single, complete, ward, weighted, flexible, gaverage-
trace.levinteger0\([0, \infty)\)
kinteger2\([1, \infty)\)
par.methoduntyped--

References

Kaufman, Leonard, Rousseeuw, J P (2009). Finding groups in data: an introduction to cluster analysis. John Wiley & Sons.

Super classes

mlr3::Learner -> mlr3cluster::LearnerClust -> LearnerClustAgnes

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerClustAgnes$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (requireNamespace("cluster")) {
  learner = mlr3::lrn("clust.agnes")
  print(learner)

  # available parameters:
  learner$param_set$ids()
}
#> <LearnerClustAgnes:clust.agnes>: Agglomerative Hierarchical Clustering
#> * Model: -
#> * Parameters: k=2
#> * Packages: mlr3, mlr3cluster, cluster
#> * Predict Types:  [partition]
#> * Feature Types: logical, integer, numeric
#> * Properties: complete, exclusive, hierarchical
#> [1] "metric"     "stand"      "method"     "trace.lev"  "k"         
#> [6] "par.method"