class_docstr: Learning fair representations is a pre-processing technique that finds a
  latent representation which encodes the data well but obfuscates information
  about protected attributes [2]_.
  References:
      .. [2] R. Zemel, Y. Wu, K. Swersky, T. Pitassi, and C. Dwork,  "Learning
         Fair Representations." International Conference on Machine Learning,
         2013.
  Based on code from https://github.com/zjelveh/learning-fair-representations
docstr: Args:
      unprivileged_groups (tuple): Representation for unprivileged group.
      privileged_groups (tuple): Representation for privileged group.
      k (int, optional): Number of prototypes.
      Ax (float, optional): Input recontruction quality term weight.
      Az (float, optional): Fairness constraint term weight.
      Ay (float, optional): Output prediction error.
      print_interval (int, optional): Print optimization objective value
          every print_interval iterations.
      verbose (int, optional): If zero, then no output.
      seed (int, optional): Seed to make `predict` repeatable.
code: def __init__(
      self,
      unprivileged_groups,
      privileged_groups,
      k=5,
      Ax=0.01,
      Ay=1.0,
      Az=50.0,
      print_interval=250,
      verbose=0,
      seed=None,
  ):
      """
      Args:
          unprivileged_groups (tuple): Representation for unprivileged group.
          privileged_groups (tuple): Representation for privileged group.
          k (int, optional): Number of prototypes.
          Ax (float, optional): Input recontruction quality term weight.
          Az (float, optional): Fairness constraint term weight.
          Ay (float, optional): Output prediction error.
          print_interval (int, optional): Print optimization objective value
              every print_interval iterations.
          verbose (int, optional): If zero, then no output.
          seed (int, optional): Seed to make `predict` repeatable.
      """
  
      super(LFR, self).__init__(
          unprivileged_groups=unprivileged_groups,
          privileged_groups=privileged_groups,
      )
  
      self.seed = seed
  
      self.unprivileged_groups = unprivileged_groups
      self.privileged_groups = privileged_groups
      if (
          len(self.unprivileged_groups) > 1
          or len(self.privileged_groups) > 1
      ):
          raise ValueError(
              "Only one unprivileged_group or privileged_group supported."
          )
      self.protected_attribute_name = list(
          self.unprivileged_groups[0].keys()
      )[0]
      self.unprivileged_group_protected_attribute_value = (
          self.unprivileged_groups[0][self.protected_attribute_name]
      )
      self.privileged_group_protected_attribute_value = (
          self.privileged_groups[0][self.protected_attribute_name]
      )
  
      self.k = k
      self.Ax = Ax
      self.Ay = Ay
      self.Az = Az
  
      self.print_interval = print_interval
      self.verbose = verbose
  
      self.w = None
      self.prototypes = None
      self.learned_model = None
  
file_path: AIF360/aif360/algorithms/preprocessing/lfr.py
imports: import numpy
  import scipy.optimize
  from aif360.algorithms import Transformer
  from aif360.algorithms.preprocessing.lfr_helpers import helpers
label_desc: Use image node_id 1 to create a new LFR object from inherited base classes: Transformer with example: obj = LFR(unprivileged_groups, privileged_groups, k, Ax, Ay, Az, print_interval, verbose, seed)