メジャーな方法、実装を教えて
コミュニティ検出のメジャーな手法と実装例は以下のようなものがある。
!pip install python-louvain
from community import community_louvain
partition = community_louvain.best_partition(G)
!pip install python-igraph leidenalg
import igraph as ig
import leidenalg
g = ig.Graph.Read_Ncol("network.edgelist")
partition = leidenalg.find_partition(g, leidenalg.ModularityVertexPartition)
import networkx as nx
from networkx.algorithms.community import girvan_newman
G = nx.karate_club_graph()
communities = next(girvan_newman(G))
import igraph as ig
g = ig.Graph.Read_Ncol("network.edgelist")
communities = g.community_infomap()
れらの手法を用いると、与えられたネットワークの内部構造を直感的に理解でき、テキスト間の共起関係や関連性を可視化・分析しやすくなる。