class_docstr: Summarize given metrics on a dataset and model.
  
  Parameters
  ----------
  scorers: Union[Dict[str, Union[Callable, str]], List[Any]] , default: None
      Scorers to override the default scorers (metrics), find more about the supported formats at
      https://docs.deepchecks.com/stable/user-guide/general/metrics_guide.html
  n_to_show : int, default: 20
      Number of classes to show in the report. If None, show all classes.
  show_only : str, default: 'largest'
      Specify which classes to show in the report. Can be one of the following:
      - 'largest': Show the largest classes.
      - 'smallest': Show the smallest classes.
      - 'random': Show random classes.
      - 'best': Show the classes with the highest score.
      - 'worst': Show the classes with the lowest score.
  metric_to_show_by : str, default: None
      Specify the metric to sort the results by. Relevant only when show_only is 'best' or 'worst'.
      If None, sorting by the first metric in the default metrics list.
  class_list_to_show: List[int], default: None
      Specify the list of classes to show in the report. If specified, n_to_show, show_only and metric_to_show_by
      are ignored.
  {additional_check_init_params:2*indent}
class_docstr_tok: ["Summarize","given","metrics","on","a","dataset","and","model",".","Parameters","--","--","--","--","--","scorers",":","Union","[","Dict","[","str",",","Union","[","Callable",",","str","]","]",",","List","[","Any","]","]",",","default",":","None","Scorers","to","override","the","default","scorers","(","metrics",")",",","find","more","about","the","supported","formats","at","https",":","\/\/docs.deepchecks.com\/stable\/user-guide\/general\/metrics_guide.html","n_to_show",":","int",",","default",":","20","Number","of","classes","to","show","in","the","report",".","If","None",",","show","all","classes",".","show_only",":","str",",","default",":","'largest'","Specify","which","classes","to","show","in","the","report",".","Can","be","one","of","the","following",":","-","'largest","'",":","Show","the","largest","classes",".","-","'smallest","'",":","Show","the","smallest","classes",".","-","'random","'",":","Show","random","classes",".","-","'best","'",":","Show","the","classes","with","the","highest","score",".","-","'worst","'",":","Show","the","classes","with","the","lowest","score",".","metric_to_show_by",":","str",",","default",":","None","Specify","the","metric","to","sort","the","results","by",".","Relevant","only","when","show_only","is","'best","'","or","'worst","'",".","If","None",",","sorting","by","the","first","metric","in","the","default","metrics","list",".","class_list_to_show",":","List","[","int","]",",","default",":","None","Specify","the","list","of","classes","to","show","in","the","report",".","If","specified",",","n_to_show",",","show_only","and","metric_to_show_by","are","ignored",".","{","additional_check_init_params:2","*","indent","}"]
docstr: Add condition - test performance is not degraded by more than given percentage in train.
  
  Parameters
  ----------
  threshold : float , default: 0.1
      maximum degradation ratio allowed (value between 0 and 1)
docstr_tok: ["Add","condition","-","test","performance","is","not","degraded","by","more","than","given","percentage","in","train",".","Parameters","--","--","--","--","--","threshold",":","float",",","default",":","0.1","maximum","degradation","ratio","allowed","(","value","between","0","and","1",")"]
code: def add_condition_train_test_relative_degradation_less_than(
      self: PR, threshold: float = 0.1
  ) -> PR:
      """Add condition - test performance is not degraded by more than given percentage in train.
  
      Parameters
      ----------
      threshold : float , default: 0.1
          maximum degradation ratio allowed (value between 0 and 1)
      """
      condition = (
          get_condition_train_test_relative_degradation_less_than(
              threshold=threshold
          )
      )
  
      return self.add_condition(
          f"Train-Test scores relative degradation is less than {threshold}",
          condition,
      )
  
imports: from typing import Any, Callable, Dict, List, Optional, TypeVar, Union
  import pandas
  import plotly.express
  from deepchecks.core import CheckResult, DatasetKind
  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.core.errors import DeepchecksValueError
  from deepchecks.utils import plot
  from deepchecks.utils.strings import format_percent
  from deepchecks.vision._shared_docs import docstrings
  from deepchecks.vision.base_checks import TrainTestCheck
  from deepchecks.vision.context import Context
  from deepchecks.vision.metrics_utils.scorers import filter_classes_for_display, get_scorers_dict, metric_results_to_df
  from deepchecks.vision.vision_data.batch_wrapper import BatchWrapper
label_desc: Use image node_id 6 for calling the ClassPerformance obj's underlying member method code with example usage: obj.add_condition_train_test_relative_degradation_less_than(threshold) and returns: self