class_docstr: Model is an algorithm for learning classifiers that are fair with respect
  to rich subgroups.
  
  Rich subgroups are defined by (linear) functions over the sensitive
  attributes, and fairness notions are statistical: false positive, false
  negative, and statistical parity rates. This implementation uses a max of
  two regressions as a cost-sensitive classification oracle, and supports
  linear regression, support vector machines, decision trees, and kernel
  regression. For details see:
  
  References:
      .. [1] "Preventing Fairness Gerrymandering: Auditing and Learning for
         Subgroup Fairness." Michale Kearns, Seth Neel, Aaron Roth, Steven Wu.
         ICML '18.
      .. [2] "An Empirical Study of Rich Subgroup Fairness for Machine
         Learning". Michael Kearns, Seth Neel, Aaron Roth, Steven Wu. FAT '19.
docstr: Initialize Model Object and set hyperparameters.
  
  Args:
      C: Maximum L1 Norm for the Dual Variables (hyperparameter)
      printflag: Print Output Flag
      heatmapflag: Save Heatmaps every heatmap_iter Flag
      heatmap_iter: Save Heatmaps every heatmap_iter
      heatmap_path: Save Heatmaps path
      max_iters: Time Horizon for the fictitious play dynamic.
      gamma: Fairness Approximation Paramater
      fairness_def: Fairness notion, FP, FN, SP.
      errors: see fit()
      fairness_violations: see fit()
      predictor: Hypothesis class for the Learner. Supports LR, SVM, KR,
          Trees.
docstr_tok: ["Initialize","Model","Object","and","set","hyperparameters",".","Args",":","C",":","Maximum","L1","Norm","for","the","Dual","Variables","(","hyperparameter",")","printflag",":","Print","Output","Flag","heatmapflag",":","Save","Heatmaps","every","heatmap_iter","Flag","heatmap_iter",":","Save","Heatmaps","every","heatmap_iter","heatmap_path",":","Save","Heatmaps","path","max_iters",":","Time","Horizon","for","the","fictitious","play","dynamic",".","gamma",":","Fairness","Approximation","Paramater","fairness_def",":","Fairness","notion",",","FP",",","FN",",","SP",".","errors",":","see","fit","(",")","fairness_violations",":","see","fit","(",")","predictor",":","Hypothesis","class","for","the","Learner",".","Supports","LR",",","SVM",",","KR",",","Trees","."]
code: def __init__(
      self,
      C=10,
      printflag=False,
      heatmapflag=False,
      heatmap_iter=10,
      heatmap_path=".",
      max_iters=10,
      gamma=0.01,
      fairness_def="FP",
      predictor=linear_model.LinearRegression(),
  ):
      """Initialize Model Object and set hyperparameters.
  
      Args:
          C: Maximum L1 Norm for the Dual Variables (hyperparameter)
          printflag: Print Output Flag
          heatmapflag: Save Heatmaps every heatmap_iter Flag
          heatmap_iter: Save Heatmaps every heatmap_iter
          heatmap_path: Save Heatmaps path
          max_iters: Time Horizon for the fictitious play dynamic.
          gamma: Fairness Approximation Paramater
          fairness_def: Fairness notion, FP, FN, SP.
          errors: see fit()
          fairness_violations: see fit()
          predictor: Hypothesis class for the Learner. Supports LR, SVM, KR,
              Trees.
      """
  
      super(GerryFairClassifier, self).__init__()
      self.C = C
      self.printflag = printflag
      self.heatmapflag = heatmapflag
      self.heatmap_iter = heatmap_iter
      self.heatmap_path = heatmap_path
      self.max_iters = max_iters
      self.gamma = gamma
      self.fairness_def = fairness_def
      self.predictor = predictor
      self.classifiers = None
      self.errors = None
      self.fairness_violations = None
      if self.fairness_def not in ["FP", "FN"]:
          raise Exception(
              "This metric is not yet supported for learning. Metric specified: {}.".format(
                  self.fairness_def
              )
          )
  
file_path: AIF360/aif360/algorithms/inprocessing/gerryfair_classifier.py
imports: import copy
  from aif360.algorithms.inprocessing.gerryfair import heatmap
  from aif360.algorithms.inprocessing.gerryfair.clean import array_to_tuple
  from aif360.algorithms.inprocessing.gerryfair.learner import Learner
  from aif360.algorithms.inprocessing.gerryfair.auditor import *
  from aif360.algorithms.inprocessing.gerryfair.classifier_history import ClassifierHistory
  from aif360.algorithms import Transformer
label_desc: Use image node_id 1 to create a new GerryFairClassifier object from inherited base classes: Transformer with example: obj = GerryFairClassifier(C, printflag, heatmapflag, heatmap_iter, heatmap_path, max_iters, gamma, fairness_def, predictor)