Clustering

Clustering module

class markovianSBM.Clustering.Clustering(n, K)[source]

Bases: object

Class 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

solve_relaxed_LP(M)[source]

Prelimanary to run the K-medoid algorithm.

Parameters

M – M is the output of the relaxed SDP problem.

markovianSBM.Clustering.add_liste(Level, Liste, Node, UP=True)[source]
markovianSBM.Clustering.recu(node, level, graph, liste, node2ind, dejavu, dico_closest, nodes)[source]