class_docstr: Summarize given model performance on the train and test datasets based on selected scorers.
  
  Parameters
  ----------
  scorers: Union[Mapping[str, Union[str, Callable]], List[str]], default: None
      Scorers to override the default scorers, find more about the supported formats at
      https://docs.deepchecks.com/stable/user-guide/general/metrics_guide.html
  n_samples : int , default: 1_000_000
      number of samples to use for this check.
  random_state : int, default: 42
      random seed for all check internals.
class_docstr_tok: ["Summarize","given","model","performance","on","the","train","and","test","datasets","based","on","selected","scorers",".","Parameters","--","--","--","--","--","scorers",":","Union","[","Mapping","[","str",",","Union","[","str",",","Callable","]","]",",","List","[","str","]","]",",","default",":","None","Scorers","to","override","the","default","scorers",",","find","more","about","the","supported","formats","at","https",":","\/\/docs.deepchecks.com\/stable\/user-guide\/general\/metrics_guide.html","n_samples",":","int",",","default",":","1_000_000","number","of","samples","to","use","for","this","check",".","random_state",":","int",",","default",":","42","random","seed","for","all","check","internals","."]
docstr: Run check.
docstr_tok: ["Run","check","."]
code: def run_logic(self, context: Context, dataset_kind) -> CheckResult:
      """Run check."""
      dataset = context.get_data_by_kind(dataset_kind).sample(
          self.n_samples, random_state=self.random_state
      )
      model = context.model
      if (
          context.task_type == TaskType.REGRESSION
          and self.scorers is None
      ):
          self.scorers = {"RMSE": "RMSE"}
      scorers = context.get_scorers(self.scorers, use_avg_defaults=True)
  
      results = []
      display = None
      if context.task_type == TaskType.REGRESSION:
          for scorer in scorers:
              scorer_value = scorer(model, dataset)
              results.append([scorer.name, scorer_value])
          results_df = pd.DataFrame(
              results, columns=["Metric", "Value"]
          )
          if context.with_display:
              display = [results_df]
      else:
          for scorer in scorers:
              scorer_value = scorer(model, dataset)
              if (
                  isinstance(scorer_value, Number)
                  or scorer_value is None
              ):
                  results.append([pd.NA, scorer.name, scorer_value])
              else:
                  results.extend(
                      [
                          [class_name, scorer.name, class_score]
                          for class_name, class_score in scorer_value.items()
                      ]
                  )
          results_df = pd.DataFrame(
              results, columns=["Class", "Metric", "Value"]
          )
  
          if context.with_display:
              label = cast(pd.Series, dataset.label_col)
              n_samples = label.groupby(label).count()
              display_df = results_df.copy()
              display_df["Number of samples"] = display_df[
                  "Class"
              ].apply(n_samples.get)
              display = [display_df]
  
      return CheckResult(
          results_df,
          header="Single Dataset Performance",
          display=display,
      )
  
file_path: deepchecks/deepchecks/tabular/checks/model_evaluation/single_dataset_performance.py
imports: from numbers import Number
  from typing import TYPE_CHECKING, Callable, Dict, List, Mapping, Optional, TypeVar, Union, cast
  import pandas
  from deepchecks.core import CheckResult, ConditionCategory, ConditionResult
  from deepchecks.core.errors import DeepchecksValueError
  from deepchecks.core.reduce_classes import ReduceMetricClassMixin
  from deepchecks.tabular import Context
  from deepchecks.tabular.base_checks import SingleDatasetCheck
  from deepchecks.tabular.utils.task_type import TaskType
  from deepchecks.utils.docref import doclink
  from deepchecks.utils.strings import format_number
label_desc: Use image node_id 2 for calling the SingleDatasetPerformance obj's underlying member method code with example usage: obj.run_logic(context, dataset_kind) and returns: CheckResult