class_docstr: Bag-of-SFA Symbols in Vector Space.
  
  Each time series is transformed into an histogram using the
  Bag-of-SFA Symbols (BOSS) algorithm. Then, for each class, the histograms
  are added up and a tf-idf vector is computed. The predicted class for
  a new sample is the class giving the highest cosine similarity between
  its tf vector and the tf-idf vectors of each class.
  
  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_size : int or float (default = 10)
      Size of the sliding window. 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 ``ceil(window_size * n_timestamps)``.
  
  window_step : int or float (default = 1)
      Step of the sliding window. 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 ``ceil(window_step * n_timestamps)``.
  
  anova : bool (default = False)
      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 = False)
      If True, the first Fourier coefficient (i.e. the sum of the subseries)
      is dropped. Otherwise, it is kept.
  
  norm_mean : bool (default = False)
      If True, center each subseries before scaling.
  
  norm_std : bool (default = False)
      If True, scale each subseries to unit variance.
  
  strategy : str (default = 'quantile')
      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
  
  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.
  
  numerosity_reduction : bool (default = True)
      If True, delete sample-wise all but one occurence of back to back
      identical occurences of the same words.
  
  use_idf : bool (default = True)
      Enable inverse-document-frequency reweighting.
  
  smooth_idf : bool (default = False)
      Smooth idf weights by adding one to document frequencies, as if an
      extra document was seen containing every term in the collection
      exactly once. Prevents zero divisions.
  
  sublinear_tf : bool (default = True)
      Apply sublinear tf scaling, i.e. replace tf with 1 + log(tf).
  
  Attributes
  ----------
  classes_ : array, shape = (n_classes,)
      An array of class labels known to the classifier.
  
  idf_ : array, shape = (n_features,) , or None
      The learned idf vector (global term weights) when ``use_idf=True``,
      None otherwise.
  
  tfidf_ : array, shape = (n_classes, n_words)
      Term-document matrix.
  
  vocabulary_ : dict
      A mapping of feature indices to terms.
  
  References
  ----------
  .. [1] P. Schäfer, "Scalable Time Series Classification". Data Mining and
         Knowledge Discovery, 30(5), 1273-1298 (2016).
  
  Examples
  --------
  >>> from pyts.classification import BOSSVS
  >>> from pyts.datasets import load_gunpoint
  >>> X_train, X_test, y_train, y_test = load_gunpoint(return_X_y=True)
  >>> clf = BOSSVS(window_size=28)
  >>> clf.fit(X_train, y_train)
  BOSSVS(...)
  >>> clf.score(X_test, y_test)
  0.98
class_docstr_tok: ["Bag-of-SFA","Symbols","in","Vector","Space",".","Each","time","series","is","transformed","into","an","histogram","using","the","Bag-of-SFA","Symbols","(","BOSS",")","algorithm",".","Then",",","for","each","class",",","the","histograms","are","added","up","and","a","tf-idf","vector","is","computed",".","The","predicted","class","for","a","new","sample","is","the","class","giving","the","highest","cosine","similarity","between","its","tf","vector","and","the","tf-idf","vectors","of","each","class",".","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_size",":","int","or","float","(","default","=","10",")","Size","of","the","sliding","window",".","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","``","ceil","(","window_size","*","n_timestamps",")","``",".","window_step",":","int","or","float","(","default","=","1",")","Step","of","the","sliding","window",".","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","``","ceil","(","window_step","*","n_timestamps",")","``",".","anova",":","bool","(","default","=","False",")","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","=","False",")","If","True",",","the","first","Fourier","coefficient","(","i.e",".","the","sum","of","the","subseries",")","is","dropped",".","Otherwise",",","it","is","kept",".","norm_mean",":","bool","(","default","=","False",")","If","True",",","center","each","subseries","before","scaling",".","norm_std",":","bool","(","default","=","False",")","If","True",",","scale","each","subseries","to","unit","variance",".","strategy",":","str","(","default","=","'quantile","'",")","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","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",".","numerosity_reduction",":","bool","(","default","=","True",")","If","True",",","delete","sample-wise","all","but","one","occurence","of","back","to","back","identical","occurences","of","the","same","words",".","use_idf",":","bool","(","default","=","True",")","Enable","inverse-document-frequency","reweighting",".","smooth_idf",":","bool","(","default","=","False",")","Smooth","idf","weights","by","adding","one","to","document","frequencies",",","as","if","an","extra","document","was","seen","containing","every","term","in","the","collection","exactly","once",".","Prevents","zero","divisions",".","sublinear_tf",":","bool","(","default","=","True",")","Apply","sublinear","tf","scaling",",","i.e",".","replace","tf","with","1","+","log","(","tf",")",".","Attributes","--","--","--","--","--","classes_",":","array",",","shape","=","(","n_classes",",",")","An","array","of","class","labels","known","to","the","classifier",".","idf_",":","array",",","shape","=","(","n_features",",",")",",","or","None","The","learned","idf","vector","(","global","term","weights",")","when","``","use_idf=True","``",",","None","otherwise",".","tfidf_",":","array",",","shape","=","(","n_classes",",","n_words",")","Term-document","matrix",".","vocabulary_",":","dict","A","mapping","of","feature","indices","to","terms",".","References","--","--","--","--","--","..","[","1","]","P.","Sch\u00e4fer",",","``","Scalable","Time","Series","Classification","''",".","Data","Mining","and","Knowledge","Discovery",",","30","(","5",")",",","1273-1298","(","2016",")",".","Examples","--","--","--","--",">",">",">","from","pyts.classification","import","BOSSVS",">",">",">","from","pyts.datasets","import","load_gunpoint",">",">",">","X_train",",","X_test",",","y_train",",","y_test","=","load_gunpoint","(","return_X_y=True",")",">",">",">","clf","=","BOSSVS","(","window_size=28",")",">",">",">","clf.fit","(","X_train",",","y_train",")","BOSSVS","(","...",")",">",">",">","clf.score","(","X_test",",","y_test",")","0.98"]
code: def __init__(
      self,
      word_size=4,
      n_bins=4,
      window_size=10,
      window_step=1,
      anova=False,
      drop_sum=False,
      norm_mean=False,
      norm_std=False,
      strategy="quantile",
      alphabet=None,
      numerosity_reduction=True,
      use_idf=True,
      smooth_idf=False,
      sublinear_tf=True,
  ):
      self.word_size = word_size
      self.n_bins = n_bins
      self.window_size = window_size
      self.window_step = window_step
      self.anova = anova
      self.drop_sum = drop_sum
      self.norm_mean = norm_mean
      self.norm_std = norm_std
      self.strategy = strategy
      self.alphabet = alphabet
      self.numerosity_reduction = numerosity_reduction
      self.use_idf = use_idf
      self.smooth_idf = smooth_idf
      self.sublinear_tf = sublinear_tf
  
file_path: pyts/pyts/classification/bossvs.py
imports: import numpy
  from math import ceil
  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.metrics.pairwise import cosine_similarity
  from sklearn.preprocessing import LabelEncoder
  from sklearn.feature_extraction.text import TfidfVectorizer
  from ..approximation import SymbolicFourierApproximation
  from ..base import UnivariateClassifierMixin
  from ..utils.utils import _windowed_view
label_desc: Use image node_id 1 to create a new BOSSVS object from inherited base classes: BaseEstimator, UnivariateClassifierMixin with example: obj = BOSSVS(word_size, n_bins, window_size, window_step, anova, drop_sum, norm_mean, norm_std, strategy, alphabet, numerosity_reduction, use_idf, smooth_idf, sublinear_tf)