class_docstr: Symbolic Fourier Approximation (SFA) Transformer.
  
  Overview: for each series:
      run a sliding window across the series
      for each window
          shorten the series with DFT
          discretise the shortened series into bins set by MFC
          form a word from these discrete values
  by default SFA produces a single word per series (window_size=0)
  if a window is used, it forms a histogram of counts of words.
  
  Parameters
  ----------
      word_length:         int, default = 8
          length of word to shorten window to (using PAA)
  
      alphabet_size:       int, default = 4
          number of values to discretise each value to
  
      window_size:         int, default = 12
          size of window for sliding. Input series
          length for whole series transform
  
      norm:                boolean, default = False
          mean normalise words by dropping first fourier coefficient
  
      binning_method:      {"equi-depth", "equi-width", "information-gain", "kmeans",
                            "quantile"},
                           default="equi-depth"
          the binning method used to derive the breakpoints.
  
      anova:               boolean, default = False
          If True, the Fourier coefficient selection is done via a one-way
          ANOVA test. If False, the first Fourier coefficients are selected.
          Only applicable if labels are given
  
      variance:               boolean, default = False
          If True, the Fourier coefficient selection is done via the largest
          variance. If False, the first Fourier coefficients are selected.
          Only applicable if labels are given
  
      save_words:          boolean, default = False
          whether to save the words generated for each series (default False)
  
      bigrams:             boolean, default = False
          whether to create bigrams of SFA words
  
      feature_selection: {"chi2", "none", "random"}, default: chi2
          Sets the feature selections strategy to be used. Chi2 reduces the number
          of words significantly and is thus much faster (preferred). Random also
          reduces the number significantly. None applies not feature selectiona and
          yields large bag of words, e.g. much memory may be needed.
  
      p_threshold:  int, default=0.05 (disabled by default)
          If feature_selection=chi2 is chosen, feature selection is applied based on
          the chi-squared test. This is the p-value threshold to use for chi-squared
          test on bag-of-words (lower means more strict). 1 indicates that the test
          should not be performed.
  
      max_feature_count:  int, default=256
          If feature_selection=random is chosen, this parameter defines the number of
          randomly chosen unique words used.
  
      skip_grams:     boolean, default = False
          whether to create skip-grams of SFA words
  
      remove_repeat_words: boolean, default = False
          whether to use numerosity reduction (default False)
  
      return_sparse:  boolean, default=True
          if set to true, a scipy sparse matrix will be returned as BOP model.
          If set to false a dense array will be returned as BOP model. Sparse
          arrays are much more compact.
  
      n_jobs:     int, optional, default = 1
          The number of jobs to run in parallel for both `transform`.
          ``-1`` means using all processors.
  
      return_pandas_data_series:          boolean, default = False
          set to true to return Pandas Series as a result of transform.
          setting to true reduces speed significantly but is required for
          automatic test.
  
  Attributes
  ----------
  breakpoints: = []
  num_insts = 0
  num_atts = 0
  
  
  References
  ----------
  .. [1] Schäfer, Patrick, and Mikael Högqvist. "SFA: a symbolic fourier approximation
  and  index for similarity search in high dimensional datasets." Proceedings of the
  15th international conference on extending database technology. 2012.
