class_docstr: Calibrated equalized odds postprocessing is a post-processing technique
  that optimizes over calibrated classifier score outputs to find
  probabilities with which to change output labels with an equalized odds
  objective [7]_.
  
  References:
      .. [7] G. Pleiss, M. Raghavan, F. Wu, J. Kleinberg, and
         K. Q. Weinberger, "On Fairness and Calibration," Conference on Neural
         Information Processing Systems, 2017
  
  Adapted from:
  https://github.com/gpleiss/equalized_odds_and_calibration/blob/master/calib_eq_odds.py
docstr: Args:
      unprivileged_groups (dict or list(dict)): Representation for
          unprivileged group.
      privileged_groups (dict or list(dict)): Representation for
          privileged group.
      cost_contraint: fpr, fnr or weighted
      seed (int, optional): Seed to make `predict` repeatable.
code: def __init__(
      self,
      unprivileged_groups,
      privileged_groups,
      cost_constraint="weighted",
      seed=None,
  ):
      """
      Args:
          unprivileged_groups (dict or list(dict)): Representation for
              unprivileged group.
          privileged_groups (dict or list(dict)): Representation for
              privileged group.
          cost_contraint: fpr, fnr or weighted
          seed (int, optional): Seed to make `predict` repeatable.
      """
      super(CalibratedEqOddsPostprocessing, self).__init__(
          unprivileged_groups=unprivileged_groups,
          privileged_groups=privileged_groups,
          seed=seed,
      )
  
      self.seed = seed
      self.model_params = None
      self.unprivileged_groups = (
          [unprivileged_groups]
          if isinstance(unprivileged_groups, dict)
          else unprivileged_groups
      )
      self.privileged_groups = (
          [privileged_groups]
          if isinstance(privileged_groups, dict)
          else privileged_groups
      )
      self.cost_constraint = cost_constraint
      if self.cost_constraint == "fnr":
          self.fn_rate = 1
          self.fp_rate = 0
      elif self.cost_constraint == "fpr":
          self.fn_rate = 0
          self.fp_rate = 1
      elif self.cost_constraint == "weighted":
          self.fn_rate = 1
          self.fp_rate = 1
  
      self.base_rate_priv = 0.0
      self.base_rate_unpriv = 0.0
  
file_path: AIF360/aif360/algorithms/postprocessing/calibrated_eq_odds_postprocessing.py
imports: import numpy
  from aif360.algorithms import Transformer
  from aif360.metrics import ClassificationMetric, utils
label_desc: Use image node_id 1 to create a new CalibratedEqOddsPostprocessing object from inherited base classes: Transformer with example: obj = CalibratedEqOddsPostprocessing(unprivileged_groups, privileged_groups, cost_constraint, seed)