class_docstr: Ensemble of Bag of Symbolic Fourier Approximation Symbols (BOSS).
  
  Implementation of BOSS Ensemble from Schäfer (2015). [1]_
  
  Overview: Input *n* series of length *m* and BOSS performs a grid search over
  a set of parameter values, evaluating each with a LOOCV. It then retains
  all ensemble members within 92% of the best by default for use in the ensemble.
  There are three primary parameters:
      - *alpha*: alphabet size
      - *w*: window length
      - *l*: word length.
  
  For any combination, a single BOSS slides a window length *w* along the
  series. The w length window is shortened to an *l* length word through
  taking a Fourier transform and keeping the first *l/2* complex coefficients.
  These *l* coefficients are then discretized into alpha possible values,
  to form a word length *l*. A histogram of words for each
  series is formed and stored.
  
  Fit involves finding "n" histograms.
  
  Predict uses 1 nearest neighbor with a bespoke BOSS distance function.
  
  Parameters
  ----------
  threshold : float, default=0.92
      Threshold used to determine which classifiers to retain. All classifiers
      within percentage `threshold` of the best one are retained.
  max_ensemble_size : int or None, default=500
      Maximum number of classifiers to retain. Will limit number of retained
      classifiers even if more than `max_ensemble_size` are within threshold.
  max_win_len_prop : int or float, default=1
      Maximum window length as a proportion of the series length.
  min_window : int, default=10
      Minimum window size.
  save_train_predictions : bool, default=False
      Save the ensemble member train predictions in fit for use in _get_train_probs
      leave-one-out cross-validation.
  alphabet_size : default = 2
      Number of possible letters (values) for each word.
  n_jobs : int, default=1
      The number of jobs to run in parallel for both `fit` and `predict`.
      ``-1`` means using all processors.
  use_boss_distance : boolean, default=True
      The Boss-distance is an asymmetric distance measure. It provides higher
      accuracy, yet is signifaicantly slower to compute.
  feature_selection: {"chi2", "none", "random"}, default: none
      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.
  random_state : int or None, default=None
      Seed for random, integer.
  
  Attributes
  ----------
  n_classes_ : int
      Number of classes. Extracted from the data.
  classes_ : list
      The classes labels.
  n_instances_ : int
      Number of instances. Extracted from the data.
  n_estimators_ : int
      The final number of classifiers used. Will be <= `max_ensemble_size` if
      `max_ensemble_size` has been specified.
  series_length_ : int
      Length of all series (assumed equal).
  estimators_ : list
     List of DecisionTree classifiers.
  
  See Also
  --------
  IndividualBOSS, ContractableBOSS
  
  Notes
  -----
  For the Java version, see
  - `Original Publication <https://github.com/patrickzib/SFA>`_.
  - `TSML <https://github.com/uea-machine-learning/tsml/blob/master/src/main/java/
  tsml/classifiers/dictionary_based/BOSS.java>`_.
  
  
  References
  ----------
  .. [1] Patrick Schäfer, "The BOSS is concerned with time series classification
     in the presence of noise", Data Mining and Knowledge Discovery, 29(6): 2015
     https://link.springer.com/article/10.1007/s10618-014-0377-7
  
  Examples
  --------
  >>> from sktime.classification.dictionary_based import BOSSEnsemble
  >>> from sktime.datasets import load_unit_test
  >>> X_train, y_train = load_unit_test(split="train", return_X_y=True)
  >>> X_test, y_test = load_unit_test(split="test", return_X_y=True) # doctest: +SKIP
  >>> clf = BOSSEnsemble(max_ensemble_size=3) # doctest: +SKIP
  >>> clf.fit(X_train, y_train) # doctest: +SKIP
  BOSSEnsemble(...)
  >>> y_pred = clf.predict(X_test) # doctest: +SKIP
