class_docstr: Display performance score segmented by 2 top (or given) features in a heatmap.
  
  .. deprecated:: 0.8.1
      The SegmentPerformance check is deprecated and will be removed in the 0.11 version. Please use the
      WeakSegmentsPerformance check instead.
  
  Parameters
  ----------
  feature_1 : Optional[Hashable] , default: None
      feature to segment by on y-axis.
  feature_2 : Optional[Hashable] , default: None
      feature to segment by on x-axis.
  alternative_scorer : Tuple[str, Union[str, Callable]] , default: None
      Score to show, either function or sklearn scorer name.
      If is not given a default scorer (per the model type) will be used.
  max_segments : int , default: 10
      maximal number of segments to split the values into.
  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.
code: def __init__(
      self,
      feature_1: Optional[Hashable] = None,
      feature_2: Optional[Hashable] = None,
      alternative_scorer: Tuple[str, Union[str, Callable]] = None,
      max_segments: int = 10,
      n_samples: int = 1_000_000,
      random_state: int = 42,
      **kwargs,
  ):
      super().__init__(**kwargs)
      warnings.warn(
          "The SegmentPerformance check is deprecated and will be removed in the 0.11 version. "
          "Please use the WeakSegmentsPerformance check instead.",
          DeprecationWarning,
      )
  
      # if they're both none it's ok
      if feature_1 and feature_1 == feature_2:
          raise DeepchecksValueError(
              '"feature_1" must be different than "feature_2"'
          )
  
      self.feature_1 = feature_1
      self.feature_2 = feature_2
      self.n_samples = n_samples
      self.random_state = random_state
  
      if not isinstance(max_segments, int) or max_segments < 0:
          raise DeepchecksValueError(
              '"num_segments" must be positive integer'
          )
  
      self.max_segments = max_segments
      self.alternative_scorer = (
          dict([alternative_scorer]) if alternative_scorer else None
      )
  
file_path: deepchecks/deepchecks/tabular/checks/model_evaluation/segment_performance.py
imports: import warnings
  from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Tuple, Union, cast
  import numpy
  import plotly.express
  from deepchecks.core import CheckResult
  from deepchecks.core.errors import DatasetValidationError, DeepchecksValueError
  from deepchecks.tabular import Context, SingleDatasetCheck
  from deepchecks.utils.docref import doclink
  from deepchecks.utils.performance.partition import partition_column
  from deepchecks.utils.strings import format_number
  from deepchecks.utils.typing import Hashable
label_desc: Use image node_id 1 to create a new SegmentPerformance object from inherited base classes: SingleDatasetCheck with example: obj = SegmentPerformance(feature_1, feature_2, alternative_scorer, max_segments, n_samples, random_state)