Project done by:
Name | |
---|---|
Diego Sanz-Gadea Sánchez | [email protected] |
Time Series Analysis using STUMPY LIBRARY patterns detection through subsequences of a sequence. Computing the Euclidian Distances.
S.M. Law, (2019). STUMPY: A Powerful and Scalable Python Library for Time Series Data Mining. Journal of Open Source Software, 4(39), 1504.
Starting from a Time Series DataFrame df
Instanciating the class SimilarPattern
patterns=SimilarPattern(df,24)
nav.get_plot(continious=True)
- If the DataFrame inserted has several columns a stacked proccess computes the
2D array into 1D
, pivoting the columns registers to only one column, increasing registers number. Otherwise the sequence is a simply one, so the pattern is not taking into account other variables. Just one, the given. - The second argument indicates the period of the subsequence to be compute. For 2D (several column DataFrame). Hidely the subsequence distancees computes as
24*nº columns
Once created the SimilarPattern object, the methods arises. Firstly with .get_similar_patter(date)
patterns.get_similar_pattern('2023-01-26')
['2023-01-18']
model.fit( X_train, y_train, X_prev)
The most similar date subsequence is shown. Sometimes some dates cant compute similarities. It depends on the data.
pattern.plot_similar_pattern('2023-01-26')
Motifs
are stored as an attribute when some method using date is computed previously
pattern.seek_motif
Also the overall matrix profile could be compute as:
pattern.get_matrix_profile()
S.M. Law, (2019). STUMPY: A Powerful and Scalable Python Library for Time Series Data Mining. Journal of Open Source Software, 4(39), 1504.