class_docstr: Defines the top-level RAITextInsights API.
  
  Use RAITextInsights to assess text machine learning models in a
  single API.
class_docstr_tok: ["Defines","the","top-level","RAITextInsights","API",".","Use","RAITextInsights","to","assess","text","machine","learning","models","in","a","single","API","."]
docstr: Get the filtered test data based on cohort filters.
  
  :param filters: The filters to apply.
  :type filters: list[Filter]
  :param composite_filters: The composite filters to apply.
  :type composite_filters: list[CompositeFilter]
  :param include_original_columns_only: Whether to return the original
                                        data columns.
  :type include_original_columns_only: bool
  :param use_entire_test_data: Whether to use entire test set for
                               filtering the data based on cohort.
  :type use_entire_test_data: bool
  :return: The filtered test data.
  :rtype: pandas.DataFrame
docstr_tok: ["Get","the","filtered","test","data","based","on","cohort","filters",".",":","param","filters",":","The","filters","to","apply",".",":","type","filters",":","list","[","Filter","]",":","param","composite_filters",":","The","composite","filters","to","apply",".",":","type","composite_filters",":","list","[","CompositeFilter","]",":","param","include_original_columns_only",":","Whether","to","return","the","original","data","columns",".",":","type","include_original_columns_only",":","bool",":","param","use_entire_test_data",":","Whether","to","use","entire","test","set","for","filtering","the","data","based","on","cohort",".",":","type","use_entire_test_data",":","bool",":","return",":","The","filtered","test","data",".",":","rtype",":","pandas.DataFrame"]
code: def get_filtered_test_data(
      self,
      filters,
      composite_filters,
      include_original_columns_only=False,
      use_entire_test_data=False,
  ):
      """Get the filtered test data based on cohort filters.
  
      :param filters: The filters to apply.
      :type filters: list[Filter]
      :param composite_filters: The composite filters to apply.
      :type composite_filters: list[CompositeFilter]
      :param include_original_columns_only: Whether to return the original
                                            data columns.
      :type include_original_columns_only: bool
      :param use_entire_test_data: Whether to use entire test set for
                                   filtering the data based on cohort.
      :type use_entire_test_data: bool
      :return: The filtered test data.
      :rtype: pandas.DataFrame
      """
      model_analyzer = self._error_analysis_manager._analyzer
      dataset = model_analyzer.dataset
      model = model_analyzer.model
      if self.predict_output is None:
          # Cache predictions of the model
          self.predict_output = model_analyzer.model.predict(dataset)
      pred_y = self.predict_output
      true_y = model_analyzer.true_y
      categorical_features = model_analyzer.categorical_features
      categories = model_analyzer.categories
      classes = model_analyzer.classes
      model_task = model_analyzer.model_task
  
      filter_data_with_cohort = FilterDataWithCohortFilters(
          model=model,
          dataset=dataset,
          features=dataset.columns,
          categorical_features=categorical_features,
          categories=categories,
          true_y=true_y,
          pred_y=pred_y,
          model_task=model_task,
          classes=classes,
      )
  
      return filter_data_with_cohort.filter_data_from_cohort(
          filters=filters,
          composite_filters=composite_filters,
          include_original_columns_only=include_original_columns_only,
      )
  
imports: import json
  import logging
  import pickle
  import warnings
  from enum import Enum
  from pathlib import Path
  from typing import Any, List, Optional, Union
  import numpy
  import pandas
  from ml_wrappers import wrap_model
  from erroranalysis._internal.cohort_filter import FilterDataWithCohortFilters
  from raiutils.data_processing import convert_to_list, serialize_json_safe
  from raiutils.models import SKLearn, is_classifier
  from responsibleai._interfaces import Dataset, RAIInsightsData
  from responsibleai._internal.constants import ManagerNames, Metadata, SerializationAttributes
  from responsibleai.exceptions import UserConfigValidationException
  from responsibleai.feature_metadata import FeatureMetadata
  from responsibleai.rai_insights.rai_base_insights import RAIBaseInsights
  from responsibleai_text.common.constants import ModelTask
  from responsibleai_text.managers.error_analysis_manager import ErrorAnalysisManager
  from responsibleai_text.managers.explainer_manager import ExplainerManager
  from responsibleai_text.utils.feature_extractors import extract_features, get_text_columns
label_desc: Use image node_id 7 for calling the RAITextInsights obj's underlying member method code with example usage: obj.get_filtered_test_data(filters, composite_filters, include_original_columns_only, use_entire_test_data) and returns: filter_data_with_cohort