class_docstr: A post-processing class to adjust the prediction scores based on a threshold for
  multiple groups in the dataset.
  
  Parameters
  ----------
  threshold_type : str
      The type of threshold to apply. It can be one of the following:
          - fixed: applies a fixed threshold for all samples.
          - fpr: applies a threshold to obtain a specific false positive rate.
          - tpr: applies a threshold to obtain a specific true positive rate.
          - top_pct: applies a threshold to obtain the top percentage of predicted
                     scores.
          - top_k: applies a threshold to obtain the top k predicted scores.
  threshold_value : Union[float, int]
      The value to use for the threshold, depending on the threshold_type parameter.
  
  Attributes
  ----------
  thresholds : dict[str, Threshold]
      A dictionary of Threshold objects, one for each group in the dataset.
  
  Methods
  -------
  fit(X, y_hat, y, s=None)
      Fit the threshold for each group in the dataset.
  
  transform(X, y_hat, s=None)
      Transform the prediction scores based on the threshold for each group in the
      dataset.
docstr: Initialize a new instance of the GroupThreshold class.
  
  Parameters
  ----------
  threshold_type : str
      The type of threshold to apply. It can be one of the following:
          - fixed: applies a fixed threshold for all samples.
          - fpr: applies a threshold to obtain a specific false positive rate.
          - tpr: applies a threshold to obtain a specific true positive rate.
          - top_pct: applies a threshold to obtain the top percentage of
                     predicted scores.
          - top_k: applies a threshold to obtain the top k predicted scores.
  threshold_value : Union[float, int]
      The value to use for the threshold, depending on the threshold_type
      parameter.
code: def __init__(
      self,
      threshold_type: str,
      threshold_value: Union[float, int],
  ):
      """Initialize a new instance of the GroupThreshold class.
  
      Parameters
      ----------
      threshold_type : str
          The type of threshold to apply. It can be one of the following:
              - fixed: applies a fixed threshold for all samples.
              - fpr: applies a threshold to obtain a specific false positive rate.
              - tpr: applies a threshold to obtain a specific true positive rate.
              - top_pct: applies a threshold to obtain the top percentage of
                         predicted scores.
              - top_k: applies a threshold to obtain the top k predicted scores.
      threshold_value : Union[float, int]
          The value to use for the threshold, depending on the threshold_type
          parameter.
      """
      super().__init__(threshold_type, threshold_value)
      self.logger = create_logger(
          "methods.postprocessing.GroupThreshold"
      )
      self.logger.info("Instantiating postprocessing GroupThreshold.")
      self.thresholds: dict[str, Threshold] = {}
  
file_path: aequitas/src/aequitas/fairflow/methods/postprocessing/group_threshold.py
imports: from typing import Optional, Union
  import pandas
  from ...utils import create_logger
  from .threshold import Threshold
label_desc: Use image node_id 1 to create a new GroupThreshold object from inherited base classes: Threshold with example: obj = GroupThreshold(threshold_type, threshold_value)