docstr: Filters the dataset on the model based on the specified filters.
  
  :param filters: The filters.
  :type filters: list[dict]
  :param composite_filters: The composite filters.
  :type composite_filters: list[dict]
  :return: The filtered dataset converted to a pandas DataFrame.
  :param include_original_columns_only: Whether to just include
                                        the original data columns.
  :type include_original_columns_only: bool
  :rtype: pandas.DataFrame
docstr_tok: ["Filters","the","dataset","on","the","model","based","on","the","specified","filters",".",":","param","filters",":","The","filters",".",":","type","filters",":","list","[","dict","]",":","param","composite_filters",":","The","composite","filters",".",":","type","composite_filters",":","list","[","dict","]",":","return",":","The","filtered","dataset","converted","to","a","pandas","DataFrame",".",":","param","include_original_columns_only",":","Whether","to","just","include","the","original","data","columns",".",":","type","include_original_columns_only",":","bool",":","rtype",":","pandas.DataFrame"]
code: def filter_data_from_cohort(
      self,
      filters,
      composite_filters,
      include_original_columns_only=False,
  ):
      """Filters the dataset on the model based on the specified filters.
  
      :param filters: The filters.
      :type filters: list[dict]
      :param composite_filters: The composite filters.
      :type composite_filters: list[dict]
      :return: The filtered dataset converted to a pandas DataFrame.
      :param include_original_columns_only: Whether to just include
                                            the original data columns.
      :type include_original_columns_only: bool
      :rtype: pandas.DataFrame
      """
      df = self.dataset
      if not is_spark(df):
          if not isinstance(df, pd.DataFrame):
              df = pd.DataFrame(df, columns=self.features)
          else:
              # Note: we make a non-deep copy of the input DataFrame since
              # we will add columns below
              df = df.copy()
      self._add_filter_cols(df, filters)
      df = self._apply_recursive_filter(
          df, filters, self.categorical_features, self.categories
      )
      df = self._apply_recursive_filter(
          df,
          composite_filters,
          self.categorical_features,
          self.categories,
      )
      df = self._post_process_df(
          df,
          include_original_columns_only=include_original_columns_only,
      )
      return df
  
file_path: responsible-ai-toolbox/erroranalysis/erroranalysis/_internal/cohort_filter.py
imports: from typing import Any, List, Optional
  import numpy
  import pandas
  from erroranalysis._internal.constants import ARG, COLUMN, COMPOSITE_FILTERS, METHOD, OPERATION, PRED_Y, ROW_INDEX, TRUE_Y, CohortFilterMethods, CohortFilterOps, ModelTask
  from erroranalysis._internal.metrics import get_ordered_classes
  from erroranalysis._internal.utils import is_spark
label_desc: Use image node_id 2 for calling the FilterDataWithCohortFilters obj's underlying member method code with example usage: obj.filter_data_from_cohort(filters, composite_filters, include_original_columns_only) and returns: df