class_docstr: Base class for label drift checks.
class_docstr_tok: ["Base","class","for","label","drift","checks","."]
code: def _calculate_label_drift(
      self,
      train_column,
      test_column,
      label_name: str,
      column_type: str,
      with_display: bool,
      dataset_names: t.Optional[t.Tuple[str, str]],
  ) -> CheckResult:
      drift_score, method, display = calc_drift_and_plot(
          train_column=pd.Series(train_column),
          test_column=pd.Series(test_column),
          value_name=label_name,
          column_type=column_type,
          margin_quantile_filter=self.margin_quantile_filter,
          max_num_categories_for_drift=self.max_num_categories_for_drift,
          min_category_size_ratio=self.min_category_size_ratio,
          max_num_categories_for_display=self.max_num_categories_for_display,
          show_categories_by=self.show_categories_by,
          numerical_drift_method=self.numerical_drift_method,
          categorical_drift_method=self.categorical_drift_method,
          balance_classes=self.balance_classes,
          ignore_na=self.ignore_na,
          min_samples=self.min_samples,
          raise_min_samples_error=True,
          with_display=with_display,
          dataset_names=dataset_names,
      )
  
      values_dict = {"Drift score": drift_score, "Method": method}
  
      if with_display:
          displays = [
              """<span>
                          The Drift score is a measure for the difference between two distributions, in this check -
                          the test and train distributions.<br> The check shows the drift score
                          and distributions for the label. </span>""",
              get_drift_plot_sidenote(
                  self.max_num_categories_for_display,
                  self.show_categories_by,
              ),
              display,
          ]
      else:
          displays = None
  
      return CheckResult(
          value=values_dict, display=displays, header="Label Drift"
      )
  
file_path: deepchecks/deepchecks/utils/abstracts/label_drift.py
imports: import abc
  import typing
  import pandas
  from typing_extensions import Self
  from deepchecks import CheckResult, ConditionCategory, ConditionResult
  from deepchecks.utils.distribution.drift import calc_drift_and_plot, get_drift_plot_sidenote
  from deepchecks.utils.strings import format_number
label_desc: Use image node_id 1 for calling the LabelDriftAbstract obj's underlying member method code with example usage: obj._calculate_label_drift(train_column, test_column, label_name, column_type, with_display, dataset_names) and returns: CheckResult