Learn R Programming

bootcluster (version 0.4.2)

ensemble.cluster.multi: Multi-Method Ensemble Clustering with Graph-based Consensus

Description

Implements ensemble clustering by combining multiple clustering methods (k-means, hierarchical, and spectral clustering) using a graph-based consensus approach.

Usage

ensemble.cluster.multi(
  x,
  k_km,
  k_hc,
  k_sc,
  n_ref = 3,
  B = 100,
  hc.method = "ward.D",
  dist_method = "euclidean"
)

Value

A list containing:

membership

Final cluster assignments from ensemble consensus

k_consensus

Number of clusters found in consensus

individual_results

List of results from individual clustering methods

stability_measures

Stability measures for each method

graph

igraph object of the ensemble graph

Arguments

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")

Details

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

Examples

Run this code
# \donttest{
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)
# }

Run the code above in your browser using DataLab