class_docstr_tok: ["Symbolic","Fourier","Approximation","(","SFA",")","Transformer",".","Overview",":","for","each","series",":","run","a","sliding","window","across","the","series","for","each","window","shorten","the","series","with","DFT","discretise","the","shortened","series","into","bins","set","by","MFC","form","a","word","from","these","discrete","values","by","default","SFA","produces","a","single","word","per","series","(","window_size=0",")","if","a","window","is","used",",","it","forms","a","histogram","of","counts","of","words",".","Parameters","--","--","--","--","--","word_length",":","int",",","default","=","8","length","of","word","to","shorten","window","to","(","using","PAA",")","alphabet_size",":","int",",","default","=","4","number","of","values","to","discretise","each","value","to","window_size",":","int",",","default","=","12","size","of","window","for","sliding",".","Input","series","length","for","whole","series","transform","norm",":","boolean",",","default","=","False","mean","normalise","words","by","dropping","first","fourier","coefficient","binning_method",":","{","``","equi-depth","''",",","``","equi-width","''",",","``","information-gain","''",",","``","kmeans","''",",","``","quantile","''","}",",","default=","''","equi-depth","''","the","binning","method","used","to","derive","the","breakpoints",".","anova",":","boolean",",","default","=","False","If","True",",","the","Fourier","coefficient","selection","is","done","via","a","one-way","ANOVA","test",".","If","False",",","the","first","Fourier","coefficients","are","selected",".","Only","applicable","if","labels","are","given","variance",":","boolean",",","default","=","False","If","True",",","the","Fourier","coefficient","selection","is","done","via","the","largest","variance",".","If","False",",","the","first","Fourier","coefficients","are","selected",".","Only","applicable","if","labels","are","given","save_words",":","boolean",",","default","=","False","whether","to","save","the","words","generated","for","each","series","(","default","False",")","bigrams",":","boolean",",","default","=","False","whether","to","create","bigrams","of","SFA","words","feature_selection",":","{","``","chi2","''",",","``","none","''",",","``","random","''","}",",","default",":","chi2","Sets","the","feature","selections","strategy","to","be","used",".","Chi2","reduces","the","number","of","words","significantly","and","is","thus","much","faster","(","preferred",")",".","Random","also","reduces","the","number","significantly",".","None","applies","not","feature","selectiona","and","yields","large","bag","of","words",",","e.g",".","much","memory","may","be","needed",".","p_threshold",":","int",",","default=0.05","(","disabled","by","default",")","If","feature_selection=chi2","is","chosen",",","feature","selection","is","applied","based","on","the","chi-squared","test",".","This","is","the","p-value","threshold","to","use","for","chi-squared","test","on","bag-of-words","(","lower","means","more","strict",")",".","1","indicates","that","the","test","should","not","be","performed",".","max_feature_count",":","int",",","default=256","If","feature_selection=random","is","chosen",",","this","parameter","defines","the","number","of","randomly","chosen","unique","words","used",".","skip_grams",":","boolean",",","default","=","False","whether","to","create","skip-grams","of","SFA","words","remove_repeat_words",":","boolean",",","default","=","False","whether","to","use","numerosity","reduction","(","default","False",")","return_sparse",":","boolean",",","default=True","if","set","to","true",",","a","scipy","sparse","matrix","will","be","returned","as","BOP","model",".","If","set","to","false","a","dense","array","will","be","returned","as","BOP","model",".","Sparse","arrays","are","much","more","compact",".","n_jobs",":","int",",","optional",",","default","=","1","The","number","of","jobs","to","run","in","parallel","for","both","`","transform","`",".","``","-1","``","means","using","all","processors",".","return_pandas_data_series",":","boolean",",","default","=","False","set","to","true","to","return","Pandas","Series","as","a","result","of","transform",".","setting","to","true","reduces","speed","significantly","but","is","required","for","automatic","test",".","Attributes","--","--","--","--","--","breakpoints",":","=","[","]","num_insts","=","0","num_atts","=","0","References","--","--","--","--","--","..","[","1","]","Sch\u00e4fer",",","Patrick",",","and","Mikael","H\u00f6gqvist",".","``","SFA",":","a","symbolic","fourier","approximation","and","index","for","similarity","search","in","high","dimensional","datasets",".","''","Proceedings","of","the","15th","international","conference","on","extending","database","technology",".","2012","."]
code: def _mcb(self, dft):
      breakpoints = np.zeros(
          (self.word_length_actual, self.alphabet_size)
      )
  
      dft = np.round(dft, 2)
      for letter in range(self.word_length_actual):
          column = np.sort(dft[:, letter])
          bin_index = 0
  
          # use equi-depth binning
          if self.binning_method == "equi-depth":
              target_bin_depth = len(dft) / self.alphabet_size
  
              for bp in range(self.alphabet_size - 1):
                  bin_index += target_bin_depth
                  breakpoints[letter, bp] = column[int(bin_index)]
  
          # use equi-width binning aka equi-frequency binning
          elif self.binning_method == "equi-width":
              target_bin_width = (
                  column[-1] - column[0]
              ) / self.alphabet_size
  
              for bp in range(self.alphabet_size - 1):
                  breakpoints[letter, bp] = (
                      bp + 1
                  ) * target_bin_width + column[0]
  
      breakpoints[:, self.alphabet_size - 1] = sys.float_info.max
      return breakpoints
  
imports: import math
  import multiprocessing
  import sys
  import numpy
  import pandas
  from sklearn.feature_selection import chi2, f_classif
  from sklearn.preprocessing import KBinsDiscretizer
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.utils import check_random_state
  from sktime.transformations.base import BaseTransformer
  from sktime.utils.validation.panel import check_X
label_desc: Use image node_id 8 for calling the SFAFast obj's underlying member method code with example usage: obj._mcb(dft) and returns: breakpoints