Skip to contents

Estimate an appropriate number of clusters for hypergraph spectral clustering using the eigengap heuristic.

Usage

suggest_k(psych_hg, max_K = 10, weighted_l = FALSE, ...)

Arguments

psych_hg

A psychHypergraph object.

max_K

Maximum number of clusters to evaluate.

weighted_l

Logical; whether to use a weighted incidence matrix.

...

Additional arguments.

Value

A list containing:

suggested_K

Recommended number of clusters.

eigenvalues

Evaluated eigenvalues.

eigengaps

Consecutive eigenvalue differences.

eigenvalues_all

Full eigenvalue spectrum.

Details

The method computes Laplacian eigenvalues and identifies the largest gap between consecutive eigenvalues.

A large eigengap indicates a natural partition of the hypergraph into communities.

Let \(\lambda_1 \le \lambda_2 \le \cdots\) denote Laplacian eigenvalues.

The eigengap for cluster number \(k\) is:

$$ gap_k = \lambda_{k+1} - \lambda_k $$

The suggested number of clusters corresponds to the largest observed eigengap.

Examples

if (FALSE) { # \dontrun{

suggest_k(hg)

k_info <- suggest_k(
  hg,
  max_K = 8
)

k_info$suggested_K

} # }