class_docstr: Transformer that performs classic seasonal decomposition to the time
  series, and returns residual series.
  
  Classic seasonal decomposition assumes time series is the sum of trend,
  seasonal pattern, and noise (residual). This transformer calculates and
  removes trend component with moving average, extracts seasonal pattern by
  taking average over seasonal periods of the detrended series, and returns
  residual series.
  
  The `fit` method fits seasonal frequency (if not specified) and seasonal
  pattern with the training series. The `transform` (or its alias `predict`)
  method extracts the trend by moving average, but will NOT re-calucate the
  seasonal pattern. Instead, it uses the trained seasonal pattern and
  extracts it from the detrended series to obtain the residual series. This
  implicitly assumes the seasonal property does not change over time.
  
  Parameters
  ----------
  freq: int, optional
      Length of a seasonal cycle as the number of time points in a cycle. If
      None, the model will determine based on autocorrelation of the training
      series. Default: None.
  
  trend: bool, optional
      Whether to extract and remove trend of the series with moving average.
      If False, the time series will be assumed the sum of seasonal pattern
      and residual. Default: False.
  
  Attributes
  ----------
  freq_: int
      Length of seasonal cycle. Equal to parameter `freq` if it is given.
      Otherwise, calculated based on autocorrelation of the training series.
  
  seasonal_: pandas.Series
      Seasonal pattern extracted from training series.
code: def _fit_core(self, s: pd.Series) -> None:
      if not (
          s.index.is_monotonic_increasing
          or s.index.is_monotonic_decreasing
      ):
          raise ValueError(
              "Time series must have a monotonic time index. "
          )
      # remove starting and ending nans
      s = s.loc[
          s.first_valid_index() : s[::-1].first_valid_index()
      ].copy()
      if pd.isna(s).any():
          raise ValueError(
              "Found NaN in time series among valid values. "
              "NaNs starting or ending a time series are allowed, "
              "but those among valid values are not."
          )
      # get datum time
      self._datumTimestamp = s.index[0]
      # get series_freq
      if s.index.freq is not None:
          self._series_freq = s.index.freqstr
      else:
          self._series_freq = s.index.inferred_freq
      if self._series_freq is None:
          raise RuntimeError(
              "Series does not follow any known frequency "
              "(e.g. second, minute, hour, day, week, month, year, etc."
          )
      # get average dT
      self._dT = pd.Series(s.index).diff().mean()
      # get seasonal freq
      if self.freq is None:
          identified_freq = _identify_seasonal_period(s)
          if identified_freq is None:
              raise Exception("Could not find significant seasonality.")
          else:
              self.freq_ = identified_freq
      else:
          self.freq_ = self.freq
      # get seasonal pattern
      if self.trend:
          seasonal_decompose_results = (
              seasonal_decompose(s, period=self.freq_)
              if parse(statsmodels.__version__) >= parse("0.11")
              else seasonal_decompose(s, freq=self.freq_)
          )
          self.seasonal_ = getattr(
              seasonal_decompose_results, "seasonal"
          )[: self.freq_]
      else:
          self.seasonal_ = s.iloc[: self.freq_].copy()
          for i in range(len(self.seasonal_)):
              self.seasonal_.iloc[i] = s.iloc[
                  i :: len(self.seasonal_)
              ].mean()
  
imports: from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import pandas
  import statsmodels
  from packaging.version import parse
  from statsmodels.tsa.seasonal import seasonal_decompose
  from statsmodels.tsa.stattools import acf
  from .._transformer_base import _NonTrainableUnivariateTransformer, _TrainableUnivariateTransformer
  from .._utils import PandasBugError
label_desc: Use image node_id 3 for calling the ClassicSeasonalDecomposition obj's underlying member method code with example usage: obj._fit_core(s) without return types