code: def __init__(
      self,
      category_order: List = None,
      metric: str = "DA",
      use_residual: bool = True,
      term_ranker: Optional[TermRanker] = None,
      frequency_scaler: Optional[Callable[[np.array], np.array]] = None,
      dispersion_scaler: Optional[
          Callable[[np.array], np.array]
      ] = None,
      regressor: Optional = None,
  ):
      TrendPlotSettings.__init__(self, category_order=category_order)
      self.metric = metric
      self.use_residual = use_residual
      self.frequency_scaler = (
          dense_rank if frequency_scaler is None else frequency_scaler
      )
      self.dispersion_scaler = (
          (scale_center_zero_abs if use_residual else scale)
          if dispersion_scaler is None
          else dispersion_scaler
      )  # log_scale_with_negatives, log_scale
      self.term_ranker = (
          AbsoluteFrequencyRanker
          if term_ranker is None
          else term_ranker
      )
      self.regressor = (
          MeanIsotonic() if regressor is None else regressor
      )
  
imports: import dataclasses
  from abc import ABC, abstractmethod
  from typing import List, Dict, Optional, Callable
  from sklearn.neighbors import KNeighborsRegressor
  import numpy
  import pandas
  from scattertext.dispersion.dispersion import Dispersion
  from scattertext.indexstore import IndexStoreFromList
  from scattertext.continuous.correlations import Correlations
  from scattertext.termranking import AbsoluteFrequencyRanker
  from scattertext.termranking.TermRanker import TermRanker
  from scattertext.TermDocMatrix import TermDocMatrix
  from scattertext.Scalers import get_scaler_name, scale_center_zero_abs, scale, dense_rank
  from scattertext.smoothing.mean_isotonic import MeanIsotonic
label_desc: Use image node_id 1 to create a new DispersionPlotSettings object from inherited base classes: TrendPlotSettings with example: obj = DispersionPlotSettings(category_order, metric, use_residual, term_ranker, frequency_scaler, dispersion_scaler, regressor)