class_docstr: Assesses the quality of partitioning according to chosen metrics and report it.
  
  Available metrics: edge cut, edge imbalance, vertex imbalance, time, memory usage.
  
  Parameters
  ----------
  partitionings:
          Data splits to be compared.
  
  Example
  -------
  
  >>>>quality = PartitioningReporter(partitionings)
  >>>>report = quality.report(visualize=False)
class_docstr_tok: ["Assesses","the","quality","of","partitioning","according","to","chosen","metrics","and","report","it",".","Available","metrics",":","edge","cut",",","edge","imbalance",",","vertex","imbalance",",","time",",","memory","usage",".","Parameters","--","--","--","--","--","partitionings",":","Data","splits","to","be","compared",".","Example","--","--","--","-",">",">",">",">","quality","=","PartitioningReporter","(","partitionings",")",">",">",">",">","report","=","quality.report","(","visualize=False",")"]
docstr: Calculate different metrics for a single partition.
  
  Parameters
  ----------
  partitioning:
      Single split of data into partitions.
  EDGE_CUT : bool
      Flag whether to calculate edge cut or not.
  EDGE_IMB : bool
      Flag whether to calculate edge imbalance or not.
  VERTEX_IMB : bool
      Flag whether to calculate vertex imbalance or not.
  
  Returns
  -------
  metrics: dict
      Dictionary with metrics.
docstr_tok: ["Calculate","different","metrics","for","a","single","partition",".","Parameters","--","--","--","--","--","partitioning",":","Single","split","of","data","into","partitions",".","EDGE_CUT",":","bool","Flag","whether","to","calculate","edge","cut","or","not",".","EDGE_IMB",":","bool","Flag","whether","to","calculate","edge","imbalance","or","not",".","VERTEX_IMB",":","bool","Flag","whether","to","calculate","vertex","imbalance","or","not",".","Returns","--","--","--","-","metrics",":","dict","Dictionary","with","metrics","."]
code: def report_single_partitioning(
      self, partitioning, EDGE_CUT=True, EDGE_IMB=True, VERTEX_IMB=True
  ):
      """Calculate different metrics for a single partition.
  
      Parameters
      ----------
      partitioning:
          Single split of data into partitions.
      EDGE_CUT : bool
          Flag whether to calculate edge cut or not.
      EDGE_IMB : bool
          Flag whether to calculate edge imbalance or not.
      VERTEX_IMB : bool
          Flag whether to calculate vertex imbalance or not.
  
      Returns
      -------
      metrics: dict
          Dictionary with metrics.
      """
      logs = partitioning[1]
      partitioning = partitioning[0]
      tmp = partitioning.get_data()
      k = tmp.get_data_size()
      partitioner = partitioning
      partitioning = partitioner.get_partitions_list()
      sizes = [x.get_data_size() for x in partitioning]
      avg_size = np.mean(sizes)
      max_size = np.max(sizes)
      metrics = {"EDGE_IMB": None, "VERTEX_IMB": None, "EDGE_CUT": None}
  
      if logs:
          metrics["PARTITIONING TIME"] = logs["_SPLIT"]["time"]
          metrics["PARTITIONING MEMORY"] = logs["_SPLIT"][
              "memory-bytes"
          ]
      if EDGE_CUT:
          edge_cut, edge_cut_proportion = self.get_edge_cut(
              k, partitioning, avg_size
          )
          metrics["EDGE_CUT"] = edge_cut
          metrics["EDGE_CUT_PERCENTAGE"] = edge_cut_proportion
      if EDGE_IMB:
          edge_imb = self.get_edge_imbalance(avg_size, max_size)
          metrics["EDGE_IMB"] = edge_imb
      if VERTEX_IMB:
          (
              vertex_imb,
              vertex_count,
          ) = self.get_vertex_imbalance_and_count(
              partitioning, vertex_count=True
          )
          metrics["VERTEX_IMB"] = vertex_imb
          metrics["VERTEX_COUNT"] = vertex_count
      metrics["EDGES_COUNT"] = self.get_edges_count(partitioning)
      metrics[
          "PERCENTAGE_DEV_EDGES"
      ] = self.get_average_deviation_from_ideal_size_edges(partitioning)
      metrics[
          "PERCENTAGE_DEV_VERTICES"
      ] = self.get_average_deviation_from_ideal_size_vertices(
          partitioning
      )
      partitioner.clean()
      return metrics
  
file_path: AmpliGraph/ampligraph/datasets/partitioning_reporter.py
imports: import copy
  import logging
  import matplotlib.pyplot
  import numpy
  from matplotlib.pyplot import cm
  from .datasets import load_fb15k_237
  from .graph_partitioner import RandomVerticesGraphPartitioner
label_desc: Use image node_id 9 for calling the PartitioningReporter obj's underlying member method code with example usage: obj.report_single_partitioning(partitioning, EDGE_CUT, EDGE_IMB, VERTEX_IMB) and returns: metrics