cdlib.viz.plot_sim_matrix

cdlib.viz.plot_sim_matrix(clusterings: list, scoring: Callable[[object, object], object]) object

使用提供的评分函数绘制聚类列表之间的相似性矩阵。

Parameters:
  • clusterings – 要比较的聚类列表

  • scoring – 使用的评分函数

Returns:

一个 ClusterGrid 实例

示例:

>>> 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)