cdlib.lifecycles.all_flows_null¶
- cdlib.lifecycles.all_flows_null(lc: object, direction: str, min_branch_size=1, iterations=1000)¶
将所有流与空模型进行比较。详情请参见validate_flow。
- Parameters:
lc – 一个 CommunityOMatching 对象
direction – 时间方向
min_branch_size – 被视为分支的最小大小
iterations – 用于生成空模型的随机抽取次数
- Returns:
一个以集合标识符为键,以均值、标准差和p值为值的字典
- Example:
>>> from cdlib import TemporalClustering, LifeCycle >>> from cdlib import algorithms >>> from cdlib.lifecycles.algorithms import all_flows_null >>> from networkx.generators.community import LFR_benchmark_graph >>> tc = TemporalClustering() >>> for t in range(0, 10): >>> g = LFR_benchmark_graph( >>> n=250, >>> tau1=3, >>> tau2=1.5, >>> mu=0.1, >>> average_degree=5, >>> min_community=20, >>> seed=10, >>> ) >>> coms = algorithms.louvain(g) # here any CDlib algorithm can be applied >>> tc.add_clustering(coms, t) >>> events = LifeCycle(tc) >>> events.compute_events("facets") >>> validated = all_flows_null(events, "+")