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
code: def __init__(
      self,
      estimator,
      constraints,
      *,
      objective=None,
      eps=0.01,
      max_iter=50,
      nu=None,
      eta0=2.0,
      run_linprog_step=True,
      sample_weight_name="sample_weight",
  ):  # noqa: D103
      self.estimator = estimator
      self.constraints = constraints
      self.objective = objective
      self.eps = eps
      self.max_iter = max_iter
      self.nu = nu
      self.eta0 = eta0
      self.run_linprog_step = run_linprog_step
      self.sample_weight_name = sample_weight_name
  
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 1 to create a new ExponentiatedGradient object from inherited base classes: BaseEstimator, MetaEstimatorMixin with example: obj = ExponentiatedGradient(estimator, constraints)