ccHBGF

Contents

ccHBGF#

ccHBGF.ccHBGF(clustering_matrix: ndarray[tuple[int, ...], dtype[_ScalarType_co]], n_clusters: int | None = None, tol: float = 0.1, init: Literal['orthogonal', 'kmeans++'] = 'orthogonal', random_state: int | RandomState | Generator | None = None, verbose: bool = False) ndarray[tuple[int, ...], dtype[_ScalarType_co]][source]#

Perform consensus clustering using Hybrid Bipartite Graph Formulation (HBGF).

This function performs consensus clustering on a clustering_matrix, which is a 2D array where each column represents a clustering solution and each row represents an element being clustered. It constructs a bipartite graph with vertices representing the clusters and elements, and then partitions the graph using spectral partitioning to generate final cluster labels.

Parameters:
  • clustering_matrix (ndarray) – A 2D array where each column represents a clustering solution, and each row represents an element being clustered.

  • n_clusters (int, optional) – The number of clusters. If not provided, the function automatically detects the number of clusters.

  • tol (float, optional) – The tolerance for scipy.sparse.linalg.svds(), where 0 is machine precision.

  • init ({'orthogonal', 'kmeans++'}, optional) – Method for initializing KMeans centers. Default is ‘orthogonal’.

  • random_state ({int, numpy.random.Generator, numpy.random.RandomState}, optional) – Controls the randomness of the algorithm for reproducibility. Default is None.

  • verbose (bool, optional) – Whether to print verbose output during processing. Default is False.

Returns:

A 1D array of consensus clustering labels for the elements.

Return type:

ndarray