Zurück zu den Modellen
Classifier

ContractableBOSS

Predict probaTrain estimateContractable

Contractable Bag of Symbolic Fourier Approximation Symbols (cBOSS).

Implementation of BOSS Ensemble from Schäfer (2015) with refinements described in Middlehurst, Vickers and Bagnall (2019). [1, 2]_

Overview: Input “n” series of length “m” and cBOSS randomly samples n_parameter_samples parameter sets, evaluating each with LOOCV. It then retains max_ensemble_size classifiers with the highest accuracy 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 by taking a Fourier transform and keeping the first l/2 complex coefficients. These “l” coefficients are then discretised 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.

Schnellstart

python
from sktime.classification.dictionary_based import ContractableBOSS

estimator = ContractableBOSS(n_parameter_samples=250, max_ensemble_size=50, max_win_len_prop=1, min_window=10, time_limit_in_minutes=0.0, contract_max_n_parameter_samples=inf, save_train_predictions=False, feature_selection='none', n_jobs=1, random_state=None)

Parameter(10)

n_parameter_samplesint, default = 250
If search is randomised, number of parameter combos to try.
max_ensemble_sizeint or None, default = 50

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_propint or float, default = 1
Maximum window length as a proportion of the series length.
min_windowint, default = 10
Minimum window size.
time_limit_in_minutesint, default = 0
Time contract to limit build time in minutes. Default of 0 means no limit.
contract_max_n_parameter_samplesint, default=np.inf
Max number of parameter combinations to consider when time_limit_in_minutes is set.
save_train_predictionsbool, default=False
Save the ensemble member train predictions in fit for use in _get_train_probs leave-one-out cross-validation.
n_jobsint, default = 1

The number of jobs to run in parallel for both fit and predict. -1 means using all processors.

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_stateint or None, default=None
Seed for random integer.

Beispiele

>>> from sktime.classification.dictionary_based import ContractableBOSS
>>> 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)
>>> clf = ContractableBOSS (
... n_parameter_samples = 10, max_ensemble_size = 3
... )
>>> clf. fit (X_train, y_train) ContractableBOSS(
... )
>>> y_pred = clf. predict (X_test)

Referenzen

[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

[2]

Matthew Middlehurst, William Vickers and Anthony Bagnall “Scalable Dictionary Classifiers for Time Series Classification”, in proc 20th International Conference on Intelligent Data Engineering and Automated Learning,LNCS, volume 11871 https://link.springer.com/chapter/10.1007/978-3-030-33607-3_2