class_docstr: Check the performance of the model on different segments of the data.
class_docstr_tok: ["Check","the","performance","of","the","model","on","different","segments","of","the","data","."]
code: def __init__(
      self,
      segment_by: str,
      columns: Union[Hashable, List[Hashable], None],
      ignore_columns: Union[Hashable, List[Hashable], None],
      n_top_features: Optional[int],
      segment_minimum_size_ratio: float,
      max_categories_weak_segment: Optional[int],
      alternative_scorer: Dict[str, Union[str, Callable]],
      score_per_sample: Union[np.ndarray, pd.Series, None],
      n_samples: int,
      categorical_aggregation_threshold: float,
      n_to_show: int,
      multiple_segments_per_feature: bool = False,
      **kwargs,
  ):
      super().__init__(**kwargs)
      self.segment_by = segment_by
      self.columns = columns
      self.ignore_columns = ignore_columns
      self.n_top_features = n_top_features
      self.segment_minimum_size_ratio = segment_minimum_size_ratio
      self.max_categories_weak_segment = max_categories_weak_segment
      self.n_samples = n_samples
      self.n_to_show = n_to_show
      self.score_per_sample = score_per_sample
      self.alternative_scorer = (
          alternative_scorer if alternative_scorer else None
      )
      self.categorical_aggregation_threshold = (
          categorical_aggregation_threshold
      )
      self.multiple_segments_per_feature = multiple_segments_per_feature
  
imports: from typing import Callable, Dict, List, Optional, Union
  import numpy
  import pandas
  from sklearn.decomposition import TruncatedSVD
  from deepchecks.core import CheckResult
  from deepchecks.core.check_result import DisplayMap
  from deepchecks.core.errors import DeepchecksNotSupportedError, NotEnoughSamplesError
  from deepchecks.nlp import Context, SingleDatasetCheck
  from deepchecks.nlp.utils.weak_segments import get_relevant_data_table
  from deepchecks.tabular.context import _DummyModel
  from deepchecks.utils.abstracts.weak_segment_abstract import WeakSegmentAbstract
  from deepchecks.utils.single_sample_metrics import calculate_neg_cross_entropy_per_sample
  from deepchecks.utils.typing import Hashable
label_desc: Use image node_id 1 to create a new WeakSegmentsAbstractText object from inherited base classes: SingleDatasetCheck, WeakSegmentAbstract with example: obj = WeakSegmentsAbstractText(segment_by, columns, ignore_columns, n_top_features, segment_minimum_size_ratio, max_categories_weak_segment, alternative_scorer, score_per_sample, n_samples, categorical_aggregation_threshold, n_to_show, multiple_segments_per_feature)