events_calculator

class dyn.events.events_calculator.CommunityEventsDetector

Bases: ABC

This class defines the common interface for all events detector.

abstract compute(tcommlist, evolving_communities=None)

Compute events detection and return events.

This is done by computing the mask for each static community on the tcommlist.

Parameters
  • membership

  • evolving_communities (Optional[List]) – if set, only return events happening to those evolving communities

Return type

DataFrame

Returns

events

class dyn.events.events_calculator.MaskCalculator(mask_name)

Bases: CommunityEventsDetector

Class that computes the masks.

Computes masks for all punctual communities of an evolving community.

Parameters

mask_name (str) –

compute(tcommlist, evolving_communities=None)

Compute events detection and return events.

This is done by computing the mask for each static community on the tcommlist.

Parameters
  • membership

  • evolving_communities (Optional[List]) – if set, only return events happening to those evolving communities

Return type

DataFrame

Returns

events

get_masks()

Return masks per node.

Returns

Return type

dict

mask_per_name = {'baseline': <class 'dyn.events.masks.BaselineMask'>, 'double': <class 'dyn.events.masks.DoubleGrowthMask'>, 'double_all_sums': <class 'dyn.events.masks.DoubleAllSumsMask'>, 'simple': <class 'dyn.events.masks.SimpleGrowthMask'>, 'simple_all_sums': <class 'dyn.events.masks.SimpleAllSumsMask'>}