code: def run_smoke_test_binary_classification(self, data, flipped=False):
      learner = LeastSquaresBinaryClassifierLearner()
      if "ratio" in data.keys():
          disparity_moment = data["constraint_class"](
              ratio_bound_slack=data["eps"], ratio_bound=data["ratio"]
          )
      else:
          disparity_moment = data["constraint_class"](
              difference_bound=data["eps"]
          )
      if "objective" in data.keys():
          objective_moment = deepcopy(data["objective"])
      else:
          objective_moment = ErrorRate()
  
      # Create Exponentiated Gradient object with a copy of the constraint.
      # The original disparity_moment object is used for validation, so the
      # assumption is that the moment logic is correct in these tests.
      expgrad = ExponentiatedGradient(
          learner,
          constraints=deepcopy(disparity_moment),
          objective=deepcopy(objective_moment),
          eps=data["eps"],
      )
  
      X, y, A = _get_data(A_two_dim=False, flip_y=flipped)
  
      expgrad.fit(X, y, sensitive_features=A)
  
      self._assert_expgrad_state(expgrad, data)
  
      # select probability of predicting 1
      def Q(X):
          return expgrad._pmf_predict(X)[:, 1]
  
      disparity_moment.load_data(X, y, sensitive_features=A)
      objective_moment.load_data(X, y, sensitive_features=A)
      disparity = disparity_moment.gamma(Q).max()
      error = objective_moment.gamma(Q).iloc[0]
      assert disparity == pytest.approx(data["disp"], abs=_PRECISION)
      assert error == pytest.approx(data["error"], abs=_PRECISION)
  
imports: from copy import deepcopy
  import numpy
  import pandas
  import pytest
  from sklearn.dummy import DummyClassifier
  from sklearn.linear_model import LogisticRegression
  from fairlearn.reductions import AbsoluteLoss, BoundedGroupLoss, DemographicParity, EqualizedOdds, ErrorRate, ErrorRateParity, ExponentiatedGradient, FalsePositiveRateParity, SquareLoss, TruePositiveRateParity, ZeroOneLoss
  from fairlearn.reductions._exponentiated_gradient._constants import _MIN_ITER
  from fairlearn.reductions._moments.bounded_group_loss import MeanLoss
  from .simple_learners import LeastSquaresBinaryClassifierLearner, LeastSquaresRegressor
  from .test_utilities import _get_data
label_desc: Use image node_id 1 for calling the TestExponentiatedGradientSmoke obj's underlying member method code with example usage: obj.run_smoke_test_binary_classification(data, flipped) and returns: expgrad