class_docstr: This is the Auditor class. It is used in the training algorithm to repeatedly find subgroups that break the
  fairness disparity constraint. You can also use it independently as a stand alone auditor.
class_docstr_tok: ["This","is","the","Auditor","class",".","It","is","used","in","the","training","algorithm","to","repeatedly","find","subgroups","that","break","the","fairness","disparity","constraint",".","You","can","also","use","it","independently","as","a","stand","alone","auditor","."]
docstr: Auditor constructor.
  
  Args:
      :param dataset: dataset object subclassing StandardDataset.
      :param fairness_def: 'FP' or 'FN'
docstr_tok: ["Auditor","constructor",".","Args",":",":","param","dataset",":","dataset","object","subclassing","StandardDataset",".",":","param","fairness_def",":","'FP","'","or","'FN","'"]
code: def __init__(self, dataset, fairness_def):
      """Auditor constructor.
  
      Args:
          :param dataset: dataset object subclassing StandardDataset.
          :param fairness_def: 'FP' or 'FN'
      """
      X, X_prime, y = clean.extract_df_from_ds(dataset)
      self.X_prime = X_prime
      self.y_input = y
      self.y_inverse = np.array(
          [abs(1 - y_value) for y_value in self.y_input]
      )
      self.fairness_def = fairness_def
      if self.fairness_def not in ["FP", "FN"]:
          raise Exception(
              "Invalid fairness metric specified: {}. Please choose 'FP' or 'FN'.".format(
                  self.fairness_def
              )
          )
      self.y = self.y_input
      # flip the labels for FN rate auditing
      if self.fairness_def == "FN":
          self.y = self.y_inverse
      self.X_prime_0 = pd.DataFrame(
          [
              self.X_prime.iloc[u, :]
              for u, s in enumerate(self.y)
              if s == 0
          ]
      )
  
file_path: AIF360/aif360/algorithms/inprocessing/gerryfair/auditor.py
imports: import numpy
  import pandas
  from sklearn import linear_model
  from aif360.algorithms.inprocessing.gerryfair.reg_oracle_class import RegOracle
  from aif360.algorithms.inprocessing.gerryfair import clean
label_desc: Use image node_id 1 to create a new Auditor object  with example: obj = Auditor(dataset, fairness_def)