cdlib.viz.plot_sim_matrix

plot_sim_matrix(clusterings: list, scoring: Callable[[object, object], object]) → object

Plot a similarity matrix between a list of clusterings, using the provided scoring function.

Parameters:
  • clusterings – list of clusterings to compare
  • scoring – the scoring function to use
Returns:

a ClusterGrid instance

Example:

>>> from cdlib import algorithms, viz, evaluation
>>> import networkx as nx
>>> g = nx.karate_club_graph()
>>> coms = algorithms.louvain(g)
>>> coms2 = algorithms.walktrap(g)
>>> clustermap = viz.plot_sim_matrix([coms,coms2],evaluation.adjusted_mutual_information)