class_docstr_tok: ["Ensemble","of","Bag","of","Symbolic","Fourier","Approximation","Symbols","(","BOSS",")",".","Implementation","of","BOSS","Ensemble","from","Sch\u00e4fer","(","2015",")",".","[","1","]","_","Overview",":","Input","*","n","*","series","of","length","*","m","*","and","BOSS","performs","a","grid","search","over","a","set","of","parameter","values",",","evaluating","each","with","a","LOOCV",".","It","then","retains","all","ensemble","members","within","92","%","of","the","best","by","default","for","use","in","the","ensemble",".","There","are","three","primary","parameters",":","-","*","alpha","*",":","alphabet","size","-","*","w","*",":","window","length","-","*","l","*",":","word","length",".","For","any","combination",",","a","single","BOSS","slides","a","window","length","*","w","*","along","the","series",".","The","w","length","window","is","shortened","to","an","*","l","*","length","word","through","taking","a","Fourier","transform","and","keeping","the","first","*","l\/2","*","complex","coefficients",".","These","*","l","*","coefficients","are","then","discretized","into","alpha","possible","values",",","to","form","a","word","length","*","l","*",".","A","histogram","of","words","for","each","series","is","formed","and","stored",".","Fit","involves","finding","``","n","''","histograms",".","Predict","uses","1","nearest","neighbor","with","a","bespoke","BOSS","distance","function",".","Parameters","--","--","--","--","--","threshold",":","float",",","default=0.92","Threshold","used","to","determine","which","classifiers","to","retain",".","All","classifiers","within","percentage","`","threshold","`","of","the","best","one","are","retained",".","max_ensemble_size",":","int","or","None",",","default=500","Maximum","number","of","classifiers","to","retain",".","Will","limit","number","of","retained","classifiers","even","if","more","than","`","max_ensemble_size","`","are","within","threshold",".","max_win_len_prop",":","int","or","float",",","default=1","Maximum","window","length","as","a","proportion","of","the","series","length",".","min_window",":","int",",","default=10","Minimum","window","size",".","save_train_predictions",":","bool",",","default=False","Save","the","ensemble","member","train","predictions","in","fit","for","use","in","_get_train_probs","leave-one-out","cross-validation",".","alphabet_size",":","default","=","2","Number","of","possible","letters","(","values",")","for","each","word",".","n_jobs",":","int",",","default=1","The","number","of","jobs","to","run","in","parallel","for","both","`","fit","`","and","`","predict","`",".","``","-1","``","means","using","all","processors",".","use_boss_distance",":","boolean",",","default=True","The","Boss-distance","is","an","asymmetric","distance","measure",".","It","provides","higher","accuracy",",","yet","is","signifaicantly","slower","to","compute",".","feature_selection",":","{","``","chi2","''",",","``","none","''",",","``","random","''","}",",","default",":","none","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",".","random_state",":","int","or","None",",","default=None","Seed","for","random",",","integer",".","Attributes","--","--","--","--","--","n_classes_",":","int","Number","of","classes",".","Extracted","from","the","data",".","classes_",":","list","The","classes","labels",".","n_instances_",":","int","Number","of","instances",".","Extracted","from","the","data",".","n_estimators_",":","int","The","final","number","of","classifiers","used",".","Will","be","<","=","`","max_ensemble_size","`","if","`","max_ensemble_size","`","has","been","specified",".","series_length_",":","int","Length","of","all","series","(","assumed","equal",")",".","estimators_",":","list","List","of","DecisionTree","classifiers",".","See","Also","--","--","--","--","IndividualBOSS",",","ContractableBOSS","Notes","--","--","-","For","the","Java","version",",","see","-","`","Original","Publication","<","https",":","\/\/github.com\/patrickzib\/SFA",">","`","_",".","-","`","TSML","<","https",":","\/\/github.com\/uea-machine-learning\/tsml\/blob\/master\/src\/main\/java\/","tsml\/classifiers\/dictionary_based\/BOSS.java",">","`","_",".","References","--","--","--","--","--","..","[","1","]","Patrick","Sch\u00e4fer",",","``","The","BOSS","is","concerned","with","time","series","classification","in","the","presence","of","noise","''",",","Data","Mining","and","Knowledge","Discovery",",","29","(","6",")",":","2015","https",":","\/\/link.springer.com\/article\/10.1007\/s10618-014-0377-7","Examples","--","--","--","--",">",">",">","from","sktime.classification.dictionary_based","import","BOSSEnsemble",">",">",">","from","sktime.datasets","import","load_unit_test",">",">",">","X_train",",","y_train","=","load_unit_test","(","split=","''","train","''",",","return_X_y=True",")",">",">",">","X_test",",","y_test","=","load_unit_test","(","split=","''","test","''",",","return_X_y=True",")","#","doctest",":","+SKIP",">",">",">","clf","=","BOSSEnsemble","(","max_ensemble_size=3",")","#","doctest",":","+SKIP",">",">",">","clf.fit","(","X_train",",","y_train",")","#","doctest",":","+SKIP","BOSSEnsemble","(","...",")",">",">",">","y_pred","=","clf.predict","(","X_test",")","#","doctest",":","+SKIP"]
code: def _include_in_ensemble(self, acc, max_acc, min_max_acc, size):
      if acc >= max_acc * self.threshold:
          if size >= self.max_ensemble_size:
              return acc > min_max_acc
          else:
              return True
      return False
  
imports: from copy import copy
  from itertools import compress
  import numpy
  from joblib import Parallel, effective_n_jobs
  from sklearn.metrics import pairwise
  from sklearn.utils import check_random_state, gen_even_slices
  from sklearn.utils.extmath import safe_sparse_dot
  from sklearn.utils.fixes import delayed
  from sklearn.utils.sparsefuncs_fast import csr_row_norms
  from sklearn.utils.validation import _num_samples
  from sktime.classification.base import BaseClassifier
  from sktime.transformations.panel.dictionary_based import SFAFast
  from sktime.utils.validation.panel import check_X_y
label_desc: Use image node_id 5 for calling the BOSSEnsemble obj's underlying member method code with example usage: obj._include_in_ensemble(acc, max_acc, min_max_acc, size) and returns: False, unknown, True