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: Collect individual reports for every partitioning.
  
  Parameters
  ----------
  visualize : bool
      Flag indicating whether to visualize output.
  
  Returns
  -------
  reports: dict
      Calculated metrics for all partitionings stored in a dictionary with keys the numbers of partitions
      and values the dictionary with metrics.
docstr_tok: ["Collect","individual","reports","for","every","partitioning",".","Parameters","--","--","--","--","--","visualize",":","bool","Flag","indicating","whether","to","visualize","output",".","Returns","--","--","--","-","reports",":","dict","Calculated","metrics","for","all","partitionings","stored","in","a","dictionary","with","keys","the","numbers","of","partitions","and","values","the","dictionary","with","metrics","."]
code: def report(
      self, visualize=True, barh=True
  ):  # TODO: include plotting parameters
      """Collect individual reports for every partitioning.
  
      Parameters
      ----------
      visualize : bool
          Flag indicating whether to visualize output.
  
      Returns
      -------
      reports: dict
          Calculated metrics for all partitionings stored in a dictionary with keys the numbers of partitions
          and values the dictionary with metrics.
      """
      reports = {}
      for name, partitioning in self.partitionings.items():
          reports[name] = self.report_single_partitioning(
              partitioning, EDGE_IMB=True, VERTEX_IMB=True
          )
      k = len(self.partitionings[list(self.partitionings.keys())[0]][1])
      if visualize:
          plt.figure(
              figsize=(15, 15 + 0.3 * k + 0.1 * len(self.partitionings))
          )
          ind = 1
          row_size = 3
          size = (
              int(len(reports[list(reports.keys())[0]]) / row_size) + 1
          )
          for metric in reports[list(reports.keys())[0]]:
              plot = False
              dat = []
              color = iter(cm.PiYG(np.linspace(0, 1, len(reports))))
              colors_aggregate = {r: next(color) for r in reports}
              for j, report in enumerate(reports):
                  if reports[report][metric] is not None:
                      if isinstance(reports[report][metric], list):
                          n = len(reports[report][metric])
                          color = iter(cm.seismic(np.linspace(0, 1, n)))
                          colors = {
                              "partition {}".format(i): next(color)
                              for i in range(n)
                          }
                          width = 0.8 / n
                          for i, r in enumerate(
                              reports[report][metric]
                          ):
                              label = "partition {}".format(i)
                              dat.append(
                                  {
                                      "y": j + (i * width),
                                      "width": r,
                                      "height": width,
                                      "label": label,
                                      "label2": str(report),
                                      "color": colors[label],
                                  }
                              )
                      else:
                          colors = colors_aggregate
                          label = str(report)
                          dat.append(
                              {
                                  "y": j,
                                  "width": reports[report][metric],
                                  "label2": label,
                                  "color": colors[label],
                              }
                          )
                      plot = True
              if plot:
                  plt.subplots_adjust(wspace=0.1, hspace=0.4)
                  plt.subplot(size, row_size, ind)
  
                  if barh:
                      unpacked = {
                          k: [dic[k] for dic in dat] for k in dat[0]
                      }
                      data = copy.deepcopy(unpacked)
                      del unpacked["label2"]
                      plt.barh(**unpacked, edgecolor="white")
                  else:
                      plt.bar(*list(zip(*dat)), edgecolor="white")
  
                  labels = list(colors.keys())
                  # handles = [plt.Rectangle((0, 0), 1, 1, color=colors[label]) for label in labels]
                  labels = []
                  for elem in data["label2"]:
                      if elem not in labels:
                          labels.append(elem)
                  # if type(labels) == set:
                  if (ind % row_size) == 1:
                      plt.yticks(range(len(list(labels))), list(labels))
                  else:
                      plt.yticks([])
                  plt.title(metric)
                  plt.xticks(rotation=70)
                  ind += 1
          plt.show()
      return reports
  
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 10 for calling the PartitioningReporter obj's underlying member method code with example usage: obj.report(visualize, barh) and returns: reports