实现、动态展示多种社区发现算法,这个Python库助你发现网络图的社区结构
机器之心报道
熟知社区发现算法,你不能错过这个 Python 库。它涵盖 Louvain 算法、Girvan-Newman 算法等多种社区发现算法,还具有可视化功能。
Louvain 算法
Girvan-Newman 算法
层次聚类
谱聚类
Bron-Kerbosch 算法
$ pip install communities
louvain_method(adj_matrix : numpy.ndarray, n : int = None) -> list
from communities.algorithms import louvain_methodad
j_matrix = [...]
communities, _ = louvain_method(adj_matrix)
girvan_newman(adj_matrix : numpy.ndarray, n : int = None) -> list
from communities.algorithms import girvan_newman
adj_matrix = [...]
communities, _ = girvan_newman(adj_matrix)
hierarchical_clustering(adj_matrix : numpy.ndarray, metric : str = "cosine", linkage : str = "single", n : int = None) -> list
from communities.algorithms import hierarchical_clustering
adj_matrix = [...]
communities = hierarchical_clustering(adj_matrix, metric="euclidean", linkage="complete")
spectral_clustering(adj_matrix : numpy.ndarray, k : int) -> list
from communities.algorithms import spectral_clustering
adj_matrix = [...]
communities = spectral_clustering(adj_matrix, k=5)
bron_kerbosch(adj_matrix : numpy.ndarray, pivot : bool = False) -> list
from communities.algorithms import bron_kerbosch
adj_matrix = [...]
communities = bron_kerbosch(adj_matrix, pivot=True)
draw_communities(adj_matrix : numpy.ndarray, communities : list, dark : bool = False, filename : str = None, seed : int = 1)
from communities.algorithms import louvain_method
from communities.visualization import draw_communities
adj_matrix = [...]
communities, frames = louvain_method(adj_matrix)
draw_communities(adj_matrix, communities)
louvain_animation(adj_matrix : numpy.ndarray, frames : list, dark : bool = False, duration : int = 15, filename : str = None, dpi : int = None, seed : int = 2)
from communities.algorithms import louvain_method
from communities.visualization import louvain_animation
adj_matrix = [...]
communities, frames = louvain_method(adj_matrix)
louvain_animation(adj_matrix, frames)
报告内容涵盖人工智能顶会趋势分析、整体技术趋势发展结论、六大细分领域(自然语言处理、计算机视觉、机器人与自动化技术、机器学习、智能基础设施、数据智能技术、前沿智能技术)技术发展趋势数据与问卷结论详解,最后附有六大技术领域5年突破事件、Synced Indicator 完整数据。
识别下方二维码,立即购买报告。
© THE END
投稿或寻求报道:[email protected]