nugget_cluster: Data-nugget clustering

View source: R/nugget-clustering.R

nugget_clusterR Documentation

Data-nugget clustering

Description

Cluster a (potentially large) data set by first compressing its observations into weighted data nuggets (create_data_nuggets), clustering the nugget centres with a weighted clusterer, and mapping the nugget labels back to the original observations. This is the clustering analogue of the data-nugget weighting used by M_ABC and follows DN.Wkmeans / DN.Whclust from the WCluster package.

Usage

nugget_cluster(
  data,
  k,
  method = c("kmeans", "ward"),
  max_nuggets = NULL,
  nugget_args = list()
)

Arguments

data

A numeric matrix (objects in rows) or a precomputed create_data_nuggets{data_nugget} object. For multi-source data, column-bind the per-source matrices first (the direct/ADC strategy) or pass a single fused matrix.

k

Number of clusters.

method

Weighted clusterer for the nugget centres: "kmeans" (WWCSS) or "ward" (weighted Ward).

max_nuggets, nugget_args

Passed to create_data_nuggets when data is a raw matrix.

Value

A list of class "nugget_cluster" with cluster (labels for the original objects), nugget_cluster (labels for the nuggets) and the nuggets object.

References

Cherasia et al. (2023); Dey et al. (2025), WCluster.

See Also

create_data_nuggets, Wkmeans

Examples

data(mosaic_toy)
X <- do.call(cbind, mosaic_toy$List)        # fuse sources (objects in rows)
fit <- nugget_cluster(X, k = 3, max_nuggets = 30)
table(fit$cluster)

MosaiClusteR documentation built on Oct. 25, 2026, 1:08 a.m.