SBM
SBM module
- class markovianSBM.SBM.SBM(n, K, ini_distribution='uniform', framework='iid', X=None, Q=None, P=None, save_B_matrices=False)[source]
Bases:
RelaxedKmeans,Clustering,Estimation,BaumWelchMain class building the graph and running the algorithm to recover communities.
- adjacency_matrix(X=None)[source]
Builds the adjacency matrix of the graph.
- Parameters
X – Pre-defined adjacency matrix
- edges_matrix(Q)[source]
Builds the connectivity matrix Q.
- Parameters
Q – Connectivity matrix of size $K imes K$
- generate_clusters(P)[source]
Samples the communities of the nodes.
- Parameters
P – Transition matrix of the Markov chain of size $K imes K$
- initial_distribution()[source]
Defines the distribution of the community of the first node of the graph.
..note: You can add distribution by yourself in the method