code: def compute_bias_metrics_for_model(
      dataset, subgroups, model, label_col
  ):
      """Computes per-subgroup metrics for all subgroups and one model."""
      records = []
      for subgroup in subgroups:
          record = {
              "subgroup": subgroup,
              "subgroup_size": len(dataset[dataset[subgroup]]),
          }
          record[SUBGROUP_AUC] = compute_subgroup_auc(
              dataset, subgroup, label_col, model
          )
          record[BPSN_AUC] = compute_bpsn_auc(
              dataset, subgroup, label_col, model
          )
          record[BNSP_AUC] = compute_bnsp_auc(
              dataset, subgroup, label_col, model
          )
          records.append(record)
      return pd.DataFrame(records).sort_values(
          "subgroup_auc", ascending=True
      )
  
file_path: detoxify/model_eval/compute_bias_metric.py
imports: import argparse
  import json
  import numpy
  import pandas
  from sklearn.metrics import roc_auc_score
  from utils import compute_auc, compute_subgroup_auc
label_desc: Use image node_id 3 for calling a global function with example usage: compute_bias_metrics_for_model(dataset, subgroups, model, label_col) and returns: pd