class_docstr: This class computes a set of feature balance measures that allow us to see
  whether each combination of a feature is receiving the positive outcome
  (true prediction) at balanced probability.
docstr: For the column of interest, computes the individual feature balance
  measures for every unique value in the column. These measures are
  used to compute "gaps" between two classes (feature values).
  
  :param df: The df to compute individual feature balance
      measures on.
  :type df: pd.DataFrame
  :param col_of_interest: The column of interest to compute the
      individual feature balance measures on.
  :type col_of_interest: str
  :param label_col: The name of the label column.
  :type label_col: str
  :param pos_label: The label value that denotes a positive label.
  :type pos_label: str
  :return: A dataframe that contains individual feature balance measures.
  :rtype: pd.DataFrame
docstr_tok: ["For","the","column","of","interest",",","computes","the","individual","feature","balance","measures","for","every","unique","value","in","the","column",".","These","measures","are","used","to","compute","``","gaps","''","between","two","classes","(","feature","values",")",".",":","param","df",":","The","df","to","compute","individual","feature","balance","measures","on",".",":","type","df",":","pd.DataFrame",":","param","col_of_interest",":","The","column","of","interest","to","compute","the","individual","feature","balance","measures","on",".",":","type","col_of_interest",":","str",":","param","label_col",":","The","name","of","the","label","column",".",":","type","label_col",":","str",":","param","pos_label",":","The","label","value","that","denotes","a","positive","label",".",":","type","pos_label",":","str",":","return",":","A","dataframe","that","contains","individual","feature","balance","measures",".",":","rtype",":","pd.DataFrame"]
code: def _get_individual_measures(
      df: pd.DataFrame,
      col_of_interest: str,
      label_col: str,
      pos_label: str,
  ):
      """
      For the column of interest, computes the individual feature balance
      measures for every unique value in the column. These measures are
      used to compute "gaps" between two classes (feature values).
  
      :param df: The df to compute individual feature balance
          measures on.
      :type df: pd.DataFrame
      :param col_of_interest: The column of interest to compute the
          individual feature balance measures on.
      :type col_of_interest: str
      :param label_col: The name of the label column.
      :type label_col: str
      :param pos_label: The label value that denotes a positive label.
      :type pos_label: str
      :return: A dataframe that contains individual feature balance measures.
      :rtype: pd.DataFrame
      """
      num_rows = df.shape[0]
  
      p_feature_col = (
          df[col_of_interest]
          .value_counts()
          .rename(FeatureBalanceMeasures.PROB_FEATURE)
          / num_rows
      )
      p_pos_feature_col = (
          df[df[label_col].astype("str") == str(pos_label)][
              col_of_interest
          ]
          .value_counts()
          .rename(FeatureBalanceMeasures.PROB_POS_FEATURE)
          / num_rows
      ).fillna(0)
  
      new_df = pd.concat([p_feature_col, p_pos_feature_col], axis=1)
      new_df[FeatureBalanceMeasures.PROB_POSITIVE] = (
          df[df[label_col].astype("str") == str(pos_label)].shape[0]
          / num_rows
      )
  
      for (
          measure,
          func,
      ) in FeatureBalanceMeasures.FEATURE_METRICS.items():
          new_df[measure.value] = new_df.apply(
              lambda row: func(
                  row[FeatureBalanceMeasures.PROB_POSITIVE],
                  row[FeatureBalanceMeasures.PROB_FEATURE],
                  row[FeatureBalanceMeasures.PROB_POS_FEATURE],
                  num_rows,
              ),
              axis=1,
          )
  
      return new_df
  
imports: import itertools
  import warnings
  from typing import Callable, Dict, List, Tuple
  import numpy
  import pandas
  import scipy
  from responsibleai.databalanceanalysis.balance_measures import BalanceMeasures
  from responsibleai.databalanceanalysis.constants import Constants, Measures
label_desc: Use image node_id 4 for calling the FeatureBalanceMeasures obj's underlying member method code with example usage: obj._get_individual_measures(df, col_of_interest, label_col, pos_label) and returns: new_df