View source: R/cluster_diagnostics.R
| cluster_diagnostics | R Documentation |
Unified entry point for clustering quality information. Returns a
net_cluster_diagnostics object that normalises the diagnostic
surface across distance-based and model-based clusterings – you no
longer have to know which fields live on net_clustering vs.
net_mmm vs. the slim net_mmm_clustering attribute of a
netobject_group.
cluster_diagnostics(x, ...)
## S3 method for class 'net_cluster_diagnostics'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)
x |
A |
... |
Unsupported. Supplying unused arguments raises an error. |
row.names, optional |
Standard |
The returned object carries:
Either "distance" or "mmm".
Number of clusters, number of sequences, sizes vector.
A data.frame – one row per cluster, columns
differ by family. Distance: cluster, size,
pct, mean_within_dist, sil_mean. MMM:
cluster, size, pct, mix_pct,
avepp, class_err_pct.
A named list of family-specific summary metrics
(silhouette for distance; avepp_overall,
entropy, classification_error for MMM).
For MMM: a list with BIC, AIC, ICL.
NULL for distance.
Method / dissimilarity / weighted / lambda etc.
The original clustering object, kept by reference so
plot() can delegate without recomputing anything.
A net_cluster_diagnostics object.
print.net_cluster_diagnostics,
plot.net_cluster_diagnostics,
compare_mmm for k-sweep model selection (MMM only).
seqs <- data.frame(V1 = sample(c("A","B","C"), 30, TRUE),
V2 = sample(c("A","B","C"), 30, TRUE))
cl <- build_clusters(seqs, k = 2, method = "ward.D2")
cluster_diagnostics(cl)
grp <- cluster_mmm(seqs, k = 2, n_starts = 1, max_iter = 20, seed = 1)
cluster_diagnostics(grp)
as.data.frame(cluster_diagnostics(grp))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.