class_docstr: Exponentiated gradient reduction for fair classification.
  
  Exponentiated gradient reduction is an in-processing technique that reduces
  fair classification to a sequence of cost-sensitive classification problems,
  returning a randomized classifier with the lowest empirical error subject to
  fair classification constraints [#agarwal18]_.
  
  References:
      .. [#agarwal18] `A. Agarwal, A. Beygelzimer, M. Dudik, J. Langford, and
         H. Wallach, "A Reductions Approach to Fair Classification,"
         International Conference on Machine Learning, 2018.
         <https://arxiv.org/abs/1803.02453>`_
docstr: Obtain the predictions for the provided dataset using the randomized
  model learned.
  
  Args:
      dataset: (Binary label) Dataset containing labels that needs to be
          transformed.
  
  Returns:
      dataset: Transformed (Binary label) dataset.
code: def predict(self, dataset):
      """Obtain the predictions for the provided dataset using the randomized
      model learned.
  
      Args:
          dataset: (Binary label) Dataset containing labels that needs to be
              transformed.
  
      Returns:
          dataset: Transformed (Binary label) dataset.
      """
      X_df = pd.DataFrame(
          dataset.features, columns=dataset.feature_names
      )
  
      dataset_new = dataset.copy()
      dataset_new.labels = self.model.predict(X_df).reshape(-1, 1)
  
      fav = int(dataset.favorable_label)
      try:
          # Probability of favorable label
          scores = self.model.predict_proba(X_df)[:, fav]
          dataset_new.scores = scores.reshape(-1, 1)
      except (AttributeError, NotImplementedError):
          warning(
              "dataset.scores not updated, underlying model does not "
              "support predict_proba"
          )
  
      return dataset_new
  
file_path: AIF360/aif360/algorithms/inprocessing/exponentiated_gradient_reduction.py
imports: from logging import warning
  import pandas
  from aif360.algorithms import Transformer
  from aif360.sklearn.inprocessing import ExponentiatedGradientReduction
label_desc: Use image node_id 3 for calling the ExponentiatedGradientReduction obj's underlying member method code with example usage: obj.predict(dataset) and returns: dataset_new