class_docstr: Contain processed input for model comparison checks.
class_docstr_tok: ["Contain","processed","input","for","model","comparison","checks","."]
docstr: Preprocess the parameters.
docstr_tok: ["Preprocess","the","parameters","."]
code: def __init__(
      self,
      train_datasets: Union[Dataset, List[Dataset]],
      test_datasets: Union[Dataset, List[Dataset]],
      models: Union[List[Any], Mapping[str, Any]],
  ):
      """Preprocess the parameters."""
      # Validations
      if isinstance(train_datasets, Dataset) and isinstance(
          test_datasets, List
      ):
          raise DeepchecksNotSupportedError(
              "Single train dataset with multiple test datasets is not supported."
          )
  
      if not isinstance(models, (List, Mapping)):
          raise DeepchecksValueError(
              "`models` must be a list or dictionary for compare models checks."
          )
      if len(models) < 2:
          raise DeepchecksValueError(
              "`models` must receive 2 or more models"
          )
      # Some logic to assign names to models
      if isinstance(models, List):
          models_dict = {}
          for m in models:
              model_type = type(m).__name__
              numerator = 1
              name = model_type
              while name in models_dict:
                  name = f"{model_type}_{numerator}"
                  numerator += 1
              models_dict[name] = m
          models = models_dict
  
      if not isinstance(train_datasets, List):
          train_datasets = [train_datasets] * len(models)
      if not isinstance(test_datasets, List):
          test_datasets = [test_datasets] * len(models)
  
      if len(train_datasets) != len(models):
          raise DeepchecksValueError(
              "number of train_datasets must equal to number of models"
          )
      if len(test_datasets) != len(models):
          raise DeepchecksValueError(
              "number of test_datasets must equal to number of models"
          )
  
      # Additional validations
      self.task_type = None
      self.contexts = []
      for i in range(len(models)):
          train = train_datasets[i]
          test = test_datasets[i]
          model = list(models.values())[i]
          context = Context(train, test, model)
          if self.task_type is None:
              self.task_type = context.task_type
          elif self.task_type != context.task_type:
              raise DeepchecksNotSupportedError(
                  "Got models of different task types"
              )
          self.contexts.append(context)
      self._models = models
  
file_path: deepchecks/deepchecks/tabular/model_base.py
imports: from typing import Any, Dict, List, Mapping, Tuple, Union
  from deepchecks.core.check_result import CheckFailure, CheckResult
  from deepchecks.core.errors import DeepchecksNotSupportedError, DeepchecksValueError
  from deepchecks.core.suite import BaseSuite, SuiteResult
  from deepchecks.tabular.context import Context
  from deepchecks.tabular.dataset import Dataset
  from deepchecks.utils.ipython import create_progress_bar
label_desc: Use image node_id 1 to create a new ModelComparisonContext object  with example: obj = ModelComparisonContext(train_datasets, test_datasets, models)