class_docstr: An implementation of `"SCD" <http://wwwconference.org/proceedings/www2014/proceedings/p225.pdf>`_ from the
  WWW '14 paper "High Quality, Scalable and Parallel Community Detection for
  Large Real Graphs". The procedure greedily optimizes the approximate weighted
  community clustering metric. First, clusters are built around highly clustered nodes.
  Second, we refine the initial partition by using the approximate WCC. These refinements
  happen for the whole vertex set.
  
  Args:
      iterations (int): Refinemeent iterations. Default is 25.
      eps (float): Epsilon score for zero division correction. Default is 10**-6.
      seed (int): Random seed value. Default is 42.
class_docstr_tok: ["An","implementation","of","`","``","SCD","''","<","http",":","\/\/wwwconference.org\/proceedings\/www2014\/proceedings\/p225.pdf",">","`","_","from","the","WWW","'14","paper","``","High","Quality",",","Scalable","and","Parallel","Community","Detection","for","Large","Real","Graphs","''",".","The","procedure","greedily","optimizes","the","approximate","weighted","community","clustering","metric",".","First",",","clusters","are","built","around","highly","clustered","nodes",".","Second",",","we","refine","the","initial","partition","by","using","the","approximate","WCC",".","These","refinements","happen","for","the","whole","vertex","set",".","Args",":","iterations","(","int",")",":","Refinemeent","iterations",".","Default","is","25.","eps","(","float",")",":","Epsilon","score","for","zero","division","correction",".","Default","is","10","*","*","-6.","seed","(","int",")",":","Random","seed","value",".","Default","is","42","."]
docstr: Calculating the community level statistics used for refinement.
docstr_tok: ["Calculating","the","community","level","statistics","used","for","refinement","."]
code: def _calculate_community_statistics(self, inverse_community_index):
      """
      Calculating the community level statistics used for refinement.
      """
      community_statistics = {}
      for comm, members in inverse_community_index.items():
          induced_graph = self._graph.subgraph(members)
          size = induced_graph.number_of_nodes()
          density = nx.density(induced_graph)
          edge_out = sum(
              [
                  0 if neighbor in induced_graph else 1
                  for node in members
                  for neighbor in self._graph.neighbors(node)
              ]
          )
          community_statistics[comm] = {
              "r": size,
              "d": density,
              "b": edge_out,
          }
      return community_statistics
  
file_path: karateclub/karateclub/community_detection/non_overlapping/scd.py
imports: import networkx
  from typing import Dict
  from karateclub.estimator import Estimator
label_desc: Use image node_id 7 for calling the SCD obj's underlying member method code with example usage: obj._calculate_community_statistics(inverse_community_index) and returns: community_statistics