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 _transform(self, X):
      n_samples, n_timestamps = X.shape
      window_size, grouping_size = self._check_params(n_timestamps)
      n_windows = n_timestamps - window_size + 1
  
      X_window = np.transpose(
          _windowed_view(
              X, n_samples, n_timestamps, window_size, window_step=1
          ),
          axes=(0, 2, 1),
      ).copy()
      X_tranpose = np.matmul(
          X_window, np.transpose(X_window, axes=(0, 2, 1))
      )
      w, v = np.linalg.eigh(X_tranpose)
      w, v = w[:, ::-1], v[:, :, ::-1]
  
      del X_tranpose
  
      X_elem = _outer_dot(
          v, X_window, n_samples, window_size, n_windows
      )
      X_groups, grouping_size = self._grouping(
          X_elem,
          v,
          n_samples,
          window_size,
          n_windows,
          grouping_size,
      )
      if window_size >= n_windows:
          X_groups = np.transpose(X_groups, axes=(0, 1, 3, 2))
          gap = window_size
      else:
          gap = n_windows
  
      del X_elem
  
      X_ssa = _diagonal_averaging(
          X_groups,
          n_samples,
          n_timestamps,
          window_size,
          n_windows,
          grouping_size,
          gap,
      )
      return np.squeeze(X_ssa)
  
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 4 for calling the SingularSpectrumAnalysis obj's underlying member method code with example usage: obj._transform(X) and returns: np