class_docstr: Optimized preprocessing is a preprocessing technique that learns a
  probabilistic transformation that edits the features and labels in the data
  with group fairness, individual distortion, and data fidelity constraints
  and objectives [3]_.
  
  References:
      .. [3] F. P. Calmon, D. Wei, B. Vinzamuri, K. Natesan Ramamurthy, and
         K. R. Varshney. "Optimized Pre-Processing for Discrimination
         Prevention." Conference on Neural Information Processing Systems,
         2017.
  
  Based on code available at: https://github.com/fair-preprocessing/nips2017
class_docstr_tok: ["Optimized","preprocessing","is","a","preprocessing","technique","that","learns","a","probabilistic","transformation","that","edits","the","features","and","labels","in","the","data","with","group","fairness",",","individual","distortion",",","and","data","fidelity","constraints","and","objectives","[","3","]","_.","References",":","..","[","3","]","F.","P.","Calmon",",","D.","Wei",",","B.","Vinzamuri",",","K.","Natesan","Ramamurthy",",","and","K.","R.","Varshney",".","``","Optimized","Pre-Processing","for","Discrimination","Prevention",".","''","Conference","on","Neural","Information","Processing","Systems",",","2017",".","Based","on","code","available","at",":","https",":","\/\/github.com\/fair-preprocessing\/nips2017"]
docstr: Args:
      optimizer (class): Optimizer class.
      optim_options (dict): Options for optimization to estimate the
          transformation.
      unprivileged_groups (dict): Representation for unprivileged group.
      privileged_groups (dict): Representation for privileged group.
      verbose (bool, optional): Verbosity flag for optimization.
      seed (int, optional): Seed to make `fit` and `predict` repeatable.
  
  Note:
      This algorithm does not use the privileged and unprivileged groups
      that are specified during initialization yet. Instead, it
      automatically attempts to reduce statistical parity difference
      between all possible combinations of groups in the dataset.
docstr_tok: ["Args",":","optimizer","(","class",")",":","Optimizer","class",".","optim_options","(","dict",")",":","Options","for","optimization","to","estimate","the","transformation",".","unprivileged_groups","(","dict",")",":","Representation","for","unprivileged","group",".","privileged_groups","(","dict",")",":","Representation","for","privileged","group",".","verbose","(","bool",",","optional",")",":","Verbosity","flag","for","optimization",".","seed","(","int",",","optional",")",":","Seed","to","make","`","fit","`","and","`","predict","`","repeatable",".","Note",":","This","algorithm","does","not","use","the","privileged","and","unprivileged","groups","that","are","specified","during","initialization","yet",".","Instead",",","it","automatically","attempts","to","reduce","statistical","parity","difference","between","all","possible","combinations","of","groups","in","the","dataset","."]
code: def __init__(
      self,
      optimizer,
      optim_options,
      unprivileged_groups=None,
      privileged_groups=None,
      verbose=False,
      seed=None,
  ):
      """
      Args:
          optimizer (class): Optimizer class.
          optim_options (dict): Options for optimization to estimate the
              transformation.
          unprivileged_groups (dict): Representation for unprivileged group.
          privileged_groups (dict): Representation for privileged group.
          verbose (bool, optional): Verbosity flag for optimization.
          seed (int, optional): Seed to make `fit` and `predict` repeatable.
  
      Note:
          This algorithm does not use the privileged and unprivileged groups
          that are specified during initialization yet. Instead, it
          automatically attempts to reduce statistical parity difference
          between all possible combinations of groups in the dataset.
      """
  
      super(OptimPreproc, self).__init__(
          optimizer=optimizer,
          optim_options=optim_options,
          unprivileged_groups=unprivileged_groups,
          privileged_groups=privileged_groups,
          verbose=verbose,
          seed=seed,
      )
  
      self.seed = seed
      self.optimizer = optimizer
      self.optim_options = optim_options
      self.verbose = verbose
  
      self.unprivileged_groups = unprivileged_groups
      self.privileged_groups = privileged_groups
      if unprivileged_groups or privileged_groups:
          warn(
              "Privileged and unprivileged groups specified will not be "
              "used. The protected attributes are directly specified in the "
              "data preprocessing function. The current implementation "
              "automatically adjusts for discrimination across all groups. "
              "This can be changed by changing the optimization code."
          )
  
file_path: AIF360/aif360/algorithms/preprocessing/optim_preproc.py
imports: from warnings import warn
  import numpy
  import pandas
  from aif360.algorithms import Transformer
  from aif360.datasets import BinaryLabelDataset
label_desc: Use image node_id 1 to create a new OptimPreproc object from inherited base classes: Transformer with example: obj = OptimPreproc(optimizer, optim_options, unprivileged_groups, privileged_groups, verbose, seed)