class_docstr: Singular Spectrum Analysis.
  
  Parameters
  ----------
  window_size : int or float (default = 4)
      Size of the sliding window (i.e. the size of each word). If float, it
      represents the percentage of the size of each time series and must be
      between 0 and 1. The window size will be computed as
      ``max(2, ceil(window_size * n_timestamps))``.
  
  groups : None, int, 'auto', or array-like (default = None)
      The way the elementary matrices are grouped. If None, no grouping is
      performed. If an integer, it represents the number of groups and the
      bounds of the groups are computed as
      ``np.linspace(0, window_size, groups + 1).astype('int64')``.
      If 'auto', then three groups are determined, containing trend,
      seasonal, and residual. If array-like, each element must be array-like
      and contain the indices for each group.
  
  lower_frequency_bound : float (default = 0.075)
      The boundary of the periodogram to characterize trend, seasonal and
      residual components. It must be between 0 and 0.5.
      Ignored if ``groups`` is not set to 'auto'.
  
  lower_frequency_contribution : float (default = 0.85)
      The relative threshold to characterize trend, seasonal and
      residual components by considering the periodogram.
      It must be between 0 and 1. Ignored if ``groups`` is not set to 'auto'.
  
  chunksize : int or None (default = None)
      If int, the transformation of the whole dataset is performed using
      chunks (batches) and ``chunksize`` corresponds to the maximum size of
      each chunk (batch). If None, the transformation is performed on the
      whole dataset at once. Performing the transformation with chunks is
      likely to be a bit slower but requires less memory.
  
  n_jobs : None or int (default = None)
      The number of jobs to use for the computation. Only used if
      ``chunksize`` is set to an integer.
  
  References
  ----------
  .. [1] N. Golyandina, and A. Zhigljavsky, "Singular Spectrum Analysis for
         Time Series". Springer-Verlag Berlin Heidelberg (2013).
  
  .. [2] T. Alexandrov, "A Method of Trend Extraction Using Singular
         Spectrum Analysis", REVSTAT (2008).
  
  Examples
  --------
  >>> from pyts.datasets import load_gunpoint
  >>> from pyts.decomposition import SingularSpectrumAnalysis
  >>> X, _, _, _ = load_gunpoint(return_X_y=True)
  >>> transformer = SingularSpectrumAnalysis(window_size=5)
  >>> X_new = transformer.transform(X)
  >>> X_new.shape
  (50, 5, 150)
