code: def test_argument_types_ratio_bound(
      self, transformX, transformY, transformA, A_two_dim
  ):
      # This is an expanded-out version of one of the smoke tests
      X, y, A = _get_data(A_two_dim)
      merged_A = _map_into_single_column(A)
  
      transformed_X = transformX(X)
      transformed_y = transformY(y)
      transformed_A = transformA(A)
      eps = 0.1
      ratio = 1.0
  
      expgrad = ExponentiatedGradient(
          LeastSquaresBinaryClassifierLearner(),
          constraints=DemographicParity(
              ratio_bound_slack=eps, ratio_bound=ratio
          ),
          eps=eps,
      )
      expgrad.fit(
          transformed_X, transformed_y, sensitive_features=transformed_A
      )
  
      def Q(X):
          return expgrad._pmf_predict(X)[:, 1]
  
      n_predictors = len(expgrad.predictors_)
  
      disparity_moment = DemographicParity(
          ratio_bound_slack=eps, ratio_bound=ratio
      )
      disparity_moment.load_data(X, y, sensitive_features=merged_A)
      error = ErrorRate()
      error.load_data(X, y, sensitive_features=merged_A)
      disparity = disparity_moment.gamma(Q).max()
      disp = disparity_moment.gamma(Q)
      disp_eps = disparity_moment.gamma(Q) - disparity_moment.bound()
      error = error.gamma(Q).iloc[0]
  
      assert expgrad.best_gap_ == pytest.approx(0.0000, abs=_PRECISION)
      assert expgrad.last_iter_ == 5
      assert expgrad.best_iter_ == 5
      assert disparity == pytest.approx(0.1, abs=_PRECISION)
      assert np.all(np.isclose(disp - eps, disp_eps))
      assert error == pytest.approx(0.25, abs=_PRECISION)
      assert expgrad.n_oracle_calls_ == 32
      assert n_predictors == 3
  
file_path: fairlearn/test/unit/reductions/exponentiated_gradient/test_exponentiatedgradient_arguments.py
imports: from test.unit.input_convertors import _map_into_single_column, conversions_for_1d, ensure_dataframe, ensure_ndarray
  from test.unit.reductions.conftest import is_invalid_transformation
  import numpy
  import pandas
  import pytest
  from sklearn.linear_model import LogisticRegression
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import StandardScaler
  from fairlearn.reductions import DemographicParity, ErrorRate, ExponentiatedGradient
  from fairlearn.utils._input_validation import _LABELS_NOT_0_1_ERROR_MESSAGE
  from .simple_learners import LeastSquaresBinaryClassifierLearner
  from .test_utilities import _get_data
label_desc: Use image node_id 2 for calling the TestExponentiatedGradientArguments obj's underlying member method code with example usage: obj.test_argument_types_ratio_bound(transformX, transformY, transformA, A_two_dim) and returns: expgrad