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 test-train size ratio is greater than threshold.
  
  Parameters
  ----------
  ratio : float , default: 0.01
      minimal allowed test-train ratio.
  
  Returns
  -------
  Self
      current instance of the DatasetsSizeComparison check.
docstr_tok: ["Add","condition","verifying","that","test-train","size","ratio","is","greater","than","threshold",".","Parameters","--","--","--","--","--","ratio",":","float",",","default",":","0.01","minimal","allowed","test-train","ratio",".","Returns","--","--","--","-","Self","current","instance","of","the","DatasetsSizeComparison","check","."]
code: def add_condition_test_train_size_ratio_greater_than(
      self: T, ratio: float = 0.01
  ) -> T:
      """Add condition verifying that test-train size ratio is greater than threshold.
  
      Parameters
      ----------
      ratio : float , default: 0.01
          minimal allowed test-train ratio.
  
      Returns
      -------
      Self
          current instance of the DatasetsSizeComparison check.
      """
  
      def condition(check_result: dict) -> ConditionResult:
          test_train_ratio = (
              check_result["Test"] / check_result["Train"]
          )
          details = f"Test-Train size ratio is {format_number(test_train_ratio)}"
          category = (
              ConditionCategory.PASS
              if test_train_ratio > ratio
              else ConditionCategory.FAIL
          )
          return ConditionResult(category, details)
  
      return self.add_condition(
          name=f"Test-Train size ratio is greater than {ratio}",
          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 3 for calling the DatasetsSizeComparison obj's underlying member method code with example usage: obj.add_condition_test_train_size_ratio_greater_than(ratio) and returns: self, ConditionResult