class_docstr_tok: ["Singular","Spectrum","Analysis",".","Parameters","--","--","--","--","--","window_size",":","int","or","float","(","default","=","4",")","Size","of","the","sliding","window","(","i.e",".","the","size","of","each","word",")",".","If","float",",","it","represents","the","percentage","of","the","size","of","each","time","series","and","must","be","between","0","and","1",".","The","window","size","will","be","computed","as","``","max","(","2",",","ceil","(","window_size","*","n_timestamps",")",")","``",".","groups",":","None",",","int",",","'auto","'",",","or","array-like","(","default","=","None",")","The","way","the","elementary","matrices","are","grouped",".","If","None",",","no","grouping","is","performed",".","If","an","integer",",","it","represents","the","number","of","groups","and","the","bounds","of","the","groups","are","computed","as","``","np.linspace","(","0",",","window_size",",","groups","+","1",")",".astype","(","'int64","'",")","``",".","If","'auto","'",",","then","three","groups","are","determined",",","containing","trend",",","seasonal",",","and","residual",".","If","array-like",",","each","element","must","be","array-like","and","contain","the","indices","for","each","group",".","lower_frequency_bound",":","float","(","default","=","0.075",")","The","boundary","of","the","periodogram","to","characterize","trend",",","seasonal","and","residual","components",".","It","must","be","between","0","and","0.5",".","Ignored","if","``","groups","``","is","not","set","to","'auto","'",".","lower_frequency_contribution",":","float","(","default","=","0.85",")","The","relative","threshold","to","characterize","trend",",","seasonal","and","residual","components","by","considering","the","periodogram",".","It","must","be","between","0","and","1",".","Ignored","if","``","groups","``","is","not","set","to","'auto","'",".","chunksize",":","int","or","None","(","default","=","None",")","If","int",",","the","transformation","of","the","whole","dataset","is","performed","using","chunks","(","batches",")","and","``","chunksize","``","corresponds","to","the","maximum","size","of","each","chunk","(","batch",")",".","If","None",",","the","transformation","is","performed","on","the","whole","dataset","at","once",".","Performing","the","transformation","with","chunks","is","likely","to","be","a","bit","slower","but","requires","less","memory",".","n_jobs",":","None","or","int","(","default","=","None",")","The","number","of","jobs","to","use","for","the","computation",".","Only","used","if","``","chunksize","``","is","set","to","an","integer",".","References","--","--","--","--","--","..","[","1","]","N.","Golyandina",",","and","A.","Zhigljavsky",",","``","Singular","Spectrum","Analysis","for","Time","Series","''",".","Springer-Verlag","Berlin","Heidelberg","(","2013",")",".","..","[","2","]","T.","Alexandrov",",","``","A","Method","of","Trend","Extraction","Using","Singular","Spectrum","Analysis","''",",","REVSTAT","(","2008",")",".","Examples","--","--","--","--",">",">",">","from","pyts.datasets","import","load_gunpoint",">",">",">","from","pyts.decomposition","import","SingularSpectrumAnalysis",">",">",">","X",",","_",",","_",",","_","=","load_gunpoint","(","return_X_y=True",")",">",">",">","transformer","=","SingularSpectrumAnalysis","(","window_size=5",")",">",">",">","X_new","=","transformer.transform","(","X",")",">",">",">","X_new.shape","(","50",",","5",",","150",")"]
code: def _check_params(self, n_timestamps):
      if not isinstance(
          self.window_size, (int, np.integer, float, np.floating)
      ):
          raise TypeError(
              "'window_size' must be an integer or a float."
          )
      if isinstance(self.window_size, (int, np.integer)):
          if not 2 <= self.window_size <= n_timestamps:
              raise ValueError(
                  "If 'window_size' is an integer, it must be greater "
                  "than or equal to 2 and lower than or equal to "
                  "n_timestamps (got {0}).".format(self.window_size)
              )
          window_size = self.window_size
      else:
          if not 0 < self.window_size <= 1:
              raise ValueError(
                  "If 'window_size' is a float, it must be greater "
                  "than 0 and lower than or equal to 1 "
                  "(got {0}).".format(self.window_size)
              )
          window_size = max(2, ceil(self.window_size * n_timestamps))
  
      if not (
          self.groups is None
          or (isinstance(self.groups, str) and self.groups == "auto")
          or isinstance(self.groups, (int, list, tuple, np.ndarray))
      ):
          raise TypeError(
              "'groups' must be either None, an integer, "
              "'auto' or array-like."
          )
      if self.groups is None:
          grouping_size = window_size
      elif isinstance(self.groups, str) and self.groups == "auto":
          grouping_size = 3
      elif isinstance(self.groups, (int, np.integer)):
          if not 1 <= self.groups <= self.window_size:
              raise ValueError(
                  "If 'groups' is an integer, it must be greater than or "
                  "equal to 1 and lower than or equal to 'window_size'."
              )
          grouping = np.linspace(
              0, window_size, self.groups + 1
          ).astype("int64")
          grouping_size = len(grouping) - 1
      if isinstance(self.groups, (list, tuple, np.ndarray)):
          idx = np.concatenate(self.groups)
          diff = np.setdiff1d(idx, np.arange(self.window_size))
          flat_list = [item for group in self.groups for item in group]
          if (diff.size > 0) or not (
              all(isinstance(x, (int, np.integer)) for x in flat_list)
          ):
              raise ValueError(
                  "If 'groups' is array-like, all the values in 'groups' "
                  "must be integers between 0 and ('window_size' - 1)."
              )
          grouping_size = len(self.groups)
  
      if not isinstance(
          self.lower_frequency_bound, (float, np.floating)
      ):
          raise TypeError("'lower_frequency_bound' must be a float.")
      else:
          if not 0 < self.lower_frequency_bound < 0.5:
              raise ValueError(
                  "'lower_frequency_bound' must be greater than 0 and "
                  "lower than 0.5."
              )
  
      if not isinstance(
          self.lower_frequency_contribution, (float, np.floating)
      ):
          raise TypeError(
              "'lower_frequency_contribution' must be a float."
          )
      else:
          if not 0 < self.lower_frequency_contribution < 1:
              raise ValueError(
                  "'lower_frequency_contribution' must be greater than 0 "
                  "and lower than 1."
              )
  
      chunksize_int = isinstance(self.chunksize, (int, np.integer))
      if not (self.chunksize is None or chunksize_int):
          raise TypeError("'chunksize' must be None or an integer.")
      if chunksize_int and self.chunksize < 1:
          raise ValueError(
              "If 'chunksize' is an integer, it must be "
              "positive (got {})".format(self.chunksize)
          )
  
      n_jobs_int = (
          isinstance(self.n_jobs, (int, np.integer))
          and self.n_jobs != 0
      )
      if not (self.n_jobs is None or n_jobs_int):
          raise ValueError(
              "'n_jobs' must be None or an integer not equal "
              "to zero (got {}).".format(self.n_jobs)
          )
      return window_size, grouping_size
  
file_path: pyts/pyts/decomposition/ssa.py
imports: import numpy
  from math import ceil
  from numba import njit, prange
  from joblib import Parallel, delayed
  from sklearn.base import BaseEstimator
  from sklearn.utils.validation import check_array
  from ..base import UnivariateTransformerMixin
  from ..utils.utils import _windowed_view
label_desc: Use image node_id 6 for calling the SingularSpectrumAnalysis obj's underlying member method code with example usage: obj._check_params(n_timestamps) and returns: window_size,  grouping_size