class_docstr: Word ExtrAction for time SEries cLassification.
  
  Parameters
  ----------
  word_size : int (default = 4)
      Size of each word.
  
  n_bins : int (default = 4)
      The number of bins to produce. It must be between 2 and 26.
  
  window_sizes : array-like (default = [0.1, 0.3, 0.5, 0.7, 0.9])
      Size of the sliding windows. All the elements must be either integers
      or floats. In the latter case, each element represents the percentage
      of the size of each time series and must be between 0 and 1; the size
      of the sliding windows will be computed as
      ``np.ceil(window_sizes * n_timestamps)``.
  
  window_steps : None or array-like (default = None)
      Step of the sliding windows. If None, each ``window_step`` is equal to
      ``window_size`` so that the windows are non-overlapping. Otherwise, all
      the elements must be either integers or floats. In the latter case,
      each element represents the percentage of the size of each time series
      and must be between 0 and 1; the step of the sliding windows will be
      computed as ``np.ceil(window_steps * n_timestamps)``.
  
  anova : bool (default = True)
      If True, the Fourier coefficient selection is done via a one-way
      ANOVA test. If False, the first Fourier coefficients are selected.
  
  drop_sum : bool (default = True)
      If True, the first Fourier coefficient (i.e. the sum of the subseries)
      is dropped. Otherwise, it is kept.
  
  norm_mean : bool (default = True)
      If True, center each subseries before scaling.
  
  norm_std : bool (default = True)
      If True, scale each subseries to unit variance.
  
  strategy : str (default = 'entropy')
      Strategy used to define the widths of the bins:
  
      - 'uniform': All bins in each sample have identical widths
      - 'quantile': All bins in each sample have the same number of points
      - 'normal': Bin edges are quantiles from a standard normal distribution
      - 'entropy': Bin edges are computed using information gain
  
  chi2_threshold : int or float (default = 2)
      The threshold used to perform feature selection. Only the words with
      a chi2 statistic above this threshold will be kept.
  
  sparse : bool (default = True)
      Return a sparse matrix if True, else return an array.
  
  alphabet : None, 'ordinal' or array-like, shape = (n_bins,)
      Alphabet to use. If None, the first `n_bins` letters of the Latin
      alphabet are used.
  
  Attributes
  ----------
  vocabulary_ : dict
      A mapping of features indices to terms.
  
  References
  ----------
  .. [1] P. Schäfer, and U. Leser, "Fast and Accurate Time Series
         Classification with WEASEL". Conference on Information and Knowledge
         Management, 637-646 (2017).
  
  Examples
  --------
  >>> from pyts.datasets import load_gunpoint
  >>> from pyts.transformation import WEASEL
  >>> X_train, _, y_train, _ = load_gunpoint(return_X_y=True)
  >>> weasel = WEASEL(sparse=False)
  >>> weasel.fit(X_train, y_train)
  WEASEL(...)
  >>> weasel.transform(X_train)
  array(...)
