class_docstr: Lift metrics.
  
  For a given slice, the goal of the Lift metric is to assess the difference
  between the average of predictions for in-slice items differs from the average
  of background items, conditioned on ground truth. The Lift metric can be used
  to see whether the predictions on a given slice of items are, on average,
  higher/lower than the background.
  
  Use tfma.CrossSlicingSpec to define background (baseline) and in-slice items
  (comparison).
  
  Raises an exception when tfma.CrossSlicingSpec is not provided.
docstr: Initializes lift metrics.
  
  Args:
    num_buckets: Number of buckets to use. Note that the actual number of
      buckets will be num_buckets + 2 to account for the edge cases.
    left: Start of labels interval.
    right: End of labels interval.
    name: Metric name.
    ignore_out_of_bound_examples: Whether to ignore examples with label values
      falling outside of provide label interval i.e. [left, right).
code: def __init__(
      self,
      num_buckets: Optional[int] = None,
      left: Optional[float] = None,
      right: Optional[float] = None,
      name: Optional[str] = None,
      ignore_out_of_bound_examples: bool = False,
  ):
      """Initializes lift metrics.
  
      Args:
        num_buckets: Number of buckets to use. Note that the actual number of
          buckets will be num_buckets + 2 to account for the edge cases.
        left: Start of labels interval.
        right: End of labels interval.
        name: Metric name.
        ignore_out_of_bound_examples: Whether to ignore examples with label values
          falling outside of provide label interval i.e. [left, right).
      """
      if name is None:
          name = f"{LIFT_METRICS_NAME}@{num_buckets or DEFAULT_NUM_BUCKETS}"
      super().__init__(
          metric_util.merge_per_key_computations(_lift_metrics),
          num_buckets=num_buckets,
          left=left,
          right=right,
          name=name,
          ignore_out_of_bound_examples=ignore_out_of_bound_examples,
      )
  
file_path: model-analysis/tensorflow_model_analysis/addons/fairness/metrics/lift.py
imports: from typing import Any, Dict, Optional
  from tensorflow_model_analysis.metrics import calibration_histogram
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
label_desc: Use image node_id 1 to create a new Lift object from inherited base classes: metric_types with example: obj = Lift(num_buckets, left, right, name, ignore_out_of_bound_examples)