class_docstr: Defines the top-level RAIVisionInsights API.
  
  Use RAIVisionInsights to assess vision machine learning models in a
  single API.
class_docstr_tok: ["Defines","the","top-level","RAIVisionInsights","API",".","Use","RAIVisionInsights","to","assess","vision","machine","learning","models","in","a","single","API","."]
docstr: Validate the inputs for the RAIVisionInsights constructor.
  
  :param model: The model to compute RAI insights for.
      A model that implements sklearn.predict or sklearn.predict_proba
      or function that accepts a 2d ndarray.
  :type model: object
  :param test: The test dataset including the label column.
  :type test: pandas.DataFrame
  :param target_column: The name of the label column.
  :type target_column: str
  :param task_type: The task to run, can be `classification` or
      `regression`.
  :type task_type: str
  :param classes: The class labels in the dataset.
  :type classes: numpy.ndarray
  :param serializer: Picklable custom serializer with save and load
      methods defined for model that is not serializable. The save
      method returns a dictionary state and load method returns the
      model.
  :type serializer: object
  :param maximum_rows_for_test: Limit on size of test data
      (for performance reasons)
  :type maximum_rows_for_test: int
docstr_tok: ["Validate","the","inputs","for","the","RAIVisionInsights","constructor",".",":","param","model",":","The","model","to","compute","RAI","insights","for",".","A","model","that","implements","sklearn.predict","or","sklearn.predict_proba","or","function","that","accepts","a","2d","ndarray",".",":","type","model",":","object",":","param","test",":","The","test","dataset","including","the","label","column",".",":","type","test",":","pandas.DataFrame",":","param","target_column",":","The","name","of","the","label","column",".",":","type","target_column",":","str",":","param","task_type",":","The","task","to","run",",","can","be","`","classification","`","or","`","regression","`",".",":","type","task_type",":","str",":","param","classes",":","The","class","labels","in","the","dataset",".",":","type","classes",":","numpy.ndarray",":","param","serializer",":","Picklable","custom","serializer","with","save","and","load","methods","defined","for","model","that","is","not","serializable",".","The","save","method","returns","a","dictionary","state","and","load","method","returns","the","model",".",":","type","serializer",":","object",":","param","maximum_rows_for_test",":","Limit","on","size","of","test","data","(","for","performance","reasons",")",":","type","maximum_rows_for_test",":","int"]
code: def _validate_rai_insights_input_parameters(
      self,
      model: Any,
      test: pd.DataFrame,
      target_column: str,
      task_type: str,
      classes: np.ndarray,
      serializer,
      maximum_rows_for_test: int,
  ):
      """Validate the inputs for the RAIVisionInsights constructor.
  
      :param model: The model to compute RAI insights for.
          A model that implements sklearn.predict or sklearn.predict_proba
          or function that accepts a 2d ndarray.
      :type model: object
      :param test: The test dataset including the label column.
      :type test: pandas.DataFrame
      :param target_column: The name of the label column.
      :type target_column: str
      :param task_type: The task to run, can be `classification` or
          `regression`.
      :type task_type: str
      :param classes: The class labels in the dataset.
      :type classes: numpy.ndarray
      :param serializer: Picklable custom serializer with save and load
          methods defined for model that is not serializable. The save
          method returns a dictionary state and load method returns the
          model.
      :type serializer: object
      :param maximum_rows_for_test: Limit on size of test data
          (for performance reasons)
      :type maximum_rows_for_test: int
      """
      valid_tasks = [
          ModelTask.IMAGE_CLASSIFICATION.value,
          ModelTask.MULTILABEL_IMAGE_CLASSIFICATION.value,
          ModelTask.OBJECT_DETECTION.value,
      ]
  
      if task_type not in valid_tasks:
          message = (
              f"Unsupported task type '{task_type}'. "
              f"Should be one of {valid_tasks}"
          )
          raise UserConfigValidationException(message)
  
      if model is None:
          warnings.warn(
              "INVALID-MODEL-WARNING: No valid model is supplied. "
              "Explanations will not work"
          )
  
      if serializer is not None:
          if not hasattr(serializer, "save"):
              raise UserConfigValidationException(
                  "The serializer does not implement save()"
              )
  
          if not hasattr(serializer, "load"):
              raise UserConfigValidationException(
                  "The serializer does not implement load()"
              )
  
          try:
              pickle.dumps(serializer)
          except Exception:
              raise UserConfigValidationException(
                  "The serializer should be serializable via pickle"
              )
  
      test_is_pd = isinstance(test, pd.DataFrame)
      if not test_is_pd:
          raise UserConfigValidationException(
              "Unsupported data type for test dataset. "
              "Expecting pandas DataFrame."
          )
  
      if test.shape[0] > maximum_rows_for_test:
          msg_fmt = (
              "The test data has {0} rows, "
              + "but limit is set to {1} rows. "
              + "Please resample the test data or "
              + "adjust maximum_rows_for_test"
          )
          raise UserConfigValidationException(
              msg_fmt.format(test.shape[0], maximum_rows_for_test)
          )
  
      if task_type == ModelTask.MULTILABEL_IMAGE_CLASSIFICATION.value:
          if not isinstance(target_column, list):
              raise UserConfigValidationException(
                  "The target_column should be a list for multilabel "
                  "classification"
              )
          # check all target columns are present in test dataset
          target_columns_set = set(target_column)
          if not target_columns_set.issubset(set(test.columns)):
              raise UserConfigValidationException(
                  "The list of target_column(s) should be in test data"
              )
      else:
          if target_column not in list(test.columns):
              raise UserConfigValidationException(
                  "Target name {0} not present in test data".format(
                      target_column
                  )
              )
  
      if model is not None:
          # Pick one row from test data
          test_img = self._get_single_image(test, target_column)
          # Call the model
          try:
              model.predict(test_img)
          except Exception:
              raise UserConfigValidationException(
                  "The model passed cannot be used for"
                  " getting predictions via predict()"
              )
  
imports: import base64
  import io
  import json
  import os
  import pickle
  import shutil
  import warnings
  from collections import defaultdict
  from enum import Enum
  from pathlib import Path
  from typing import Any, Optional
  import matplotlib.pyplot
  import numpy
  import pandas
  import torch
  from ml_wrappers import wrap_model
  from ml_wrappers.common.constants import Device
  from torchmetrics.detection.mean_ap import MeanAveragePrecision
  from vision_explanation_methods.error_labeling.error_labeling import ErrorLabeling, ErrorLabelType
  from erroranalysis._internal.cohort_filter import FilterDataWithCohortFilters
  from raiutils.data_processing import convert_to_list
  from raiutils.models.model_utils import SKLearn
  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.serialization_utilities import serialize_json_safe
  from responsibleai_vision.common.constants import CommonTags, ExplainabilityDefaults, ImageColumns, ImageModes, MLFlowSchemaLiterals, ModelTask
  from responsibleai_vision.managers.error_analysis_manager import ErrorAnalysisManager
  from responsibleai_vision.managers.explainer_manager import ExplainerManager
  from responsibleai_vision.utils.feature_extractors import extract_features
  from responsibleai_vision.utils.image_reader import get_base64_string_from_path, get_image_from_path, is_automl_image_model
  from responsibleai_vision.utils.image_utils import convert_images, get_images, transform_object_detection_labels
label_desc: Use image node_id 5 for calling the RAIVisionInsights obj's underlying member method code with example usage: obj._validate_rai_insights_input_parameters(model, test, target_column, task_type, classes, serializer, maximum_rows_for_test) without return types