class_docstr: Verify test dataset size comparing it to the train dataset size.
class_docstr_tok: ["Verify","test","dataset","size","comparing","it","to","the","train","dataset","size","."]
docstr: Add condition verifying that train dataset is greater than test dataset.
  
  Returns
  -------
  Self
      current instance of the DatasetsSizeComparison check.
docstr_tok: ["Add","condition","verifying","that","train","dataset","is","greater","than","test","dataset",".","Returns","--","--","--","-","Self","current","instance","of","the","DatasetsSizeComparison","check","."]
code: def add_condition_train_dataset_greater_or_equal_test(self: T) -> T:
      """Add condition verifying that train dataset is greater than test dataset.
  
      Returns
      -------
      Self
          current instance of the DatasetsSizeComparison check.
      """
  
      def condition(check_result: dict) -> ConditionResult:
          diff = check_result["Train"] - check_result["Test"]
          if diff < 0:
              details = f"Train dataset is smaller than test dataset by {diff} samples"
              category = ConditionCategory.FAIL
          elif diff == 0:
              details = f'Train and test datasets both have {check_result["Train"]} samples'
              category = ConditionCategory.PASS
          else:
              details = f"Train dataset is larger than test dataset by +{diff} samples"
              category = ConditionCategory.PASS
          return ConditionResult(category, details)
  
      return self.add_condition(
          name="Train dataset is greater or equal to test dataset",
          condition_func=condition,
      )
  
file_path: deepchecks/deepchecks/tabular/checks/train_test_validation/datasets_size_comparison.py
imports: import typing
  import pandas
  from deepchecks.core import CheckResult, ConditionCategory, ConditionResult
  from deepchecks.tabular import Context, TrainTestCheck
  from deepchecks.utils.strings import format_number
label_desc: Use image node_id 4 for calling the DatasetsSizeComparison obj's underlying member method code with example usage: obj.add_condition_train_dataset_greater_or_equal_test() and returns: self, ConditionResult