code: def _get_pareto_frontier(
      scores, return_mask=True
  ):  # <- Fastest for many points
      """
      :param scores: An (n_points, n_scores) array
      :param return_mask: True to return a mask, False to return integer indices of efficient points.
      :return: An array of indices of pareto-efficient points.
          If return_mask is True, this will be an (n_points, ) boolean array
          Otherwise it will be a (n_efficient_points, ) integer array of indices.
  
      adapted from: https://stackoverflow.com/questions/32791911/fast-calculation-of-pareto-front-in-python
      """
      is_efficient = np.arange(scores.shape[0])
      n_points = scores.shape[0]
      next_point_index = (
          0  # Next index in the is_efficient array to search for
      )
  
      while next_point_index < len(scores):
          nondominated_point_mask = np.any(
              scores >= scores[next_point_index], axis=1
          )
          is_efficient = is_efficient[
              nondominated_point_mask
          ]  # Remove dominated points
          scores = scores[nondominated_point_mask]
          next_point_index = (
              np.sum(nondominated_point_mask[:next_point_index]) + 1
          )
  
      if return_mask:
          is_efficient_mask = np.zeros(n_points, dtype=bool)
          is_efficient_mask[is_efficient] = True
          return is_efficient_mask
      else:
          return is_efficient
  
file_path: AIF360/aif360/algorithms/postprocessing/reject_option_classification.py
imports: import numpy
  from warnings import warn
  from aif360.algorithms import Transformer
  from aif360.metrics import utils
  from aif360.metrics import BinaryLabelDatasetMetric, ClassificationMetric
label_desc: Use image node_id 1 for calling a global function with example usage: _get_pareto_frontier(scores, return_mask) and returns: is_efficient_mask, is_efficient