class_docstr: Remove seasonal components from time series, conditional on seasonality test.
  
  Fit tests for :term:`seasonality <Seasonality>` and if the passed time series
  has a seasonal component it applies seasonal decomposition provided by `statsmodels
  <https://www.statsmodels.org>`
  to compute the seasonal component.
  If the test is negative `_seasonal` is set
  to all ones (if `model` is "multiplicative")
  or to all zeros (if `model` is "additive").
  
  Transform aligns seasonal components stored in `seasonal_` with
  the time index of the passed series and then
  subtracts them ("additive" model) from the passed series
  or divides the passed series by them ("multiplicative" model).
  
  
  Parameters
  ----------
  seasonality_test : callable or None, default=None
      Callable that tests for seasonality and returns True when data is
      seasonal and False otherwise. If None,
      90% autocorrelation seasonality test is used.
  sp : int, default=1
      Seasonal periodicity.
  model : {"additive", "multiplicative"}, default="additive"
      Model to use for estimating seasonal component.
  
  Attributes
  ----------
  seasonal_ : array of length sp
      Seasonal components.
  is_seasonal_ : bool
      Return value of `seasonality_test`. True when data is
      seasonal and False otherwise.
  
  See Also
  --------
  Deseasonalizer
  
  Notes
  -----
  For further explanation on seasonal components and additive vs.
  multiplicative models see
  `Forecasting: Principles and Practice <https://otexts.com/fpp3/components.html>`_.
  Seasonal decomposition is computed using `statsmodels
  <https://www.statsmodels.org/stable/generated/statsmodels.tsa.seasonal.seasonal_decompose.html>`_.
  
  Examples
  --------
  >>> from sktime.transformations.series.detrend import ConditionalDeseasonalizer
  >>> from sktime.datasets import load_airline
  >>> y = load_airline()  # doctest: +SKIP
  >>> transformer = ConditionalDeseasonalizer(sp=12)  # doctest: +SKIP
  >>> y_hat = transformer.fit_transform(y)  # doctest: +SKIP
class_docstr_tok: ["Remove","seasonal","components","from","time","series",",","conditional","on","seasonality","test",".","Fit","tests","for",":","term",":","`","seasonality","<","Seasonality",">","`","and","if","the","passed","time","series","has","a","seasonal","component","it","applies","seasonal","decomposition","provided","by","`","statsmodels","<","https",":","\/\/www.statsmodels.org",">","`","to","compute","the","seasonal","component",".","If","the","test","is","negative","`","_seasonal","`","is","set","to","all","ones","(","if","`","model","`","is","``","multiplicative","''",")","or","to","all","zeros","(","if","`","model","`","is","``","additive","''",")",".","Transform","aligns","seasonal","components","stored","in","`","seasonal_","`","with","the","time","index","of","the","passed","series","and","then","subtracts","them","(","``","additive","''","model",")","from","the","passed","series","or","divides","the","passed","series","by","them","(","``","multiplicative","''","model",")",".","Parameters","--","--","--","--","--","seasonality_test",":","callable","or","None",",","default=None","Callable","that","tests","for","seasonality","and","returns","True","when","data","is","seasonal","and","False","otherwise",".","If","None",",","90","%","autocorrelation","seasonality","test","is","used",".","sp",":","int",",","default=1","Seasonal","periodicity",".","model",":","{","``","additive","''",",","``","multiplicative","''","}",",","default=","''","additive","''","Model","to","use","for","estimating","seasonal","component",".","Attributes","--","--","--","--","--","seasonal_",":","array","of","length","sp","Seasonal","components",".","is_seasonal_",":","bool","Return","value","of","`","seasonality_test","`",".","True","when","data","is","seasonal","and","False","otherwise",".","See","Also","--","--","--","--","Deseasonalizer","Notes","--","--","-","For","further","explanation","on","seasonal","components","and","additive","vs.","multiplicative","models","see","`","Forecasting",":","Principles","and","Practice","<","https",":","\/\/otexts.com\/fpp3\/components.html",">","`","_",".","Seasonal","decomposition","is","computed","using","`","statsmodels","<","https",":","\/\/www.statsmodels.org\/stable\/generated\/statsmodels.tsa.seasonal.seasonal_decompose.html",">","`","_",".","Examples","--","--","--","--",">",">",">","from","sktime.transformations.series.detrend","import","ConditionalDeseasonalizer",">",">",">","from","sktime.datasets","import","load_airline",">",">",">","y","=","load_airline","(",")","#","doctest",":","+SKIP",">",">",">","transformer","=","ConditionalDeseasonalizer","(","sp=12",")","#","doctest",":","+SKIP",">",">",">","y_hat","=","transformer.fit_transform","(","y",")","#","doctest",":","+SKIP"]
code: def __init__(self, seasonality_test=None, sp=1, model="additive"):
      self.seasonality_test = seasonality_test
      self.is_seasonal_ = None
      super().__init__(sp=sp, model=model)
  
imports: import numpy
  import pandas
  from sktime.transformations.base import BaseTransformer
  from sktime.utils.datetime import _get_duration, _get_freq
  from sktime.utils.seasonality import autocorrelation_seasonality_test
  from sktime.utils.validation.forecasting import check_sp
label_desc: Use image node_id 1 to create a new ConditionalDeseasonalizer object from inherited base classes: Deseasonalizer with example: obj = ConditionalDeseasonalizer(seasonality_test, sp, model)