class_docstr: Binary predictor that thresholds continuous predictions of a base estimator.
  
  At prediction time, the predictor takes as input both standard and sensitive features.
  Based on the values of sensitive features, it then applies a randomized thresholding
  transformation according to the provided `interpolation_dict`.
  
  Read more in the :ref:`User Guide <postprocessing>`.
  
  Parameters
  ----------
  estimator :
      base estimator
  
  interpolation_dict : dict
      maps sensitive feature values to `Bunch` that describes the
      interpolation transformation via the following fields:
  
      - p0, operation0: with probability p0, operation0 is executed
      - p1, operation1: with probability p1, operation1 is executed
      - p_ignore, prediction_constant: two optional fields; if present then the result of
        the draw of operation0 or operation1 is kept with probability 1 - p_ignore, and gets
        replaced by prediction_constant with probability p_ignore.
  
      The numbers p0 and p1 must be non-negative and add up to 1, operation0 and
      operation1 must be instances of :class:`ThresholdOperation`, and p_ignore must be
      between 0 and 1.
  
  prefit : bool
      if `True` then the base estimator is not fitted in :meth:`fit`.
  
  predict_method : {'auto', 'predict_proba', 'decision_function', 'predict'\
          }, default='auto'
  
      Defines which method of the ``estimator`` is used to get the output
      values.
  
      - 'auto': use one of ``predict_proba``, ``decision_function``, or
        ``predict``, in that order.
      - 'predict_proba': use the second column from the output of
        `predict_proba`. It is assumed that the second column represents the
        positive outcome.
      - 'decision_function': use the raw values given by the
        `decision_function`.
      - 'predict': use the hard values reported by the `predict` method if
        estimator is a classifier, and the regression values if estimator is
        a regressor.
        This is equivalent to what is done in :footcite:`hardt2016equality`.
  
      .. versionadded:: 0.7
          In previous versions only the ``predict`` method was used
          implicitly.
  
      .. versionchanged:: 0.7
          From version 0.7, 'predict' is deprecated as the default value and
          the default will change to 'auto' from v0.10.
  
  References
  ----------
  .. footbibliography::
class_docstr_tok: ["Binary","predictor","that","thresholds","continuous","predictions","of","a","base","estimator",".","At","prediction","time",",","the","predictor","takes","as","input","both","standard","and","sensitive","features",".","Based","on","the","values","of","sensitive","features",",","it","then","applies","a","randomized","thresholding","transformation","according","to","the","provided","`","interpolation_dict","`",".","Read","more","in","the",":","ref",":","`","User","Guide","<","postprocessing",">","`",".","Parameters","--","--","--","--","--","estimator",":","base","estimator","interpolation_dict",":","dict","maps","sensitive","feature","values","to","`","Bunch","`","that","describes","the","interpolation","transformation","via","the","following","fields",":","-","p0",",","operation0",":","with","probability","p0",",","operation0","is","executed","-","p1",",","operation1",":","with","probability","p1",",","operation1","is","executed","-","p_ignore",",","prediction_constant",":","two","optional","fields",";","if","present","then","the","result","of","the","draw","of","operation0","or","operation1","is","kept","with","probability","1","-","p_ignore",",","and","gets","replaced","by","prediction_constant","with","probability","p_ignore",".","The","numbers","p0","and","p1","must","be","non-negative","and","add","up","to","1",",","operation0","and","operation1","must","be","instances","of",":","class",":","`","ThresholdOperation","`",",","and","p_ignore","must","be","between","0","and","1.","prefit",":","bool","if","`","True","`","then","the","base","estimator","is","not","fitted","in",":","meth",":","`","fit","`",".","predict_method",":","{","'auto","'",",","'predict_proba","'",",","'decision_function","'",",","'predict'\\","}",",","default='auto'","Defines","which","method","of","the","``","estimator","``","is","used","to","get","the","output","values",".","-","'auto","'",":","use","one","of","``","predict_proba","``",",","``","decision_function","``",",","or","``","predict","``",",","in","that","order",".","-","'predict_proba","'",":","use","the","second","column","from","the","output","of","`","predict_proba","`",".","It","is","assumed","that","the","second","column","represents","the","positive","outcome",".","-","'decision_function","'",":","use","the","raw","values","given","by","the","`","decision_function","`",".","-","'predict","'",":","use","the","hard","values","reported","by","the","`","predict","`","method","if","estimator","is","a","classifier",",","and","the","regression","values","if","estimator","is","a","regressor",".","This","is","equivalent","to","what","is","done","in",":","footcite",":","`","hardt2016equality","`",".","..","versionadded",":",":","0.7","In","previous","versions","only","the","``","predict","``","method","was","used","implicitly",".","..","versionchanged",":",":","0.7","From","version","0.7",",","'predict","'","is","deprecated","as","the","default","value","and","the","default","will","change","to","'auto","'","from","v0.10",".","References","--","--","--","--","--","..","footbibliography",":",":"]
code: def __init__(
      self,
      estimator,
      interpolation_dict,
      prefit=False,
      predict_method="deprecated",
  ):
      self.estimator = estimator
      self.interpolation_dict = interpolation_dict
      self.prefit = prefit
      self.predict_method = predict_method
  
file_path: fairlearn/fairlearn/postprocessing/_interpolated_thresholder.py
imports: from warnings import warn
  import numpy
  from sklearn import clone
  from sklearn.base import BaseEstimator, MetaEstimatorMixin
  from sklearn.exceptions import NotFittedError
  from sklearn.utils import check_random_state
  from sklearn.utils.validation import check_is_fitted
  from ..utils._common import _get_soft_predictions
  from ..utils._input_validation import _validate_and_reformat_input
  from ._constants import BASE_ESTIMATOR_NONE_ERROR_MESSAGE, BASE_ESTIMATOR_NOT_FITTED_WARNING
label_desc: Use image node_id 1 to create a new InterpolatedThresholder object from inherited base classes: BaseEstimator, MetaEstimatorMixin with example: obj = InterpolatedThresholder(estimator, interpolation_dict, prefit, predict_method)