icem_calculator

This module implements the ICEM algorithm.

Todo

review doc-strings to make sure is is detailed enough

class dyn.events.icem_calculator.ICEMCalculator(alpha, beta)

Bases: CommunityEventsDetector

Class for computing ICEM algorithm on communities.

Parameters
  • alpha (float) – ratio of common members to consider punctual communities as similar

  • beta (float) – set ratio of common members to consider punctual communities as very similar

Todo

rework so it uses tcommlist data directly (loading done before)

compute(tcommlist, evolving_communities=None)

Compute events detection and return events.

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

Parameters
  • membership

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

Return type

DataFrame

Returns

events

dyn.events.icem_calculator.membership_to_members_dict(membership)

Convert membership to dict.

Returned membership is a 2-dimensional dictionary with first dimension identified by snapshot number, and second dimension identified by a punctual community. The latter contains the members as values.

Parameters

membership (Membership) –

Return type

Dict[int, Dict[Any, List]]

Returns

membership as a dict