class_docstr: Operations related to the Lagrangian.
  
  Parameters
  ----------
  X : {numpy.ndarray, pandas.DataFrame}
      the training features
  sensitive_features : {numpy.ndarray, pandas.Series, pandas.DataFrame, list}
      the sensitive features to use for constraints
  y : {numpy.ndarray, pandas.Series, pandas.DataFrame, list}
      the training labels
  estimator :
      the estimator to fit in every iteration of :meth:`best_h` using a
      :meth:`fit` method with arguments `X`, `y`, and `sample_weight`
  constraints : fairlearn.reductions.Moment
      Object describing the fairness constraints. This provides the reweighting
      and relabelling.
  objective : fairlearn.reductions.Moment
      Object describing the optimization objective. The default is :code:`ErrorRate()` for
      binary classification and :code:`MeanLoss(...)` for regression.
  B : float
      bound on the L1-norm of the lambda vector
  opt_lambda : bool
      indicates whether to optimize lambda during the calculation of the
      Lagrangian; optional with default value True
  sample_weight_name : str
      Name of the argument to `estimator.fit()` which supplies the sample weights
      (defaults to `sample_weight`)
docstr: Return the value of the Lagrangian.
  
  Parameters
  ----------
  Q : {pandas.Series, callable}
      `Q` is either a series of weights summing up to 1 that indicate
      the weight of each `h` in contributing to the randomized
      predictor, or a callable corresponding to a deterministic
      `predict` function.
  lambda_vec : pandas.Series
      lambda vector
  
  Returns
  -------
  tuple
      tuple `(L, L_high, gamma, error)` where `L` is the value of the
      Lagrangian, `L_high` is the value of the Lagrangian under the best
      response of the lambda player, `gamma` is the vector of constraint
      violations, and `error` is the empirical error
docstr_tok: ["Return","the","value","of","the","Lagrangian",".","Parameters","--","--","--","--","--","Q",":","{","pandas.Series",",","callable","}","`","Q","`","is","either","a","series","of","weights","summing","up","to","1","that","indicate","the","weight","of","each","`","h","`","in","contributing","to","the","randomized","predictor",",","or","a","callable","corresponding","to","a","deterministic","`","predict","`","function",".","lambda_vec",":","pandas.Series","lambda","vector","Returns","--","--","--","-","tuple","tuple","`","(","L",",","L_high",",","gamma",",","error",")","`","where","`","L","`","is","the","value","of","the","Lagrangian",",","`","L_high","`","is","the","value","of","the","Lagrangian","under","the","best","response","of","the","lambda","player",",","`","gamma","`","is","the","vector","of","constraint","violations",",","and","`","error","`","is","the","empirical","error"]
code: def _eval(self, Q, lambda_vec):
      """Return the value of the Lagrangian.
  
      Parameters
      ----------
      Q : {pandas.Series, callable}
          `Q` is either a series of weights summing up to 1 that indicate
          the weight of each `h` in contributing to the randomized
          predictor, or a callable corresponding to a deterministic
          `predict` function.
      lambda_vec : pandas.Series
          lambda vector
  
      Returns
      -------
      tuple
          tuple `(L, L_high, gamma, error)` where `L` is the value of the
          Lagrangian, `L_high` is the value of the Lagrangian under the best
          response of the lambda player, `gamma` is the vector of constraint
          violations, and `error` is the empirical error
      """
      if callable(Q):
          error = self.obj.gamma(Q).iloc[0]
          gamma = self.constraints.gamma(Q)
      else:
          error = self.errors[Q.index].dot(Q)
          gamma = self.gammas[Q.index].dot(Q)
  
      if self.opt_lambda:
          lambda_projected = self.constraints.project_lambda(lambda_vec)
          L = error + np.sum(
              lambda_projected * (gamma - self.constraints.bound())
          )
      else:
          L = error + np.sum(
              lambda_vec * (gamma - self.constraints.bound())
          )
  
      max_constraint = (gamma - self.constraints.bound()).max()
      if max_constraint <= 0:
          L_high = error
      else:
          L_high = error + self.B * max_constraint
      return L, L_high, gamma, error
  
imports: import logging
  from time import time
  import numpy
  import pandas
  import scipy.optimize
  from sklearn import clone
  from sklearn.dummy import DummyClassifier
  from fairlearn.reductions._moments import ClassificationMoment
  from ._constants import _INDENTATION, _LINE, _PRECISION
label_desc: Use image node_id 2 for calling the _Lagrangian obj's underlying member method code with example usage: obj._eval(Q, lambda_vec) and returns: L,  L_high,  gamma,  error