class_docstr: Reject option based classification (ROC) post-processor.
  
  Reject option classification is a post-processing technique that gives
  favorable outcomes to unprivileged groups and unfavorable outcomes to
  privileged groups in a confidence band around the decision boundary with the
  highest uncertainty [#kamiran12]_.
  
  Note:
      A :class:`~sklearn.pipeline.Pipeline` expects a single estimation step
      but this class requires an estimator's predictions as input. See
      :class:`PostProcessingMeta` for a workaround.
  
  See also:
      :class:`PostProcessingMeta`, :class:`RejectOptionClassifierCV`
  
  References:
      .. [#kamiran12] `F. Kamiran, A. Karim, and X. Zhang, "Decision Theory
         for Discrimination-Aware Classification," IEEE International
         Conference on Data Mining, 2012.
         <https://ieeexplore.ieee.org/abstract/document/6413831>`_
  
  Attributes:
      prot_attr_ (str or list(str)): Protected attribute(s) used for post-
          processing.
      groups_ (array, shape (2,)): A list of group labels known to the
          classifier. Note: this algorithm require a binary division of the
          data.
      classes_ (array, shape (num_classes,)): A list of class labels known to
          the classifier. Note: this algorithm treats all non-positive
          outcomes as negative (binary classification only).
      pos_label_ (scalar): The label of the positive class.
      priv_group_ (scalar): The label of the privileged group.
  
  Examples:
      RejectOptionClassifier can be easily paired with GridSearchCV to
      find the best threshold and margin with respect to a fairness measure:
  
      >>> from sklearn.model_selection import GridSearchCV
      >>> roc = RejectOptionClassifier()
      >>> param = [{'threshold': [t],
                    'margin': np.arange(0.05, min(t, 1-t)+0.025, 0.05)}
      ...          for t in np.arange(0.05, 1., 0.05)]
      >>> stat_par = make_scorer(statistical_parity_difference)
      >>> scoring = {'bal_acc': 'balanced_accuracy', 'stat_par': stat_par}
      >>> def refit(cv_res):
      ...     return np.ma.array(cv_res['mean_test_bal_acc'],
      ...             mask=cv_res['mean_test_stat_par'] < -0.1).argmax()
      ...
      >>> grid = GridSearchCV(roc, param, scoring=scoring, refit=refit)
  
      Or, alternatively, this can be done in one step with
      RejectOptionClassifierCV:
  
      >>> grid = RejectOptionClassifierCV(scoring='statistical_parity')
docstr: This is essentially a no-op; it simply validates the inputs and
  stores them for predict.
  
  Args:
      X (array-like): Ignored.
      y (array-like): Ground-truth (correct) target values. Note: one of X
          or y must contain protected attribute information.
      labels (list, optional): The ordered set of labels values. Must
          match the order of columns in X if provided. By default,
          all labels in y are used in sorted order.
      pos_label (scalar, optional): The label of the positive class.
      priv_group (scalar, optional): The label of the privileged group.
      sample_weight (array-like, optional): Ignored.
  
  Returns:
      self
docstr_tok: ["This","is","essentially","a","no-op",";","it","simply","validates","the","inputs","and","stores","them","for","predict",".","Args",":","X","(","array-like",")",":","Ignored",".","y","(","array-like",")",":","Ground-truth","(","correct",")","target","values",".","Note",":","one","of","X","or","y","must","contain","protected","attribute","information",".","labels","(","list",",","optional",")",":","The","ordered","set","of","labels","values",".","Must","match","the","order","of","columns","in","X","if","provided",".","By","default",",","all","labels","in","y","are","used","in","sorted","order",".","pos_label","(","scalar",",","optional",")",":","The","label","of","the","positive","class",".","priv_group","(","scalar",",","optional",")",":","The","label","of","the","privileged","group",".","sample_weight","(","array-like",",","optional",")",":","Ignored",".","Returns",":","self"]
code: def fit(
      self,
      X,
      y,
      labels=None,
      pos_label=1,
      priv_group=1,
      sample_weight=None,
  ):
      """This is essentially a no-op; it simply validates the inputs and
      stores them for predict.
  
      Args:
          X (array-like): Ignored.
          y (array-like): Ground-truth (correct) target values. Note: one of X
              or y must contain protected attribute information.
          labels (list, optional): The ordered set of labels values. Must
              match the order of columns in X if provided. By default,
              all labels in y are used in sorted order.
          pos_label (scalar, optional): The label of the positive class.
          priv_group (scalar, optional): The label of the privileged group.
          sample_weight (array-like, optional): Ignored.
  
      Returns:
          self
      """
      try:
          groups, self.prot_attr_ = check_groups(
              X, self.prot_attr, ensure_binary=True
          )
      except TypeError:
          groups, self.prot_attr_ = check_groups(
              y, self.prot_attr, ensure_binary=True
          )
      self.classes_ = (
          np.array(labels) if labels is not None else np.unique(y)
      )
      self.groups_ = np.unique(groups)
      self.pos_label_ = pos_label
      self.priv_group_ = priv_group
  
      if len(self.classes_) != 2:
          raise ValueError("Only binary classification is supported.")
  
      if pos_label not in self.classes_:
          raise ValueError(
              "pos_label={} is not in the set of labels. The "
              "valid values are:\n{}".format(pos_label, self.classes_)
          )
  
      if priv_group not in self.groups_:
          raise ValueError(
              "priv_group={} is not in the set of groups. The "
              "valid values are:\n{}".format(priv_group, self.groups_)
          )
  
      if not 0.0 <= self.threshold <= 1.0:
          raise ValueError(
              "threshold must be between 0.0 and 1.0, "
              "threshold={}".format(self.threshold)
          )
  
      if (
          not 0.0
          <= self.margin
          <= min(self.threshold, 1 - self.threshold)
      ):
          raise ValueError(
              "margin must be between 0.0 and {}, margin={}"
              "".format(
                  min(self.threshold, 1 - self.threshold), self.margin
              )
          )
  
      return self
  
imports: import warnings
  import numpy
  from sklearn.base import BaseEstimator, ClassifierMixin
  from sklearn.model_selection import GridSearchCV
  from sklearn.utils.validation import check_is_fitted
  from aif360.sklearn.metrics import statistical_parity_difference
  from aif360.sklearn.metrics import average_odds_error
  from aif360.sklearn.metrics import equal_opportunity_difference
  from aif360.sklearn.metrics import disparate_impact_ratio
  from aif360.sklearn.metrics import make_scorer
  from aif360.sklearn.utils import check_groups
label_desc: Use image node_id 3 for calling the RejectOptionClassifier obj's underlying member method code with example usage: obj.fit(X, y, labels, pos_label, priv_group, sample_weight) and returns: self