# A New Method of Time-Series Event Prediction Based on Sequence Labeling
## 2 Definitions and Methods  
### Definitions  
**Definition 1** (Time-Series). : \(\{T_{1},T_{2},\ \ldots,T_{N}\}\) _is a panel data set, which contains the \(N\) time series with length \(K\times L\) (i.e., \(N\) samples), for any sample \(T_{i}\), there are \(K\) subsequences divided in chronological order, denoted as \(T_{i}=\{(X_{1},Y_{1}),(X_{2},Y_{2}),\ \ldots,(X_{K},Y_{K})\}\), where \(X_{k}\in\mathcal{R}^{L\times D}\) is the \(k\)-th subsequence of \(T_{i}\), which can be expressed as \(X_{k}=\{x_{1},x_{2},\ \ldots,x_{L}\}\), where \(L\) is a hyperparameter, which has different values in different data sets (e.g., there is \(L=7\) days in a week), \(x_{l}\in\mathcal{R}^{D}\) is a \(D\)-dimensional observation value of the time series at time \(l\), and \(Y_{k}\in Z\) is the observation event of the \(k\)-th subsequence [18] (e.g., if abnormality occurs, the value is 1). For the convenience of understanding this article, the definition set table is attached in the Appendix A Table A1._  
**Definition 2** (Time-Series Event Prediction). : _Taking the \(i\)-th sample \(T_{i}\) as an example, use the sliding window method to obtain \(M\) data sets containing \(\tau\) subsequences from \(T_{i}\), denoted as \(T^{\tau}=\{T_{1}^{\tau},T_{2}^{\tau},\ \ldots,T_{M}^{\tau}\}\), where \(T_{m}^{\tau}=\{X_{m},X_{m}+1,\ \ldots,X_{m+\tau-1}\}\); this paper refers to \(T_{m}^{\tau}\) as \"Subsequence Set\" \((m=1,2,\ \ldots,M)\). Time series event prediction is to predict the event \(\hat{Y}_{m+\tau}\) of the \(m+\tau-th\) subsequence based on the subsequence set \(T_{m}^{\tau}\)[19], where \(\tau\) is called the prediction history length, and \(M=K-\tau+1\). For the prediction problem solved in this paper, there are the following assumptions:_  
* _Each time series is independent and evenly distributed;_
* _The past of the event will continue into the future;_
* _The divided subsequence is appropriate for the description of the event._  
**Definition 3** (Pattern and Pattern Recognition). : _The representative subsequence pattern in the time series is represented by the symbol \(\Theta_{v}\in\mathcal{R}^{L\times D}\)[20]. Use the sequence clustering method to identify all patterns from the data set, the pattern set is \(\Theta=\{\Theta_{1},\Theta_{2},\ \ldots,\Theta_{V}\}\), and the number of patterns \(V\) is a hyperparameter._  
**Definition 4** (Classification Event Prediction Method). : _In this paper, the following two traditional time series time prediction methods are called classification event prediction methods. (1) The first method is to predict the subsequence value \(\hat{X}_{m+\tau}\) in the \(m+\tau-th\) time period based on the subsequence set \(T_{m}^{\tau}\), and then classify \(\hat{X}_{m+\tau}\) to obtain the event prediction result \(\hat{Y}_{m+\tau}\) ; (2) The second method is to take the subsequence set \(T_{m}^{\tau}\) as an independent individual, extract the numerical features in the \(T_{m}^{\tau}\) as the input of the classifier, and use the event prediction result \(\hat{Y}_{m+\tau}\) as the output of the classifier. It can be seen that these two methods are classification algorithms that do not consider the time factor between the subsequence sets \(T_{m}^{\tau}\)._  
**Definition 5** (Sequence Labeling Problem). : _The sequence labeling problem is one of the most common problems in Natural Language Processing (NLP) [21]. The so-called \"sequence labeling\" means that for a linear observation sequence \(A=\{A_{1},A_{2},\ \ldots,A_{M}\}\), each element in the sequence is labeled with a certain label in the label set to obtain the output. The sequence \(B=\{B_{1},B_{2},\ \ldots,B_{M}\}\), that is, the \(m\)-th observation value \(A_{m}\), is labeled as \(B_{m}\), \((m=1,2,\ \ldots,M)\)._  
**Definition 6** (Labeling Event Prediction Method). : _Sequence labeling is a classification method that takes into account the time factor.