class_docstr: Calculates absolute metrics for a given dataframe with model scores and
  labels, divided by different values on protected attributes.
  
  Attributes
  ----------
  absolute_metrics : List[str]
      Calculated bias metrics.
  
  Methods
  -------
  get_crosstabs(df, score_thresholds=None, attr_cols=None, score_col="score", label_col="label_value")
      Calculates metrics for a given dataframe.
  get_multimodel_crosstabs(df, score_thresholds=None, attr_cols=None, score_col="score", label_col="label_value")
      Calculates metrics for a given dataframe with multiple models.
class_docstr_tok: ["Calculates","absolute","metrics","for","a","given","dataframe","with","model","scores","and","labels",",","divided","by","different","values","on","protected","attributes",".","Attributes","--","--","--","--","--","absolute_metrics",":","List","[","str","]","Calculated","bias","metrics",".","Methods","--","--","--","-","get_crosstabs","(","df",",","score_thresholds=None",",","attr_cols=None",",","score_col=","''","score","''",",","label_col=","''","label_value","''",")","Calculates","metrics","for","a","given","dataframe",".","get_multimodel_crosstabs","(","df",",","score_thresholds=None",",","attr_cols=None",",","score_col=","''","score","''",",","label_col=","''","label_value","''",")","Calculates","metrics","for","a","given","dataframe","with","multiple","models","."]
docstr: Returns the model id in a dataframe.
  
  Parameters
  ----------
  df : pandas.DataFrame
      Predictions of a model. Might have or not the column "model_id".
  method_table_name: str
      Reference name of the dataframe for error message.
  
  Returns
  -------
  int
      The model id. 0 if no model id column exists.
docstr_tok: ["Returns","the","model","id","in","a","dataframe",".","Parameters","--","--","--","--","--","df",":","pandas.DataFrame","Predictions","of","a","model",".","Might","have","or","not","the","column","``","model_id","''",".","method_table_name",":","str","Reference","name","of","the","dataframe","for","error","message",".","Returns","--","--","--","-","int","The","model","id",".","0","if","no","model","id","column","exists","."]
code: def _check_model_id(
      df: pd.DataFrame, method_table_name: str = "df"
  ) -> int:
      """
      Returns the model id in a dataframe.
  
      Parameters
      ----------
      df : pandas.DataFrame
          Predictions of a model. Might have or not the column "model_id".
      method_table_name: str
          Reference name of the dataframe for error message.
  
      Returns
      -------
      int
          The model id. 0 if no model id column exists.
      """
      if "model_id" in df.columns:
          df_models = df.model_id.unique()
          if len(df_models) != 1:
              raise ValueError(
                  "This method requires one and only one model_id in the "
                  "dataframe. "
                  f"Tip: Check that {method_table_name}.model_id.unique() "
                  "only returns an one-element array. "
              )
          else:
              return df_models[0]
      else:
          return 0
  
file_path: aequitas/src/aequitas/group.py
imports: import logging
  import uuid
  from typing import Any, Dict, List, Tuple, Union
  from collections import OrderedDict
  import numpy
  import pandas
  from .bias import Bias
  from .plot import summary, disparity, absolute
label_desc: Use image node_id 3 for calling the Group obj's underlying member method code with example usage: obj._check_model_id(df, method_table_name) and returns: int, df_models