groundtruth_generator
This module generates a complete benchmark.
- class Groundtruth(tcommlist, graphs, events)
Bases:
objectThis class represents a temporal network and its communities.
- Parameters:
- Attr membership:
- graphs: Dict[int, Graph]
- class GroundtruthGenerator(community_generator=None, node_generator=None, edge_generator=None, seed=None)
Bases:
IGeneratorThis class defines a complete benchmark generator.
- Parameters:
community_generator (
Optional[CommunitiesGenerator]) – community flow graph generator,CommunitiesGeneratorwith default arguments if not providednode_generator (
Optional[RandomMemberGenerator]) – membership generator, newRandomMemberGeneratorinstance if not providededge_generator (
Optional[IStaticGraphGenerator]) – snapshot network graphs generator,BPAMwith default arguments if not providedseed (
Optional[Any]) –
Note
seed attributes of each step generator will be replaced by a new one spwaned from
seed.- configure_seed(seed)
Set :attr`seed` and :attr`rng`.
- Parameters:
seed (
Any) –- Returns:
instance generator
- copy()
Return a copy of generator.
- Return type:
Self- Returns:
- generate()
Generate complete benchmark.
- Return type:
- Returns:
groundtruth
- generate_clusters(communities)
Generate clusters of members for each time step.
- Returns:
list of the clusters for each time step as a tcommlist
- Return type:
- generate_communities()
Generate evolving communities.
- Returns:
evolving communities
- Return type:
dyn.core.community_graphs.EvolvingCommunity
- generate_events(tcommlist)
Generate groundtruth events from tcommlist.
Event types are the following:
birth
continuation
death
- Parameters:
tcommlist –
- Returns:
groundtruth events
- generate_graphs(tcommlist)
Generate graphs for each time step.
- Returns:
list of timesteps and corresponding graphs
- Return type:
tuple
- property rng: Generator
Random number generator of the generator
- Return type:
Generator
- property seed: SeedSequence
Seed of the generator
- Return type:
SeedSequence
- spawn(n_children=1)
Spawn a copy of the generated with a child seed.
- Return type:
Union[Sequence[Self],Self]- Returns:
new generator
- class ProgressiveGroundtruthGenerator(community_generator=None, node_generator=None, edge_generator=None, seed=None)
Bases:
GroundtruthGeneratorThis class defines a complete benchmark generator.
Its particularity is to integrate a progress bar from package alive-progress and display the progress of each step.
- Parameters:
community_generator (
Optional[CommunitiesGenerator]) – community flow graph generator,CommunitiesGeneratorwith default arguments if not providednode_generator (
Optional[RandomMemberGenerator]) – membership generator, newRandomMemberGeneratorinstance if not providededge_generator (
Optional[IStaticGraphGenerator]) – snapshot network graphs generator,BPAMwith default arguments if not providedseed (
Optional[Any]) –
Note
seed attributes of each step generator will be replaced by a new one spwaned from
seed.if the alive-progress package is not installed, this generator is no different from
GroundtruthGenerator.
- configure_seed(seed)
Set :attr`seed` and :attr`rng`.
- Parameters:
seed (
Any) –- Returns:
instance generator
- copy()
Return a copy of generator.
- Return type:
Self- Returns:
- generate()
Generate complete benchmark.
- Return type:
- Returns:
groundtruth
- generate_clusters(communities)
Generate clusters of members for each time step.
- Returns:
list of the clusters for each time step as a tcommlist
- Return type:
- generate_communities()
Generate evolving communities.
- Returns:
evolving communities
- Return type:
dyn.core.community_graphs.EvolvingCommunity
- generate_events(tcommlist)
Generate groundtruth events from tcommlist.
Event types are the following:
birth
continuation
death
- Parameters:
tcommlist –
- Returns:
groundtruth events
- generate_graphs(tcommlist)
Generate graphs for each time step.
- Returns:
list of timesteps and corresponding graphs
- Return type:
tuple
- property rng: Generator
Random number generator of the generator
- Return type:
Generator
- property seed: SeedSequence
Seed of the generator
- Return type:
SeedSequence
- spawn(n_children=1)
Spawn a copy of the generated with a child seed.
- Return type:
Union[Sequence[Self],Self]- Returns:
new generator