๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Hy-SCยถ

Submodulesยถ

hypergraphx.communities.hy_sc.model moduleยถ

class hypergraphx.communities.hy_sc.model.HySC(seed=0, inf=1e+40, n_realizations=10, out_inference=False, out_folder='../data/output/', end_file='_sc.dat')[source]ยถ

Bases: object

Implementation of Hypergraph Spectral Clustering from โ€œLearning with hypergraphs: Clustering, classification, and embeddingโ€, Zhou D., Huang J., Schรถlkopf B.

apply_kmeans(X, seed=10)[source]ยถ

Apply K-means algorithm to the eigenvectors of the Laplacian matrix.

Parameters:
  • X (matrix with eigenvectors.)

  • seed (random seed.)

Returns:

X_pred

Return type:

membership matrix.

extract_eigenvectors()[source]ยถ

Extract eigenvalues and eigenvectors of the Laplacian matrix.

fit(hypergraph, K, weighted_L=False)[source]ยถ

Perform community detection on hypergraphs with spectral clustering.

Parameters:
  • hypergraph (the hypergraph to perform inference on.)

  • K (number of communities.)

  • weighted_L (flag to use the weighted Laplacian.)

Returns:

u

Return type:

hard-membership matrix of dimension (N, K).

output_results()[source]ยถ

Save the results in a .npz file.

Module contentsยถ