class_docstr: Defines the DataBalanceManager for finding data balance measures
  on a dataset.
class_docstr_tok: ["Defines","the","DataBalanceManager","for","finding","data","balance","measures","on","a","dataset","."]
docstr: Creates a DataBalanceManager object.
  
  :param train: The training data.
  :type train: pd.DataFrame
  :param test: The test data.
  :type test: pd.DataFrame
  :param target_column: The name of the target column.
  :type target_column: str
  :param classes: The classes of the target column.
  :type classes: np.ndarray
  :param task_type: The task type of the data.
  :type task_type: TaskType
docstr_tok: ["Creates","a","DataBalanceManager","object",".",":","param","train",":","The","training","data",".",":","type","train",":","pd.DataFrame",":","param","test",":","The","test","data",".",":","type","test",":","pd.DataFrame",":","param","target_column",":","The","name","of","the","target","column",".",":","type","target_column",":","str",":","param","classes",":","The","classes","of","the","target","column",".",":","type","classes",":","np.ndarray",":","param","task_type",":","The","task","type","of","the","data",".",":","type","task_type",":","TaskType"]
code: def __init__(
      self,
      train: pd.DataFrame,
      test: pd.DataFrame,
      target_column: str,
      classes: np.ndarray,
      task_type: TaskType,
  ):
      """
      Creates a DataBalanceManager object.
  
      :param train: The training data.
      :type train: pd.DataFrame
      :param test: The test data.
      :type test: pd.DataFrame
      :param target_column: The name of the target column.
      :type target_column: str
      :param classes: The classes of the target column.
      :type classes: np.ndarray
      :param task_type: The task type of the data.
      :type task_type: TaskType
      """
      self._train = train
      self._test = test
      self._target_column = target_column
      # Eagerly convert numpy array to list of strs for serialization
      self._classes = (
          list(map(str, classes)) if classes is not None else None
      )
      self._task_type = task_type
      self._is_added = False
  
      self._df = None
      if self._train is not None or self._test is not None:
          self._df = pd.concat([self._train, self._test])
  
      # Populated in add()
      self._cols_of_interest = None
  
      # Populated in compute()
      self._data_balance_measures = None
  
imports: import json
  import warnings
  from pathlib import Path
  from typing import Dict, List
  import numpy
  import pandas
  from responsibleai._interfaces import TaskType
  from responsibleai._internal.constants import DataBalanceManagerKeys
  from responsibleai._internal.constants import FileFormats, ListProperties, ManagerNames
  from responsibleai._tools.shared.state_directory_management import DirectoryManager
  from responsibleai.databalanceanalysis import AggregateBalanceMeasures, DistributionBalanceMeasures, FeatureBalanceMeasures
  from responsibleai.databalanceanalysis.data_balance_utils import prepare_df, transform_measures_to_dict
  from responsibleai.managers.base_manager import BaseManager
label_desc: Use image node_id 1 to create a new DataBalanceManager object from inherited base classes: BaseManager with example: obj = DataBalanceManager(train, test, target_column, classes, task_type)