class_docstr_tok: ["Word","ExtrAction","for","time","SEries","cLassification",".","Parameters","--","--","--","--","--","word_size",":","int","(","default","=","4",")","Size","of","each","word",".","n_bins",":","int","(","default","=","4",")","The","number","of","bins","to","produce",".","It","must","be","between","2","and","26.","window_sizes",":","array-like","(","default","=","[","0.1",",","0.3",",","0.5",",","0.7",",","0.9","]",")","Size","of","the","sliding","windows",".","All","the","elements","must","be","either","integers","or","floats",".","In","the","latter","case",",","each","element","represents","the","percentage","of","the","size","of","each","time","series","and","must","be","between","0","and","1",";","the","size","of","the","sliding","windows","will","be","computed","as","``","np.ceil","(","window_sizes","*","n_timestamps",")","``",".","window_steps",":","None","or","array-like","(","default","=","None",")","Step","of","the","sliding","windows",".","If","None",",","each","``","window_step","``","is","equal","to","``","window_size","``","so","that","the","windows","are","non-overlapping",".","Otherwise",",","all","the","elements","must","be","either","integers","or","floats",".","In","the","latter","case",",","each","element","represents","the","percentage","of","the","size","of","each","time","series","and","must","be","between","0","and","1",";","the","step","of","the","sliding","windows","will","be","computed","as","``","np.ceil","(","window_steps","*","n_timestamps",")","``",".","anova",":","bool","(","default","=","True",")","If","True",",","the","Fourier","coefficient","selection","is","done","via","a","one-way","ANOVA","test",".","If","False",",","the","first","Fourier","coefficients","are","selected",".","drop_sum",":","bool","(","default","=","True",")","If","True",",","the","first","Fourier","coefficient","(","i.e",".","the","sum","of","the","subseries",")","is","dropped",".","Otherwise",",","it","is","kept",".","norm_mean",":","bool","(","default","=","True",")","If","True",",","center","each","subseries","before","scaling",".","norm_std",":","bool","(","default","=","True",")","If","True",",","scale","each","subseries","to","unit","variance",".","strategy",":","str","(","default","=","'entropy","'",")","Strategy","used","to","define","the","widths","of","the","bins",":","-","'uniform","'",":","All","bins","in","each","sample","have","identical","widths","-","'quantile","'",":","All","bins","in","each","sample","have","the","same","number","of","points","-","'normal","'",":","Bin","edges","are","quantiles","from","a","standard","normal","distribution","-","'entropy","'",":","Bin","edges","are","computed","using","information","gain","chi2_threshold",":","int","or","float","(","default","=","2",")","The","threshold","used","to","perform","feature","selection",".","Only","the","words","with","a","chi2","statistic","above","this","threshold","will","be","kept",".","sparse",":","bool","(","default","=","True",")","Return","a","sparse","matrix","if","True",",","else","return","an","array",".","alphabet",":","None",",","'ordinal","'","or","array-like",",","shape","=","(","n_bins",",",")","Alphabet","to","use",".","If","None",",","the","first","`","n_bins","`","letters","of","the","Latin","alphabet","are","used",".","Attributes","--","--","--","--","--","vocabulary_",":","dict","A","mapping","of","features","indices","to","terms",".","References","--","--","--","--","--","..","[","1","]","P.","Sch\u00e4fer",",","and","U.","Leser",",","``","Fast","and","Accurate","Time","Series","Classification","with","WEASEL","''",".","Conference","on","Information","and","Knowledge","Management",",","637-646","(","2017",")",".","Examples","--","--","--","--",">",">",">","from","pyts.datasets","import","load_gunpoint",">",">",">","from","pyts.transformation","import","WEASEL",">",">",">","X_train",",","_",",","y_train",",","_","=","load_gunpoint","(","return_X_y=True",")",">",">",">","weasel","=","WEASEL","(","sparse=False",")",">",">",">","weasel.fit","(","X_train",",","y_train",")","WEASEL","(","...",")",">",">",">","weasel.transform","(","X_train",")","array","(","...",")"]
docstr: Transform the provided data.
  
  Parameters
  ----------
  X : array-like, shape (n_samples, n_timestamps)
      Test samples.
  
  Returns
  -------
  X_new : sparse matrix, shape = (n_samples, n_features)
      Document-term matrix with relevant features only.
docstr_tok: ["Transform","the","provided","data",".","Parameters","--","--","--","--","--","X",":","array-like",",","shape","(","n_samples",",","n_timestamps",")","Test","samples",".","Returns","--","--","--","-","X_new",":","sparse","matrix",",","shape","=","(","n_samples",",","n_features",")","Document-term","matrix","with","relevant","features","only","."]
code: def transform(self, X):
      """Transform the provided data.
  
      Parameters
      ----------
      X : array-like, shape (n_samples, n_timestamps)
          Test samples.
  
      Returns
      -------
      X_new : sparse matrix, shape = (n_samples, n_features)
          Document-term matrix with relevant features only.
  
      """
      check_is_fitted(
          self,
          [
              "_relevant_features_list",
              "_sfa_list",
              "_vectorizer_list",
              "vocabulary_",
          ],
      )
  
      X = check_array(X, dtype="float64")
      n_samples, n_timestamps = X.shape
  
      X_features = coo_matrix((n_samples, 0), dtype=np.int64)
  
      for (
          window_size,
          window_step,
          sfa,
          vectorizer,
          relevant_features,
      ) in zip(
          self._window_sizes,
          self._window_steps,
          self._sfa_list,
          self._vectorizer_list,
          self._relevant_features_list,
      ):
          n_windows = (
              n_timestamps - window_size + window_step
          ) // window_step
          X_windowed = _windowed_view(
              X, n_samples, n_timestamps, window_size, window_step
          )
          X_windowed = X_windowed.reshape(
              n_samples * n_windows, window_size
          )
          X_sfa = sfa.transform(X_windowed)
  
          X_word = np.asarray(
              ["".join(X_sfa[i]) for i in range(n_samples * n_windows)]
          )
          X_word = X_word.reshape(n_samples, n_windows)
          X_bow = np.asarray(
              [" ".join(X_word[i]) for i in range(n_samples)]
          )
          X_counts = vectorizer.transform(X_bow)[:, relevant_features]
          X_features = hstack([X_features, X_counts])
  
      if not self.sparse:
          return X_features.A
      return csr_matrix(X_features)
  
file_path: pyts/pyts/transformation/weasel.py
imports: import numpy
  from scipy.sparse import coo_matrix, csr_matrix, hstack
  from sklearn.utils.validation import check_array, check_X_y, check_is_fitted
  from sklearn.utils.multiclass import check_classification_targets
  from sklearn.base import BaseEstimator
  from sklearn.feature_extraction.text import CountVectorizer
  from sklearn.feature_selection import chi2
  from ..approximation import SymbolicFourierApproximation
  from ..base import UnivariateTransformerMixin
  from ..utils.utils import _windowed_view
label_desc: Use image node_id 3 for calling the WEASEL obj's underlying member method code with example usage: obj.transform(X) and returns: csr_matrix, X_features