Clustering
Clustering module
- class markovianSBM.Clustering.Clustering(n, K)[source]
Bases:
objectClass that performs the final rounding step on the rows of the matrix $hat{B}$ which is the optimal solution of the SDP relaxation of the K-means problem.
- Kmedoids(barx, bary, C)[source]
Kmedoid algorithm that performs a rounding step on the rows of $hat{B}$.
- Parameters
barx – Output of the method ‘solve_relaxed_LP’
bary – Output of the method ‘solve_relaxed_LP’
C – Output of the method ‘solve_relaxed_LP’
- build_partition(clust)[source]
Given a list clust that associates to each node its community, this methods builds the associated partition of the noes of the graph.
- Parameters
clust – List of estimated clusters for the n nodes of the graph
- find_permutation(true_partition, approx_partition)[source]
Find the permutation between the names of the true communities and the ones estimated by our algorithm.
- Parameters
true_partition – True partition of the nodes in the graph according to their clusters
approx_partition – Estimated partition of the nodes