sktime.classification.shapelet_based.mrseql.mrseql¶
-
class
sktime.classification.shapelet_based.mrseql.mrseql.
AdaptedSFA
(N, w, a)[source]¶ Bases:
object
SFA adaptation for Mr-SEQL. This code uses a different alphabet for each Fourier coefficient in the output of SFA.
-
class
sktime.classification.shapelet_based.mrseql.mrseql.
MrSEQLClassifier
(seql_mode='fs', symrep='sax', custom_config=None)[source]¶ Bases:
sktime.classification.base.BaseClassifier
Time Series Classification with multiple symbolic representations and SEQL (Mr-SEQL)
@article{mrseql, author = {Le Nguyen, Thach and Gsponer, Severin and Ilie, Iulia and O’reilly, Martin and Ifrim, Georgiana}, title = {Interpretable Time Series Classification Using Linear Models and Multi-resolution Multi-domain Symbolic Representations}, journal = {Data Mining and Knowledge Discovery}, volume = {33}, number = {4}, year = {2019}, }
Overview: Mr-SEQL is a time series classifier that learn from multiple symbolic representations of multiple resolutions and multiple domains. Currently, Mr-SEQL supports both SAX and SFA representations.
- Parameters
seql_mode (str, either 'clf' or 'fs'. In the 'clf' mode, Mr-SEQL is an ensemble of SEQL models while in the 'fs' mode Mr-SEQL trains a logistic regression model with features extracted by SEQL from symbolic representations of time series.) –
symrep (list or tuple, should contains only 'sax' or 'sfa' or both. The symbolic representations to be used to transform the input time series.) –
custom_config (dict, customized parameters for the symbolic transformation. If defined, symrep will be ignored.) –
-
fit
(X, y)[source]¶ Fit the model according to the given training time series data. :param X: :type X: Time series data. :param y: :type y: Target vector relative to X.
- Returns
Fitted estimator.
- Return type
self
-
map_sax_model
(ts)[source]¶ For interpretation. Returns vectors of weights with the same length of the input time series. The weight of each point implies its contribution in the classification decision regarding the class.
- Parameters
ts (A single time series.) –
- Returns
weighted_ts
- Return type
ndarray of (number of classes, length of time series)
Note
Only supports univariate time series and SAX features.
-
predict
(X)[source]¶ Predict class labels for samples in X. :param X: :type X: time series data.
- Returns
C – Predicted class label per sample.
- Return type
array
-
predict_proba
(X)[source]¶ If seql_mode is set to ‘fs’, it returns the estimation by sklearn logistic regression model. Otherwise (seql_mode == ‘clf’), it returns normalized probability estimated with one-versus-all method.
- Parameters
X (time series data.) –
- Returns
T – Returns the probability of the sample for each class in the model, where classes are ordered as they are in
self.classes_
.- Return type
array-like of shape (n_samples, n_classes)
-
class
sktime.classification.shapelet_based.mrseql.mrseql.
PySAX
[source]¶ Bases:
object
Wrapper of SAX C++ implementation.