Window-based time sequence data clustering method using modeling dimension reduction
By adopting window-based modeling and dimensionality reduction method in time series data clustering, the problems of weak generalization ability of conventional dimensionality reduction methods and poor data mutation processing are solved, and more efficient and accurate time series data aggregation is achieved. class, with stronger timeliness and integration.
Patent Information
- Application Number
- CN202411492772.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-02-14
AI Technical Summary
The conventional dimensionality reduction method in time series data clustering does not contain the characteristics of data prediction, has weak generalization ability, low dimensional compression, and fails to effectively deal with the problem of time series data variation caused by external factors.
Using window-based time series data clustering method using modeling and dimensionality reduction, the differential time series is calculated through window sliding and zero mean processing, time series modeling is performed, modeling the model parameter vectors are screened as eigenvalues for clustering analysis, and real-time Monitor and adjust windows to deal with data variability.
It improves the accuracy and efficiency of time-series data clustering, enhances generalization capabilities, ensures data timeliness and consistency, and designs a highly integrated clustering framework to support fast verification and real-time monitoring.
Smart Images

Figure CN119441923A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a time series data clustering method, belonging to the technical field of data mining. Background Art
[0002] Data mining is an interdisciplinary research field that aims to discover valuable information, patterns and knowledge from massive data sets. It combines theories and methods from multiple fields such as statistics, machine learning, artificial intelligence and database technology to reveal the implicit relationships and patterns in data through exploratory analysis. Cluster analysis, as a basic task of data mining, focuses on data segmentation under unsupervised learning, that is, dividing a group of objects into several sets according to the principle of similarity. The members in each set have high similarity, while there are large differences between different sets.
[0003] At present, the mainstream methods for clustering time series data are as follows: Figure 1 As shown in the figure. First, configure the parameters of data preprocessing method, dimensionality reduction method, and clustering method, specify the time series data set, and then perform data preprocessing such as standardization on each time series data set. Then use the dimensionality reduction method to reduce the dimension of the time series data set (or directly use the original data). Finally, use the clustering method to perform cluster analysis on the time series data. Data preprocessing usually uses zero mean, normalization, etc. Dimensionality reduction methods usually use principal component analysis (PCA), linear discriminant analysis (LDA), self-organizing maps (SOM), etc. Clustering methods usually use K-means, K-means++, hierarchical clustering, etc. [3].
[0004] At present, the technical research on time series data clustering mainly focuses on two aspects: data preprocessing and clustering methods. Data preprocessing focuses on changing the original time series data through time windows, data clipping, data deformation and other methods. Its purpose is to improve the clustering accuracy of clustering methods on preprocessed time series data. Clustering methods focus on the construction of clustering methods and the distance measurement methods between time series data [1, 2]. In terms of clustering method construction, there are many studies such as deformation clustering methods based on K-means and two-step clustering methods; in terms of distance measurement methods, due to the particularity of time series data, when measuring the distance between two time series data, using dynamic time warping methods to measure may achieve better results than using traditional Euclidean distance. In addition, there is also research on the design of new distance measurement methods between time series data.
[0005] In the past, there was little research on dimensionality reduction of time series data, especially through modeling, using model parameters as feature vectors. Conventional dimensionality reduction methods do not contain the characteristics of data prediction, have weak generalization ability, and have low dimensionality compression under the condition of the same feature capture degree.
[0006] Traditional methods do not consider the problem of time series data variation caused by external factors, that is, the same time series data may be composed of multiple time series data with different characteristics. Therefore, they usually simply include all time series data, or manually select data segments, and cannot be adjusted dynamically.
[0007] In the past, the main focus was on the design and research of new components, lacking integration, and the design of a time series data clustering framework. New technologies related to time series data clustering could not be quickly and flexibly put online for verification, and real-time monitoring and clustering analysis of time series data could not be formed.
[0008] References:
[0009] [1] Du Ronghao. Improved clustering algorithm for large-scale time series data[D]. Beijing Jiaotong University, 2017.
[0010] [2]Xu Y, Yang C, Peng S, et al.A hybrid two-stage financial stockforecasting algprithm based on clustering and ensemble learning[J].AppliedIntelligence,2020,50:3852-3867.
[0011] [3]Aghabozorgi S,Shirkhorshidi AS,Wah T Y.Time-series clusteringadecade review[J].Information systems,2015,53:16-38. Summary of the invention
[0012] The technical problem to be solved by the present invention is that conventional dimensionality reduction methods in time series data clustering do not contain features for data prediction, have weak generalization capabilities, and have low dimensionality compression under the condition of the same feature capture degree.
[0013] In order to solve the above technical problems, the technical solution of the present invention is to disclose a time series data clustering method based on window using modeling and dimension reduction, which is characterized by comprising the following steps:
[0014] Step 1: Initialize configuration parameters and specify the time series dataset object for cluster analysis;
[0015] Step 2: Preprocess the time series data set, including the following steps:
[0016] Slide the window to each time series D in the time series dataset Data i the end of
[0017] For each time series D in the time series data set Data i The data in the terminal window of is processed with zero mean;
[0018] For each time series D in the time series data set Data i The data in the terminal window of , calculate the first-order difference time series data set Data first ={D first1 ,D first2 ,…,D firstn}, logarithmic first-order difference time series data set Data first-log ={D first-log1 ,D first-log2 ,…,D first-logn}, second-order difference time series data set Data second ={D second1 ,D second2 ,…,D secondn}, logarithmic second-order difference time series data set Data second-log ={D second-log1 ,D second-log2 ,…,D second-logn ;
[0019] Step 3: After stationarity test preprocessing, multiple potential time series data sets are formed, and the object data set D that meets the time series modeling conditions is screened out;
[0020] Step 4: Model each time series in the object data set D through the process of time series modeling, heteroscedastic time series modeling, and model screening to form a corresponding model parameter vector, and perform cluster analysis with each model parameter vector as a eigenvalue;
[0021] Step 5: Visualize the output results.
[0022] Preferably, in step 3, the time series data set Data and the first-order difference time series data set Data first , logarithmic first-order difference time series data set Data first-log , second-order difference time series data set Data second , Logarithmic second-order difference time series data set Data second-logPerform ADF stationarity test on each time series in, according to the time series data set Data, the first-order difference time series data set Data first , logarithmic first-order difference time series data set Data first-log , second-order difference time series data set Data second , Logarithmic second-order difference time series data set Data second-log The first data set that satisfies the ADF test H0 hypothesis condition that each time series in the data set denies is selected from the front to the back as the object data set D for modeling cluster analysis.
[0023] Preferably, step 4 comprises:
[0024] Step 401: Perform AR modeling analysis on the first rW part of each time series in the data set D within the maximum lag max_log, and select two modeling parameters p according to the AIC and BIC criteria. AIC , p BIC , corresponding to the model AR i (p AIC ) and AR i (p BIC );
[0025] Step 402: For each time series in the data set D, the model AR i (p AIC ) and AR i (p BIC ) is tested for the residual square sequence. If the original hypothesis is rejected, ARCH modeling is performed on the model; otherwise, the original model is retained.
[0026] Step 403: Perform Ljung-Box white noise test on the residual sequences of at most four models of each time series in the data set D, and discard the models that fail the Ljung-Box white noise test;
[0027] Step 404: For each time series in the data set D, use at most four models to predict the next (1-r)W parts of data, and calculate the root mean square error:
[0028] If AR i (p BIC ) / ARCH i (p BIC ,q BIC ) and the minimum root mean square error are within the tolerance error_t, then select AR i (p BIC ) / ARCH i (p BIC ,q BIC) as the model of the corresponding time series; otherwise, there is a corresponding ARCH i (p BIC ,q AIC ) model, and the absolute value of the difference between its RMS error and the minimum RMS error is within the tolerance error_t, then select ARCH i (p BIC ,q AIC ) as the model of the corresponding time series; otherwise, the model with the smallest root mean square error is selected as the model of the corresponding time series;
[0029] Step 405: align the length of the model parameter vector of each time series in the data set D, that is, fill the parameters that are not in the model with 0, and use the model parameter vector as the eigenvalue of the corresponding time series;
[0030] Step 406: For the feature value set of the time series in the data set D, a clustering method such as K-means, K-medoids, hierarchical clustering, etc. is used to select the cluster number value range [k min ,k max ], calculate the clustering results, remove the duplicates to form a cluster set C = {Cluster1, Cluster2, ...}, and select the best clustering result Cluster = {C1, C2, ..., C k}.
[0031] Preferably, in step 402, AR modeling analysis is performed on the residual square sequence of the model within the maximum lag max_log, and two modeling parameters q are selected according to the AIC and BIC criteria. AIC ,q BIC :When the model is AR i (p AIC ), the corresponding model ARCH i (p AIC ,q AIC ) and ARCH i (p AIC ,q BIC ); When the model is AR i (p BIC ), the corresponding model ARCH i (p BIC ,q AIC ) and ARCH i (p BIC ,q BIC ).
[0032] Preferably, the time series data clustering method exits when a termination instruction is received, otherwise the time series data clustering method runs in the background and is re-executed when dynamic parameter adjustment or time series data set update is monitored, outputting clustering results that respond to changes in real time.
[0033] The present invention considers giving full play to the theoretical basis of time series modeling, using the advantages of time series modeling in describing and predicting the characteristics of time series data, solving the relevant technical problems of applying the time series modeling method to dimensionality reduction in time series data clustering, and improving the accuracy and efficiency of time series data clustering. The technical solution of the present invention can be directly applied to fields that require clustering of time series data, such as financial and economic analysis, biomedicine and health monitoring, environmental science and climate change, information and signal processing, etc.
[0034] In view of the problem that the same time series data may be composed of multiple segments of time series data with different characteristics, the present invention solves the technical problems of window-based methods and dynamic window adjustment, ensuring that the data in the window is timely and not segmented. In view of the problem that the time series data clustering method has low integration and lacks framework design, the present invention solves the technical problem of integrated framework design of time series data clustering method, and at the same time solves the technical problem of real-time monitoring and cluster analysis of time series data.
[0035] Compared with the prior art, the technical solution disclosed in the present invention has the following beneficial effects:
[0036] The method of the present invention has better generalization ability and more efficient clustering execution. Usually, time series models such as AR, MA, ARMA, ARCH, GARCH, etc. are effective means for predicting time series data. Time series modeling can extract features for predicting new data based on current time series data. These features have better generalization ability and can improve the robustness of clustering results. At the same time, the number of time series model parameters is usually several or dozens, which can effectively reduce the dimension of the original data and improve the efficiency of clustering using these feature vectors.
[0037] The present invention can ensure the timeliness and consistency of the analyzed time series data. Conventional time series data clustering methods analyze the entire data, manually selected data fragments, or data in a fixed time window, and it is difficult to respond in a timely manner to the variation and migration of time series data caused by external factors. The window set in the present application can continuously move forward and align with the update of new data, ensuring that the data in the window is timely. At the same time, the method designed to detect new data and adjust the window ensures that the data in the window is consistent.
[0038] The present invention designs a highly integrated framework of time series data clustering related technologies, in which various intermediate components can be flexibly replaced and replaced, supporting rapid migration and verification of related new methods.
[0039] The clustering results obtained by the method disclosed in the present invention have better timeliness and faster response. The conventional time series data clustering method only performs a one-time analysis on the data when needed. The present invention is designed to monitor the new data of the time series and the parameters of the dynamic adjustment in real time, and calculate and store the new clustering results in time. Through real-time response, prior calculation and storage, the clustering results can be updated in time, and the response speed of viewing the clustering results or extracting the clustering results can be accelerated. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 The basic process of mainstream methods for clustering time series data is illustrated;
[0041] Figure 2 A window of length 3 is illustrated;
[0042] Figure 3 The following is a basic flow chart of the method disclosed in the present invention. DETAILED DESCRIPTION
[0043] The present invention will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall within the scope limited by the appended claims of the application equally.
[0044] Compared with the traditional time series clustering method, the window-based time series data clustering method using modeling and dimensionality reduction disclosed in the present invention has three main features: 1) It uses window settings, such as Figure 2 For example, cluster analysis is performed on the most recent time series data block, and it can respond to dynamic parameter adjustments and time series data set updates in real time, solve the problem of time series data mutations caused by external factors, and realize time series clustering under the latest stage characteristics; 2) It does not directly cluster the original time series data, and is different from cluster analysis after dimensionality reduction of time series data through general methods (such as PCA dimensionality reduction). It uses the method of mathematical modeling of time series data to reduce the dimension, and uses the model parameter vector obtained by modeling as the eigenvalue for cluster analysis, which has better generalization, feature capture, and dimensionality reduction compression capabilities; 3) It has the characteristics of componentization, and can independently and flexibly update, add, delete, etc., including data preprocessing methods, test methods, time series modeling methods, model screening benchmarks, clustering methods, clustering evaluation indicators and other contents.
[0045] The basic method steps of the window-based time series data clustering method using modeling and dimensionality reduction disclosed in the present invention are as follows: Figure 3. First, initialize the configuration parameters and specify the time series data set object for cluster analysis. Then preprocess the time series data set, including window sliding, zero mean processing, calculation of multiple potential stationary time series deformations, etc. Then, the multiple potential time series data sets formed after the stationarity test preprocessing are screened out to meet the time series modeling conditions. Then, through the process of time series modeling, heteroscedastic time series modeling, and model screening, each time series in the time series data set is modeled to form a corresponding model parameter vector, and cluster analysis is performed with each model parameter vector as the eigenvalue. Finally, visualize the output results. Exit when a termination instruction is received, otherwise the method disclosed in the present invention will run in the background, and re-execute when dynamic parameter adjustments or time series data set updates are monitored, and output clustering results that respond to changes in real time. The time series clustering results can be used as input for other data mining and analysis methods.
[0046] The detailed description of the window-based time series data clustering method using modeling and dimension reduction disclosed in the present invention is shown in Table 1. The algorithm design can make full use of parallel computing to accelerate. In data preprocessing, when new data is added to each time series of the time series data set, the data preprocessing quickly updates Data, Data by using historical calculation results and new data. first 、Data first-log 、Data second 、Data second-log If necessary, the modeling of each time series data in the time series data set in the method disclosed in the present invention can also be used to support the data prediction of each time series.
[0047] Table 1. Window-based clustering method for time series data using modeling and dimensionality reduction
[0048]
[0049]
[0050] The above window-based time series data clustering method using modeling and dimension reduction can be applied to cluster analysis of stock data to guide investors in building investment portfolios. Using this method to cluster the Nikkei 225 Index, which is a 225 stock price index on the Tokyo Stock Exchange launched by the Nihon Keizai Shimbun, the results shown in the following table can be obtained.
[0051] Table 2 Example of Nikkei 225 Index clustering results
[0052]
[0053] The clustering results can be used as input to further construct an investment portfolio through manual judgment or genetic algorithms, so as to achieve the effect of diversifying risks and improving returns.
[0054] In the window-based time series data clustering method using modeling and dimensionality reduction disclosed in the embodiment of the present invention, the following techniques may also be used:
[0055] Dynamic window adjustment: Real-time monitoring of the newly added data in each time series of the time series data set, and dynamically adjust the window size accordingly. Through the time series outlier detection method based on statistics, machine learning, deep learning, etc., it is determined whether the newly added data is an outlier. When outliers occur continuously, the continuous outliers constitute a time series data block whose state has migrated due to changes in external factors. The window size is adjusted to realign the time series data block under the characteristics of the new stage. This component can replace the setting of fixed window size and be implemented in the dynamic parameter adjustment module.
[0056] Time series modeling: It can replace or expand more time series modeling methods, such as moving average (MA) modeling, auto-regressive and moving average (ARMA) modeling, etc. This component replaces or expands the implementation in the time series modeling module. t ,y t-1 ,…,y t-k ,…Modeling,The summary description of each time series model is as follows:
[0057] AR(p) model: y t =φ0+φ1y tc1 +φ2y t-2 +…+φ p y t-p +∈ t ,φ i is the modeling parameter. MA(q) model: y t =θ0+∈ t +θ1∈ t-1 +θ2∈ t-2 +…+θ q ∈ t-q ,θ i are modeling parameters. ARMA(p,q): y t =φ1y t-1 +φ2y t-2 +…+φ p y t-p +θ0+∈ t +θ1∈ t-1 +θ2∈ t-2 +…+θ q ∈ t-q
[0058] φ i and θ i is a modeling parameter.
[0059] Heteroskedasticity time series modeling: Heteroskedasticity time series modeling is to further model the squared residual series using the idea of autoregressive modeling or autoregressive moving average modeling. 6.1 in Table 1 can replace or extend the general autoregressive conditional heteroskedasticity (GARCH) modeling and other heteroskedasticity time series modeling methods. This component replaces or extends the implementation in the heteroskedasticity time series modeling module.
[0060] Model screening strategy: In 8 of Table 1, the model selected by the BIC criterion is preferred within the tolerable error range. The BIC criterion has stronger constraints on model parameters, and the model selected by it has better generalization ability to prevent overfitting. The model screening strategy in Table 1 can be replaced, such as only selecting the model with the smallest RMSE as the model of the corresponding time series. The error index can replace or expand the mean square error, mean absolute error, relative root mean square error, root mean square logarithmic error, mean absolute percentage error, etc. This component replaces or expands the implementation in the model screening module.
[0061] Clustering methods: K-means, K-medoids, and hierarchical clustering mentioned in 10 of Table 1 can be replaced or extended by other clustering methods. This component replacement or extension is implemented in the clustering module.
[0062] Clustering evaluation strategy: According to the clustering method and data volume, clustering evaluation indicators such as silhouette coefficient, CH (Calinski Harabasz) score, Davies Bouldin Index (DBI) or their combination can be selected to form a clustering evaluation strategy. This component is implemented in the clustering module.
Claims
1. A window-based time series data clustering method using modeling and dimensionality reduction, characterized in that: The following steps are involved: Step 1: Initialize configuration parameters and specify the time series dataset object for cluster analysis; Step 2: Preprocess the time series data set, including the following steps: Slide the window to each time series D in the time series dataset Data i the end of For each time series D in the time series data set Data i The data in the terminal window of is processed with zero mean; For each time series D in the time series data set Data i The data in the terminal window of , calculate the first-order difference time series data set Data first ={D first1 ,D first2 ,…,D firstn }, logarithmic first-order difference time series data set Data first-log ={D first-log1 ,D first-log2 ,…,D first-logn }, second-order difference time series data set Data second ={D second1 ,D second2 ,…,D secondn }, logarithmic second-order difference time series data set Data second-log ={D second-log1 ,D second-log2 ,…,D second-logn ; Step 3: After stationarity test preprocessing, multiple potential time series data sets are formed, and the object data set D that meets the time series modeling conditions is screened out; Step 4: Model each time series in the object data set D through the process of time series modeling, heteroscedastic time series modeling, and model screening to form a corresponding model parameter vector, and perform cluster analysis with each model parameter vector as a eigenvalue; Step 5: Visualize the output results.
2. A window-based time series data clustering method using modeling and dimensionality reduction as claimed in claim 1, characterized in that: In step 3, the time series data set Data and the first-order difference time series data set Data first , logarithmic first-order difference time series data set Data first-log , second-order difference time series data set Data second , Logarithmic second-order difference time series data set Data second-log Perform ADF stationarity test on each time series in, according to the time series data set Data, the first-order difference time series data set Data first , logarithmic first-order difference time series data set Data first-log , second-order difference time series data set Data second , Logarithmic second-order difference time series data set Data second-log The first data set that satisfies the ADF test H0 hypothesis condition that each time series in the data set denies is selected from the front to the back as the object data set D for modeling cluster analysis.
3. A window-based time series data clustering method using modeling and dimensionality reduction as claimed in claim 1, characterized in that: The step 4 comprises: Step 401: Perform AR modeling analysis on the first rW part of each time series in the data set D within the maximum lag max_lag, and select two modeling parameters p according to the AIC and BIC criteria. AIC , p BIC , corresponding to the model AR i (p AIC ) and AR i (p BIC ); Step 402: For each time series in the data set D, the model AR i (p AIC ) and AR i (p BIC ) is tested for the residual square sequence. If the original hypothesis is rejected, ARCH modeling is performed on the model; otherwise, the original model is retained. Step 403: Perform Ljung-Box white noise test on the residual sequences of at most four models of each time series in the data set D, and discard the models that fail the Ljung-Box white noise test; Step 404: For each time series in the data set D, use at most four models to predict the next (1-r)W parts of data, and calculate the root mean square error: If AR i (p BIC ) / ARCH i (p BIC ,q BIC ) and the minimum root mean square error are within the tolerance error_t, then select AR i (p BIC ) / ARCH i (p BIC ,q BIC ) as the model of the corresponding time series; otherwise, there is a corresponding ARCH i (p BIC ,q AIC ) model, and the absolute value of the difference between its RMS error and the minimum RMS error is within the tolerance error_t, then select ARCH i (p BIC ,q AIC ) as the model of the corresponding time series; otherwise, the model with the smallest root mean square error is selected as the model of the corresponding time series; Step 405: align the length of the model parameter vector of each time series in the data set D, that is, fill the parameters that are not in the model with 0, and use the model parameter vector as the eigenvalue of the corresponding time series; Step 406: For the feature value set of the time series in the data set D, a clustering method such as K-means, K-medoids, hierarchical clustering, etc. is used to select the cluster number value range [k min ,k max ], calculate the clustering results, remove the duplicates to form a cluster set C = {Cluster1, Cluster2, ...}, and select the best clustering result Cluster = {C1, C2, ..., C k }.
4. A window-based time series data clustering method using modeling and dimensionality reduction as claimed in claim 3, characterized in that: In step 402, AR modeling analysis is performed on the residual square sequence of the model within the maximum lag max_lag, and two modeling parameters q are selected according to the AIC and BIC criteria. AIC ,q BIC :When the model is AR i (p AIC ), the corresponding model ARCH i (p AIC ,q AIC ) and ARCH i (p AIC ,q BIC ); When the model is AR i (p BIC ), the corresponding model ARCH i (p BIC ,q AIC ) and ARCH i (p BIC ,q BIC ).
5. The window-based time series data clustering method using modeling and dimensionality reduction as claimed in claim 1, characterized in that: The time series data clustering method exits when a termination instruction is received; otherwise, the time series data clustering method runs in the background and is re-executed when dynamic parameter adjustment or time series data set update is detected, and a clustering result that responds to the changes in real time is output.