assess

This module enables to compare two tcommlist files.

assess_partition_metrics(tcommunityX, tcommunityY)

Compute partition metrics between two temporal communitiies partitions.

Partitions are compared between each snapshot.

Parameters:
Return type:

dict

Returns:

partition metrics

assess_transition_metrics(tcommunityX, tcommunityY, dt_min, dt_max)

Compute transition metrics between two temporal communities partitions.

Transitions of members between dt_min and dt_max snapshots are compared. Metrics are indexed by (t1, t2) with t1 the transition source snapshot and t2 the transition destination snapshot.

Parameters:
  • tcommunityX (Tcommlist) –

  • tcommunityY (Tcommlist) –

  • dt_min – minimum number of snapshots for the transitions

  • dt_max – maximum number of snapshots for the transitions

Returns:

transition metrics

match_communities(communitiesX, communitiesY, nodesY)

Considering two set of communities X and Y. Return for each community of X the matching community in Y. For each community of X, each node is labeled with its belonging community in Y. The matching community in Y is the one with the highest number of labels.

Parameters:
  • communitiesX (Dict[Any, Set]) –

  • communitiesY (Dict[Any, Set]) –

Returns:

list of pairs

print_info(tcommunity, transitions, nodes, elements)

Print various information successively

Information being printed:

  • communities: communities contained in tcommunity

  • transitions: transitions

  • nodes: nodes

  • elements: elements

  • entropy: \(entropy(elements)\)

Parameters:
  • tcommunity (Tcommlist) –

  • transitions

  • nodes

  • elements