View source: R/ensemble_cluster_multi.R
ensemble.cluster.multi | R Documentation |
Implements ensemble clustering by combining multiple clustering methods (k-means, hierarchical, and spectral clustering) using a graph-based consensus approach.
ensemble.cluster.multi(
x,
k_km,
k_hc,
k_sc,
n_ref = 3,
B = 100,
hc.method = "ward.D",
dist_method = "euclidean"
)
x |
data.frame or matrix where rows are observations and columns are features |
k_km |
number of clusters for k-means clustering |
k_hc |
number of clusters for hierarchical clustering |
k_sc |
number of clusters for spectral clustering |
n_ref |
number of reference distributions for stability assessment (default: 3) |
B |
number of bootstrap samples for stability estimation (default: 100) |
hc.method |
hierarchical clustering method (default: "ward.D") |
dist_method |
distance method for spectral clustering (default: "euclidean") |
This function implements a multi-method ensemble clustering approach that: 1. Applies multiple clustering methods (k-means, hierarchical, spectral) 2. Assesses stability of each clustering through bootstrapping 3. Constructs a weighted bipartite graph representing all clusterings 4. Uses fast greedy community detection for final consensus
A list containing:
Final cluster assignments from ensemble consensus
Number of clusters found in consensus
List of results from individual clustering methods
Stability measures for each method
igraph object of the ensemble graph
data(iris)
df <- iris[,1:4]
result <- ensemble.cluster.multi(df, k_km=3, k_hc=3, k_sc=3)
plot(df[,1:2], col=result$membership, pch=16)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.