class_docstr: Reject option classification is a postprocessing technique that gives
  favorable outcomes to unpriviliged groups and unfavorable outcomes to
  priviliged groups in a confidence band around the decision boundary with the
  highest uncertainty [10]_.
  
  References:
      .. [10] F. Kamiran, A. Karim, and X. Zhang, "Decision Theory for
         Discrimination-Aware Classification," IEEE International Conference
         on Data Mining, 2012.
class_docstr_tok: ["Reject","option","classification","is","a","postprocessing","technique","that","gives","favorable","outcomes","to","unpriviliged","groups","and","unfavorable","outcomes","to","priviliged","groups","in","a","confidence","band","around","the","decision","boundary","with","the","highest","uncertainty","[","10","]","_.","References",":","..","[","10","]","F.","Kamiran",",","A.","Karim",",","and","X.","Zhang",",","``","Decision","Theory","for","Discrimination-Aware","Classification",",","''","IEEE","International","Conference","on","Data","Mining",",","2012","."]
docstr: Obtain fair predictions using the ROC method.
  
  Args:
      dataset (BinaryLabelDataset): Dataset containing scores that will
          be used to compute predicted labels.
  
  Returns:
      dataset_pred (BinaryLabelDataset): Output dataset with potentially
      fair predictions obtain using the ROC method.
docstr_tok: ["Obtain","fair","predictions","using","the","ROC","method",".","Args",":","dataset","(","BinaryLabelDataset",")",":","Dataset","containing","scores","that","will","be","used","to","compute","predicted","labels",".","Returns",":","dataset_pred","(","BinaryLabelDataset",")",":","Output","dataset","with","potentially","fair","predictions","obtain","using","the","ROC","method","."]
code: def predict(self, dataset):
      """Obtain fair predictions using the ROC method.
  
      Args:
          dataset (BinaryLabelDataset): Dataset containing scores that will
              be used to compute predicted labels.
  
      Returns:
          dataset_pred (BinaryLabelDataset): Output dataset with potentially
          fair predictions obtain using the ROC method.
      """
      dataset_new = dataset.copy(deepcopy=False)
  
      fav_pred_inds = dataset.scores > self.classification_threshold
      unfav_pred_inds = ~fav_pred_inds
  
      y_pred = np.zeros(dataset.scores.shape)
      y_pred[fav_pred_inds] = dataset.favorable_label
      y_pred[unfav_pred_inds] = dataset.unfavorable_label
  
      # Indices of critical region around the classification boundary
      crit_region_inds = np.logical_and(
          dataset.scores
          <= self.classification_threshold + self.ROC_margin,
          dataset.scores
          > self.classification_threshold - self.ROC_margin,
      )
  
      # Indices of privileged and unprivileged groups
      cond_priv = utils.compute_boolean_conditioning_vector(
          dataset.protected_attributes,
          dataset.protected_attribute_names,
          self.privileged_groups,
      )
      cond_unpriv = utils.compute_boolean_conditioning_vector(
          dataset.protected_attributes,
          dataset.protected_attribute_names,
          self.unprivileged_groups,
      )
  
      # New, fairer labels
      dataset_new.labels = y_pred
      dataset_new.labels[
          np.logical_and(crit_region_inds, cond_priv.reshape(-1, 1))
      ] = dataset.unfavorable_label
      dataset_new.labels[
          np.logical_and(crit_region_inds, cond_unpriv.reshape(-1, 1))
      ] = dataset.favorable_label
  
      return dataset_new
  
file_path: AIF360/aif360/algorithms/postprocessing/reject_option_classification.py
imports: import numpy
  from warnings import warn
  from aif360.algorithms import Transformer
  from aif360.metrics import utils
  from aif360.metrics import BinaryLabelDatasetMetric, ClassificationMetric
label_desc: Use image node_id 3 for calling the RejectOptionClassification obj's underlying member method code with example usage: obj.predict(dataset) and returns: dataset_new