class_docstr: Class for computing metrics based on a single
  :obj:`~aif360.datasets.BinaryLabelDataset`.
class_docstr_tok: ["Class","for","computing","metrics","based","on","a","single",":","obj",":","`","~aif360.datasets.BinaryLabelDataset","`","."]
docstr: Dirichlet-smoothed base rates for each intersecting group in the
  dataset.
docstr_tok: ["Dirichlet-smoothed","base","rates","for","each","intersecting","group","in","the","dataset","."]
code: def _smoothed_base_rates(self, labels, concentration=1.0):
      """Dirichlet-smoothed base rates for each intersecting group in the
      dataset.
      """
      # Dirichlet smoothing parameters
      if concentration < 0:
          raise ValueError(
              "Concentration parameter must be non-negative."
          )
      num_classes = 2  # binary label dataset
      dirichlet_alpha = concentration / num_classes
  
      # compute counts for all intersecting groups, e.g. black-women, white-man, etc
      intersect_groups = np.unique(
          self.dataset.protected_attributes, axis=0
      )
      num_intersects = len(intersect_groups)
      counts_pos = np.zeros(num_intersects)
      counts_total = np.zeros(num_intersects)
      for i in range(num_intersects):
          condition = [
              dict(
                  zip(
                      self.dataset.protected_attribute_names,
                      intersect_groups[i],
                  )
              )
          ]
          counts_total[i] = utils.compute_num_instances(
              self.dataset.protected_attributes,
              self.dataset.instance_weights,
              self.dataset.protected_attribute_names,
              condition=condition,
          )
          counts_pos[i] = utils.compute_num_pos_neg(
              self.dataset.protected_attributes,
              labels,
              self.dataset.instance_weights,
              self.dataset.protected_attribute_names,
              self.dataset.favorable_label,
              condition=condition,
          )
  
      # probability of y given S (p(y=1|S))
      return (counts_pos + dirichlet_alpha) / (
          counts_total + concentration
      )
  
imports: import numpy
  from sklearn.neighbors import NearestNeighbors
  from aif360.algorithms.inprocessing.gerryfair.auditor import Auditor
  from aif360.datasets import BinaryLabelDataset
  from aif360.datasets.multiclass_label_dataset import MulticlassLabelDataset
  from aif360.metrics import DatasetMetric, utils
  from aif360.algorithms.inprocessing.gerryfair.clean import *
label_desc: Use image node_id 8 for calling the BinaryLabelDatasetMetric obj's underlying member method code with example usage: obj._smoothed_base_rates(labels, concentration) and returns: unknown