class_docstr: A meta-estimator which wraps a given estimator with a post-processing
  step.
  
  The post-processor trains on a separate training set from the estimator to
  prevent leakage.
  
  Note:
      Because of the dataset splitting, if a Pipeline is necessary it should
      be used as the input to this meta-estimator not the other way around.
  
  Attributes:
      estimator_: Fitted estimator.
      postprocessor_: Fitted postprocessor.
      classes_ (array, shape (n_classes,)): Class labels from `estimator_`.
class_docstr_tok: ["A","meta-estimator","which","wraps","a","given","estimator","with","a","post-processing","step",".","The","post-processor","trains","on","a","separate","training","set","from","the","estimator","to","prevent","leakage",".","Note",":","Because","of","the","dataset","splitting",",","if","a","Pipeline","is","necessary","it","should","be","used","as","the","input","to","this","meta-estimator","not","the","other","way","around",".","Attributes",":","estimator_",":","Fitted","estimator",".","postprocessor_",":","Fitted","postprocessor",".","classes_","(","array",",","shape","(","n_classes",",",")",")",":","Class","labels","from","`","estimator_","`","."]
docstr: Returns the output of the post-processor's score function on the
  given test data and labels.
  
  First, runs ``self.estimator_.predict()`` (or ``predict_proba()`` if
  required) then gets the post-processed output from those predictions and
  scores it.
  
  Args:
      X (pandas.DataFrame): Test samples.
      y (array-like): True labels for X.
      sample_weight (array-like, optional): Sample weights.
  
  Returns:
      float: Score value.
docstr_tok: ["Returns","the","output","of","the","post-processor","'s","score","function","on","the","given","test","data","and","labels",".","First",",","runs","``","self.estimator_.predict","(",")","``","(","or","``","predict_proba","(",")","``","if","required",")","then","gets","the","post-processed","output","from","those","predictions","and","scores","it",".","Args",":","X","(","pandas.DataFrame",")",":","Test","samples",".","y","(","array-like",")",":","True","labels","for","X.","sample_weight","(","array-like",",","optional",")",":","Sample","weights",".","Returns",":","float",":","Score","value","."]
code: def score(self, X, y, sample_weight=None):
      """Returns the output of the post-processor's score function on the
      given test data and labels.
  
      First, runs ``self.estimator_.predict()`` (or ``predict_proba()`` if
      required) then gets the post-processed output from those predictions and
      scores it.
  
      Args:
          X (pandas.DataFrame): Test samples.
          y (array-like): True labels for X.
          sample_weight (array-like, optional): Sample weights.
  
      Returns:
          float: Score value.
      """
      use_proba = self.postprocessor_._get_tags()["requires_proba"]
      y_score = (
          self.estimator_.predict_proba(X)
          if use_proba
          else self.estimator_.predict(X)
      )
      y_score = pd.DataFrame(y_score, index=X.index).squeeze("columns")
      if sample_weight is None:
          return self.postprocessor_.score(y_score, y)
      return self.postprocessor_.score(
          y_score, y, sample_weight=sample_weight
      )
  
file_path: AIF360/aif360/sklearn/postprocessing/__init__.py
imports: from logging import warning
  import pandas
  from sklearn.base import BaseEstimator, MetaEstimatorMixin, clone
  from sklearn.model_selection import train_test_split
  from sklearn.utils.metaestimators import if_delegate_has_method
  from aif360.sklearn.postprocessing.calibrated_equalized_odds import CalibratedEqualizedOdds
  from aif360.sklearn.postprocessing.reject_option_classification import RejectOptionClassifier, RejectOptionClassifierCV
label_desc: Use image node_id 8 for calling the PostProcessingMeta obj's underlying member method code with example usage: obj.score(X, y, sample_weight) and returns: self, self