class_docstr: Defines the top-level Model Analysis API.
  Use RAIInsights to analyze errors, explain the most important
  features, compute counterfactuals and run causal analysis in a
  single API.
class_docstr_tok: ["Defines","the","top-level","Model","Analysis","API",".","Use","RAIInsights","to","analyze","errors",",","explain","the","most","important","features",",","compute","counterfactuals","and","run","causal","analysis","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
      """
      large = use_entire_test_data and self._large_test is not None
      pred_y = getattr(
          self,
          self._get_model_output_name(
              purpose=MethodPurpose.PREDICTION, large=large
          ),
      )
      if large:
          test_data = self._large_test
          true_y = self._large_test[self.target_column]
      else:
          test_data = self.test
          true_y = self.test[self.target_column]
  
      X_test = test_data.drop(columns=[self.target_column])
      X_test_after_drop = self.get_test_data(X_test)
      filter_data_with_cohort = FilterDataWithCohortFilters(
          model=self.model,
          dataset=X_test_after_drop,
          features=X_test_after_drop.columns,
          categorical_features=self.categorical_features,
          categories=self._categories,
          true_y=true_y,
          pred_y=pred_y,
          model_task=self.task_type,
          classes=self._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 pickle
  import warnings
  from enum import Enum
  from pathlib import Path
  from typing import Any, List, Optional, Union
  import numpy
  import pandas
  from erroranalysis._internal.cohort_filter import FilterDataWithCohortFilters
  from erroranalysis._internal.process_categoricals import process_categoricals
  from raiutils.data_processing import convert_to_list
  from raiutils.exceptions import SystemErrorException, UserConfigValidationException
  from raiutils.models import Forecasting, ModelTask, SKLearn
  from responsibleai._interfaces import Dataset, RAIInsightsData, TabularDatasetMetadata
  from responsibleai._internal._forecasting_wrappers import _wrap_model
  from responsibleai._internal.constants import FileFormats, ManagerNames, Metadata, SerializationAttributes
  from responsibleai.feature_metadata import FeatureMetadata
  from responsibleai.managers.causal_manager import CausalManager
  from responsibleai.managers.counterfactual_manager import CounterfactualManager
  from responsibleai.managers.data_balance_manager import DataBalanceManager
  from responsibleai.managers.error_analysis_manager import ErrorAnalysisManager
  from responsibleai.managers.explainer_manager import ExplainerManager
  from responsibleai.rai_insights.rai_base_insights import RAIBaseInsights
label_desc: Use image node_id 21 for calling the RAIInsights 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