class_docstr: An Estimator which implements the exponentiated gradient reduction.
  
  The exponentiated gradient algorithm is described in detail by
  :footcite:t:`agarwal2018reductions`.
  
  Read more in the :ref:`User Guide <exponentiated_gradient>`.
  
  .. versionchanged:: 0.3.0
      Was a function before, not a class
  
  .. versionchanged:: 0.4.6
      Requires 0-1 labels for classification problems
  
  Parameters
  ----------
  estimator : estimator
      An estimator implementing methods :code:`fit(X, y, sample_weight)` and
      :code:`predict(X)`, where `X` is the matrix of features, `y` is the
      vector of labels (binary classification) or continuous values
      (regression), and `sample_weight` is a vector of weights.
      In binary classification labels `y` and predictions returned by
      :code:`predict(X)` are either 0 or 1.
      In regression values `y` and predictions are continuous.
  constraints : fairlearn.reductions.Moment
      The fairness constraints expressed as a :class:`~Moment`.
  objective : fairlearn.reductions.Moment
      The objective expressed as a :class:`~Moment`. The default is
      :code:`ErrorRate()` for binary classification and
      :code:`MeanLoss(...)` for regression.
  eps : float
      Allowed fairness constraint violation; the solution is guaranteed to
      have the error within :code:`2*best_gap` of the best error under
      constraint `eps`; the constraint violation is at most
      :code:`2*(eps+best_gap)`.
  
      .. versionchanged:: 0.5.0
          :code:`eps` is now only responsible for setting the L1 norm bound
          in the optimization
  max_iter : int
      Maximum number of iterations
  
      .. versionadded:: 0.5.0
          Used to be :code:`T`
  
  nu : float
      Convergence threshold for the duality gap, corresponding to a
      conservative automatic setting based on the statistical uncertainty
      in measuring classification error
  
  eta0 : float
      Initial setting of the learning rate
  
      .. versionadded:: 0.5.0
          Used to be :code:`eta_mul`
  
  run_linprog_step : bool
      if True each step of exponentiated gradient is followed by the saddle
      point optimization over the convex hull of classifiers returned so
      far; default True
  
      .. versionadded:: 0.5.0
  
  sample_weight_name : str
      Name of the argument to `estimator.fit()` which supplies the sample weights
      (defaults to `sample_weight`)
  
      .. versionadded:: 0.5.0
docstr: Probability mass function for the given input data.
  
  For each data point, provide the probabilities with which 0 and 1 is
  returned as a prediction.
  
  Parameters
  ----------
  X : numpy.ndarray or pandas.DataFrame
      Feature data
  
  Returns
  -------
  pandas.DataFrame
      Array of tuples with the probabilities of predicting 0 and 1.
docstr_tok: ["Probability","mass","function","for","the","given","input","data",".","For","each","data","point",",","provide","the","probabilities","with","which","0","and","1","is","returned","as","a","prediction",".","Parameters","--","--","--","--","--","X",":","numpy.ndarray","or","pandas.DataFrame","Feature","data","Returns","--","--","--","-","pandas.DataFrame","Array","of","tuples","with","the","probabilities","of","predicting","0","and","1","."]
code: def _pmf_predict(self, X):
      """Probability mass function for the given input data.
  
      For each data point, provide the probabilities with which 0 and 1 is
      returned as a prediction.
  
      Parameters
      ----------
      X : numpy.ndarray or pandas.DataFrame
          Feature data
  
      Returns
      -------
      pandas.DataFrame
          Array of tuples with the probabilities of predicting 0 and 1.
      """
      check_is_fitted(self)
  
      pred = pd.DataFrame()
      for t in range(len(self._hs)):
          if self.weights_[t] == 0:
              pred[t] = np.zeros(len(X))
          else:
              pred[t] = self._hs[t](X)
  
      if isinstance(self.constraints, ClassificationMoment):
          positive_probs = (
              pred[self.weights_.index].dot(self.weights_).to_frame()
          )
          return np.concatenate(
              (1 - positive_probs, positive_probs), axis=1
          )
      else:
          return pred
  
file_path: fairlearn/fairlearn/reductions/_exponentiated_gradient/exponentiated_gradient.py
imports: import logging
  import numpy
  import pandas
  from sklearn.base import BaseEstimator, MetaEstimatorMixin
  from sklearn.utils import check_random_state
  from sklearn.utils.validation import check_is_fitted
  from fairlearn.reductions._moments import ClassificationMoment
  from ._constants import _ACCURACY_MUL, _INDENTATION, _MIN_ITER, _PRECISION, _REGRET_CHECK_INCREASE_T, _REGRET_CHECK_START_T, _SHRINK_ETA, _SHRINK_REGRET
  from ._lagrangian import _Lagrangian
label_desc: Use image node_id 4 for calling the ExponentiatedGradient obj's underlying member method code with example usage: obj._pmf_predict(X) and returns: np, pred