cl_pam: K-Medoids Partitions of Clusterings

View source: R/medoid.R

cl_pamR Documentation

K-Medoids Partitions of Clusterings

Description

Compute k-medoids partitions of clusterings.

Usage

cl_pam(x, k, method = "euclidean", solver = c("pam", "kmedoids"))

Arguments

x

an ensemble of partitions or hierarchies, or something coercible to that (see cl_ensemble).

k

an integer giving the number of classes to be used in the partition.

method

a character string or a function, as for argument method of function cl_dissimilarity.

solver

a character string indicating the k-medoids solver to be employed. May be abbreviated. If "pam" (default), the Partitioning Around Medoids \bibcitep|Kaufman+Rousseeuw:1990|Chapter 2 heuristic pam of package cluster is used. Otherwise, the exact algorithm of kmedoids is employed.

Details

An optimal k-medoids partition of the given cluster ensemble is defined as a partition of the objects x_i (the elements of the ensemble) into k classes C_1, \ldots, C_k such that the criterion function L = \sum_{l=1}^k \min_{j \in C_l} \sum_{i \in C_l} d(x_i, x_j) is minimized.

Such secondary partitions \bibcitepe.g.|Gordon+Vichi:1998| are obtained by computing the dissimilarities d of the objects in the ensemble for the given dissimilarity method, and applying a dissimilarity-based k-medoids solver to d.

Value

An object of class "cl_pam" representing the obtained “secondary” partition, which is a list with the following components.

cluster

the class ids of the partition.

medoid_ids

the indices of the medoids.

prototypes

a cluster ensemble with the k prototypes (medoids).

criterion

the value of the criterion function of the partition.

description

a character string indicating the dissimilarity method employed.

References

\bibshow

Kaufman+Rousseeuw:1990, Gordon+Vichi:1998

See Also

cl_pclust for more general prototype-based partitions of clusterings.

Examples

data("Kinship82")
party <- cl_pam(Kinship82, 3, "symdiff")
## Compare results with tables 5 and 6 in Gordon & Vichi (1998).
party
lapply(cl_prototypes(party), cl_classes)
table(cl_class_ids(party))

clue documentation built on Feb. 18, 2026, 5:06 p.m.