def METHOD_NAME(self, context: Context) -> CheckResult:
    """Run check."""
    train_dataset = context.train.sample(self.n_samples, random_state=self.random_state)
    test_dataset = context.test.sample(self.n_samples, random_state=self.random_state)
    model = context.model
    scorers = context.get_scorers(self.scorers, use_avg_defaults=False)
    datasets = {'Train': train_dataset, 'Test': test_dataset}
    results = []
    for dataset_name, dataset in datasets.items():
        label = cast(pd.Series, dataset.label_col)
        n_samples_per_class = label.groupby(label).count()
        for scorer in scorers:
            scorer_value = scorer(model, dataset)
            if isinstance(scorer_value, Number):
                results.append([dataset_name, pd.NA, scorer.name, scorer_value, len(label)])
            else:
                results.extend(
                    [[dataset_name, class_name, scorer.name, class_score, n_samples_per_class.get(class_name, 0)]
                        for class_name, class_score in scorer_value.items()])
    results_df = pd.DataFrame(results, columns=['Dataset', 'Class', 'Metric', 'Value', 'Number of samples'])
    if context.with_display:
        figs = self._prepare_display(
            results_df,
            train_dataset.name or 'Train',
            test_dataset.name or 'Test'
        )
    else:
        figs = None
    return CheckResult(
        results_df,
        header='Train Test Performance',
        display=figs
    )