class_docstr: Defines the cohort which will be injected from SDK into the Dashboard.
  :param name: Name of the cohort.
  :type name: str
class_docstr_tok: ["Defines","the","cohort","which","will","be","injected","from","SDK","into","the","Dashboard",".",":","param","name",":","Name","of","the","cohort",".",":","type","name",":","str"]
docstr: Validate the cohort and cohort filters parameters with respect to
  test data.
  
  :param test_data: Test data over which cohort analysis will be done
      in ResponsibleAI Dashboard.
  :type test_data: pd.DataFrame
  :param target_column: The target column in the test data.
  :type target_column: str
  :param categorical_features: The categorical feature names.
  :type categorical_features: list[str]
  :param is_classification: True to indicate if this validation needs
      to be done for a classification scenario and False to indicate
      that this needs to be done for regression scenario.
  :type is_classification: bool
docstr_tok: ["Validate","the","cohort","and","cohort","filters","parameters","with","respect","to","test","data",".",":","param","test_data",":","Test","data","over","which","cohort","analysis","will","be","done","in","ResponsibleAI","Dashboard",".",":","type","test_data",":","pd.DataFrame",":","param","target_column",":","The","target","column","in","the","test","data",".",":","type","target_column",":","str",":","param","categorical_features",":","The","categorical","feature","names",".",":","type","categorical_features",":","list","[","str","]",":","param","is_classification",":","True","to","indicate","if","this","validation","needs","to","be","done","for","a","classification","scenario","and","False","to","indicate","that","this","needs","to","be","done","for","regression","scenario",".",":","type","is_classification",":","bool"]
code: def _validate_with_test_data(
      self,
      test_data: pd.DataFrame,
      target_column: str,
      categorical_features: List[str],
      is_classification: Optional[bool] = True,
  ):
      """
      Validate the cohort and cohort filters parameters with respect to
      test data.
  
      :param test_data: Test data over which cohort analysis will be done
          in ResponsibleAI Dashboard.
      :type test_data: pd.DataFrame
      :param target_column: The target column in the test data.
      :type target_column: str
      :param categorical_features: The categorical feature names.
      :type categorical_features: list[str]
      :param is_classification: True to indicate if this validation needs
          to be done for a classification scenario and False to indicate
          that this needs to be done for regression scenario.
      :type is_classification: bool
      """
      if self.cohort_filter_list is None:
          return
      if not isinstance(test_data, pd.DataFrame):
          raise UserConfigValidationException(
              "The test_data should be a pandas DataFrame."
          )
      if not isinstance(target_column, str):
          raise UserConfigValidationException(
              "The target_column should be string."
          )
      if not isinstance(categorical_features, list):
          raise UserConfigValidationException(
              "Expected a list type for categorical columns."
          )
      for categorical_feature in categorical_features:
          if not isinstance(categorical_feature, str):
              raise UserConfigValidationException(
                  "Feature {0} in categorical_features need to be of "
                  "string type.".format(categorical_feature)
              )
  
      if target_column not in test_data.columns:
          raise UserConfigValidationException(
              "The target_column {0} was not found in test_data.".format(
                  target_column
              )
          )
  
      test_data_columns_set = set(test_data.columns) - set(
          [target_column]
      )
      for categorical_feature in categorical_features:
          if categorical_feature not in test_data_columns_set:
              raise UserConfigValidationException(
                  "Found categorical feature {0} which is not"
                  " present in test data.".format(categorical_feature)
              )
  
      for cohort_filter in self.cohort_filter_list:
          cohort_filter._validate_with_test_data(
              test_data=test_data,
              target_column=target_column,
              categorical_features=categorical_features,
              is_classification=is_classification,
          )
  
imports: import json
  from typing import Any, List, Optional
  import numpy
  import pandas
  from raiutils.exceptions import UserConfigValidationException
  from .constants import ClassificationOutcomes, CohortFilterMethods
label_desc: Use image node_id 8 for calling the Cohort obj's underlying member method code with example usage: obj._validate_with_test_data(test_data, target_column, categorical_features, is_classification) without return types