cdlib.lifecycles.all_flows_null¶
- cdlib.lifecycles.all_flows_null(lc: object, direction: str, min_branch_size=1, iterations=1000)¶
Compare all flows with null models. See validate_flow for details.
- Parameters:
lc – a CommunityOMatching object
direction – temporal direction
min_branch_size – minimum size of a branch to be considered
iterations – number of random draws to be used to generate the null model
- Returns:
a dictionary keyed by set identifier and valued by mean, std, and p-value
- 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, "+")