ml_agglomerative_cluster: Agglomerative Clustering

View source: R/clustering.R

ml_agglomerative_clusterR Documentation

Agglomerative Clustering

Description

Performs hierarchical agglomerative clustering on a numeric matrix.

Usage

ml_agglomerative_cluster(
  data,
  method = ml_linkage_method$Ward,
  metric = ml_distance_metric$Euclidean,
  use_mmap = FALSE,
  verbose = FALSE,
  n_threads = NULL
)

Arguments

data

A numeric matrix, or an mmap_matrix created by mem_matrix_from.

method

A value from ml_linkage_method (e.g. ml_linkage_method$Ward).

metric

A value from ml_distance_metric (e.g. ml_distance_metric$Euclidean). Default is Euclidean.

use_mmap

Whether to use memory mapping files for intermediate storage. Default is FALSE. Ignored when data is already an mmap_matrix (always TRUE).

verbose

Whether the backend prints its allocation line (the size of the distance matrix in RAM or in the memory-mapped file). Default is FALSE.

n_threads

Integer, the thread budget of the distance loops (NULL, the default: the library's default budget, trex_get_num_threads(), initially 1).

Value

A numeric matrix representing the computed hierarchical linkage.

References

R. Sibson, "SLINK: An Optimally Efficient Algorithm for the Single-Link Cluster Method," Comput. J., vol. 16, no. 1, pp. 30-34, 1973.

J.-P. Benzécri, "Construction d'une classification ascendante hiérarchique par la recherche en chaîne des voisins réciproques," Les Cahiers de l'Analyse des Données, vol. 7, no. 2, pp. 209-218, 1982.

J. Juan, "Programme de classification hiérarchique par l'algorithme de la recherche en chaîne des voisins réciproques," Les Cahiers de l'Analyse des Données, vol. 7, no. 2, pp. 219-225, 1982.

G. N. Lance and W. T. Williams, "A General Theory of Classificatory Sorting Strategies: I. Hierarchical Systems," Comput. J., vol. 9, pp. 373-380, 1967.

D. Müllner, "Modern Hierarchical, Agglomerative Clustering Algorithms," arXiv:1109.2378, 2011.

F. Murtagh and P. Contreras, "Algorithms for Hierarchical Clustering: An Overview," Wiley Interdiscip. Rev. Data Min. Knowl. Discov., vol. 2, no. 1, pp. 86-97, 2012, doi: 10.1002/widm.53.

F. Murtagh and P. Contreras, "Algorithms for Hierarchical Clustering: An Overview, II," Wiley Interdiscip. Rev. Data Min. Knowl. Discov., vol. 7, no. 6, Art. no. e1219, 2017, doi: 10.1002/widm.1219.

See Also

Other ML methods: MLElasticNet, MLElasticNetCV, MLLpNormScaler, MLPCA, MLRidge, MLRidgeCV, MLSVD, MLZScoreScaler, ml_cut_tree(), ml_distance_metric, ml_linkage_method

Examples

set.seed(1)
data <- matrix(rnorm(30), nrow = 10)
ml_agglomerative_cluster(data, method = ml_linkage_method$Ward)

TRexSelector documentation built on Nov. 20, 2026, 5:09 p.m.