Documentation

MotifCluster.a_b_one — Method

Compute a * (b @ ones) where a, b, ones are square matrices of the same size, and ones contains all entries equal to one. The product * is an entry-wise (Hadamard) product, while @ represents matrix multiplication. This method is more efficient than the naive approach when a or b are sparse.

source
MotifCluster.a_one_b — Method

Compute a .* (ones * b) where a, b, ones are square matrices of the same size, and ones contains all entries equal to one.

source
MotifCluster.build_laplacian — Method

Build a Laplacian matrix (combinatorial Laplacian or random-walk Laplacian) from a symmetric (weighted) graph adjacency matrix.

source
MotifCluster.run_motif_embedding — Method

Calculate a motif adjacency matrix for a given motif and motif type, optionally restrict it to its largest connected component, and then run Laplace embedding with specified Laplacian type and number of eigenvalues and eigenvectors.

source
MotifCluster.run_motif_clustering — Method

Run motif-based spectral clustering on the adjacency matrix of a (weighted directed) network, using a specified motif, motif type, weighting scheme, embedding dimension, number of clusters and Laplacian type. Optionally restrict to the largest connected component before clustering.

source
MotifCluster.sample_dsbm — Method

Sample the (weighted) adjacency matrix of a (weighted) directed stochastic block model (DSBM) with specified parameters.

source