class_docstr: Base functionality for some train-test performance checks.
docstr: Add condition - relative ratio difference between highest-class and lowest-class is less than threshold.
  
  Parameters
  ----------
  threshold : float , default: 0.3
      ratio difference threshold
  score : str
      limit score for condition
  
  Returns
  -------
  Self
      instance of 'TrainTestPerformance' or it subtype
  
  Raises
  ------
  DeepchecksValueError
      if unknown score function name were passed.
docstr_tok: ["Add","condition","-","relative","ratio","difference","between","highest-class","and","lowest-class","is","less","than","threshold",".","Parameters","--","--","--","--","--","threshold",":","float",",","default",":","0.3","ratio","difference","threshold","score",":","str","limit","score","for","condition","Returns","--","--","--","-","Self","instance","of","'TrainTestPerformance","'","or","it","subtype","Raises","--","--","--","DeepchecksValueError","if","unknown","score","function","name","were","passed","."]
code: def add_condition_class_performance_imbalance_ratio_less_than(
      self: Self,
      score: str,
      threshold: float = 0.3,
  ) -> Self:
      """Add condition - relative ratio difference between highest-class and lowest-class is less than threshold.
  
      Parameters
      ----------
      threshold : float , default: 0.3
          ratio difference threshold
      score : str
          limit score for condition
  
      Returns
      -------
      Self
          instance of 'TrainTestPerformance' or it subtype
  
      Raises
      ------
      DeepchecksValueError
          if unknown score function name were passed.
      """
      name = f"Relative ratio difference between labels '{score}' score is less than {format_percent(threshold)}"
      condition = (
          get_condition_class_performance_imbalance_ratio_less_than(
              threshold=threshold, score=score
          )
      )
      return self.add_condition(name=name, condition_func=condition)
  
file_path: deepchecks/deepchecks/utils/abstracts/train_test_performace.py
imports: import abc
  import typing
  import pandas
  import plotly.express
  from typing_extensions import Self
  from deepchecks.core.check_utils.class_performance_utils import get_condition_class_performance_imbalance_ratio_less_than, get_condition_test_performance_greater_than, get_condition_train_test_relative_degradation_less_than
  from deepchecks.utils.plot import DEFAULT_DATASET_NAMES, colors
  from deepchecks.utils.strings import format_percent
label_desc: Use image node_id 4 for calling the TrainTestPerformanceAbstract obj's underlying member method code with example usage: obj.add_condition_class_performance_imbalance_ratio_less_than(score, threshold) and returns: self