fraction_over_median_degree(graph: <Mock id='139912001494032'>, community: object, summary: bool = True) → object

Fraction of community nodes of having internal degree higher than the median degree value.

\[f(S) = \frac{|\{u: u \in S,| \{(u,v): v \in S\}| > d_m\}| }{n_S}\]

where \(d_m\) is the internal degree median value

  • graph – a networkx/igraph object
  • community – NodeClustering object
  • summary – boolean. If True it is returned an aggregated score for the partition is returned, otherwise individual-community ones. Default True.

If summary==True a FitnessResult object, otherwise a list of floats.


>>> from cdlib.algorithms import louvain
>>> from cdlib import evaluation
>>> g = nx.karate_club_graph()
>>> communities = louvain(g)
>>> mod = evaluation.fraction_over_median_degree(g,communities)
  1. Yang, J., Leskovec, J.: Defining and evaluating network communities based on ground-truth. Knowledge and Information Systems 42(1), 181–213 (2015)