# Time Series Classification with Shapelet and Canonical Features
## 3 Definition and Background
### Shapelet Transformtion Technology  
In order to overcome the shortcomings of the original Shapelet-based classification algorithm that can only build a decision tree classification model, [PERSON] et al. (2016) proposed the Shapelet transformation technology, which separates the two stages of Shapelet discovery and the classifier training, and the converted data can be directly used to train various classification models, which greatly improves the flexibility of the application of Shapelet. Algorithm 1 describes the specific process of the Shapelet transformation algorithm. ```
1:\(S\), \(T\), \(S^{\prime}

As described in Section 3.1, when calculating the distance between Shapelet \(\textbf{S}_{j}\) and the time series \(\textbf{T}_{j}\), we obtained the subsequence \(\textbf{S}^{\prime}\) (line 6) that is most similar to \(\textbf{S}_{j}\) in the \(\textbf{T}_{i}\) under the Euclidean distance measure. However, \(\textbf{S}^{\prime}\) is not shown to be explicitly utilized in Algorithm 1. In Section 4, we will describe how to fully exploit the discriminative information contained in it by embedding typical time series features. It is also important to note that the Shapelets found in the training set are used when transforming the test set. ### Typical Time Series Characteristics (Catch22)

Catch22 (22 canonical time series characteristics) is a feature set of 22 typical time series features which was designed to assist time series analysis, particularly time series classification, through a concise, diverse, and informative set of descriptive features. The vast majority of time series in UCR time series datasets have been normalized by Z-score [7; 15] (standardized time series whose mean value equals to 0, variance equals to 1). Catch22 was originally proposed to perform feature transformation on the entire time series, thus deliberately excluding features sensitive to mean and variance. However, the RSFCF algorithm proposed in this paper is based on the local characteristics of the time series, which performs feature transformation on the subsequence instead of the entire time series. Generally, the mean value and variance of subsequences contain a wealth of discriminating information [14]. For example, mean value can distinguish between subsequences of similar shapes but different amplitudes; variance reflects the degree of dispersion of subsequences. Therefore, in addition to the Catch22 feature set, we also introduce two features: mean and variance. Moreover, since the slope feature reflects the trend of subsequences well and was successfully applied in [3; 14], we also introduce it into the algorithm. In total, the RSFCF algorithm proposed in this paper uses a total of 25 features, namely mean, variance, slope, and 22 Catch22 features. In the following, we refer to these 25 characteristics collectively as typical time series features. ## 4 Algorithm

This section describes in detail the random Shapelet forest algorithm (RSFCF). Firstly, a novel data transformation method is introduced, which fully excavates the discriminating information in Shapelet by embedding multiple time series features in Shapelet. Secondly, the construction and classification process of RSFCF model is described. The time complexity analysis of RSFCF algorithm is given at last. ### Random Shapelet Transformation Embedded with Typical Time Series Features

To improve efficiency while reducing accuracy loss, a new random Shapelet transformation method embedded with typical time series features is proposed on the basis of the traditional Shapelet transformation technique introduced in Section 3.2. The transformation method (Algorithm 2) first randomly selects \(k\) Shapelets from all possible subsequences of the training set according to the specified minimum and maximum length of Shapelet (line 1), and records the starting position of each Shapelet (e.g., \(\mathbf{Locations[i]}=10\) indicates that the starting position of the \(i\)th Shapelet is at index 10).