# Scale-BOSS-MR: Scalable Time Series Classification Using Multiple Symbolic Representations +
## 3 Framework Description: From SCALE-BOSS to SCALE-BOSS-MR
Line 6 maintains the resulting term-frequency vector by concatenating column-wise term-frequency vectors produced by each window and dilation configuration. Lines 11 and 12 of the algorithm initialize an empty term-frequency vector for the train and test set, respectively. In Line 13, the algorithm computes the term-frequency vector for the training set. Figure 2: SCALE-BOSS-MR workflow. ```
Input :X: the training set Input :y_train: the labels for the training set Input :X_test: the test set Input :window_configs: the window sizes and steps Input :dilation_filter_configs: the dilation filter sizes Input : classifier that can work on term-frequency vectors Output :predicted: the predictions for the test set
1 FunctionSBMR-inner(X,window_configs, dilation_filter_configs, global_term_frequency_vector):
2 forcurr_window_configs inwindow_configs do
3 forcurr_dilation_filter indilation_filter_configs do
4X_dilated \(\leftarrow\) dilation (X_curr_dilation_filter) curr_term_frequency_vector_train+- process_time_series (X_dilated_curr_window_config) global_term_frequency_vector \(\leftarrow\) hstack (global_term_frequency_vector,curr_term_frequency_vector)
5 endfor
6
7 endfor
8
9 endfor
10
11 global_term_frequency_vector_train \(\leftarrow\) array () global_term_frequency_vector_test \(\leftarrow\) array ()
12 SBMR-inner (X,window_configs, dilation_filter_configs, global_term_frequency_vector_train)
13 ifdoTrend then
14X_trend_train \(\leftarrow\) diff (X)
15 SBMR-inner (X_trend_train,window_configs, dilation_filter_configs, global_term_frequency_vector_train)
16 clf_fit (global_term_frequency_vector_train,y_train)
17 SBMR-inner (X_test,window_configs, dilation_filter_configs, global_term_frequency_vector_test)
18 ifdoTrend then
19X_trend_test \(\leftarrow\) diff (X_test)
20
21 SBMR-inner (X_trend_test,window_configs, dilation_filter_configs, global_term_frequency_vector_test)
22
23 predicted \(\leftarrow\) clf.predict (global_term_frequency_vector_test)
24 return predicted
```  
**Algorithm 1**SCALE-BOSS-MR algorithm  
Incorporating first-order differences into the process is an optional alternative, and one can configure the method using the _doTrend_ variable. In Lines 14 to 16, the algorithm calls for the SBMR function for the first-order differences' time series of the training set, maintaining the resulting term-frequency vector by concatenating column-wise term-frequency vectors produced by each window and dilation configuration. In Line 17, the classifier is trained on the final term-frequency vectors for the training set. Similarly, in Line 18, the algorithm calls for the SBMR function for the first-order differences' time series of the test set and proceeds in Lines 19 to 21 to compute the term-frequency vector for the test set. Finally, in Line 22, the classifier makes its predictions, taking as input the final concatenated term-frequency vector for the test set. The framework has been implemented on top of the ptyts [30] Time Series Classification library. The source code of the SCALE-BOSS-MR implementation is provided in [[https://github.com/aglenis/scale_boss_mr](https://github.com/aglenis/scale_boss_mr)]([https://github.com/aglenis/scale_boss_mr](https://github.com/aglenis/scale_boss_mr)) (accessed on 8 January 2024). We have chosen the word length to be equal to four in all the configurations we explore, given that it is the \"default\" for the BOSS-VS implementation of ptyts. Additionally, when computing the symbolic representation, we use unigrams, or unigrams and bigrams: Using bigrams and unigrams helps retain sequence information that is inherently lost in the bag-of-words model. As a final note, it is clear from the specified algorithm that trend information is split in parts by the windowing process applied on first-order differences' time series, according to the windowing and dilation configurations. For the different clustering algorithms and classifiers, we have used the implementations provided by the Sci-kit Learn [31] python library.