Base class for clustering algorithms and related evaluation utilities.
clusterer()returns a clusterer object
The object stores shared state and defaults used by clustering methods. Current algorithms may still differ in how much they use this state, but the goal is to standardize future implementations around:
fit() learning and storing model state
cluster() producing labels from a fitted model
configurable internal/external metrics and selection helpers via cluutils()
The base defaults are intentionally generic:
metric = metric_wcss()
eval_internal = list(metric_wcss)
eval_external = list(metric_entropy)
These defaults provide a common contract for simple partition-based clustering, but they are not imposed on all subclasses. Concrete clustering methods can replace them when another metric is more faithful to the algorithm. For example, centroid and medoid methods often prefer separation-based indices such as silhouette, density-based methods may prefer counting noise points, mixture models naturally expose log-likelihood, and graph community detection is better described by modularity.
Therefore, users should treat the clusterer() defaults as a shared fallback,
not as the final evaluation policy for every cluster_* implementation.
#See ?cluster_kmeans for an example of transformation
Run the code above in your browser using DataLab