Improvement of shapelet extraction for Time2Graph
Ziyuan Chen, Zhirong Chen | July 2022
Summer Research @ Yang Yang Lab, Zhejiang University
This work is protected under the MIT License.
Copyright (c) 2022 Ziyuan Chen & Zhirong Chen unless otherwise noted.
Autoencoded
Quantification
Of
Unsupervised
Representative
Shapelets
$ python mainczr.py
- WARNING: the condensed
ts2vec
module has not been thoroughly tested. Clone yuezhihan/ts2vec under the same folder in case it fails.
- Data preparation
- Time series ---extract---> Shapelets
- Time series & shapelets ---embed---> Series embedding
- Series embedding ---construct---> Graph
- Graph ---embed---> Graph embedding
- Graph embedding ---predict---> Predicted classes
ref_papers
- papers associated with shapelets providing essential background knowledgetraditional
- evolution path since 2009: Logical, ST, Unsupervised, FS, LS, Random, Forest, Random forest, etc.neural_network
- DNNs enter the game! Dynamic, Adversarial, Adv. Dynamic, ShapeNet, BSPCover, etc. (Review)
cached_programs
- historical versions and experiments of KMeans, SVM, MLP, ResNet, Time2Vec, hierarchies, etc.- WARNING: Codes in the cache may not run properly since they are not optimized for environment compatibility.
affiliated_licenses
- LICENSEs for code segments from yuezhihan, subhadarship, DynamicTimeWarping, and pyg-team@GitHub.ucr_dataset
- a neatly formatted version of the UCR Dataset in.npz
format- The numpy arrays contained in each file have keys
train_data
,train_label
,test_data
,test_label
*_data
has shape(num_samples, num_features)
,*_label
has shape(num_samples,)
- The numpy arrays contained in each file have keys
mainczr.py
utils.py
(#0:ucr_dataset
, #3 wrapper:GraphDataset
)construct_graph.py
(#1 wrapper:extract_shapelets
, #2:embed_series
, #3:adjacency_matrix
)ts2vec.py
(#1 optional enhancement:TS2Vec
)kmeans.py
(#1:kmeans
)dtw
network.py
(#4:GAT
, #5:MultilayerPerceptron
&FCResidualNetwork
)xgboost
- Original Time2Graph model by Cheng et al., 2020 & Cheng et al., 2021, code inspired by petecheng@GitHub
- Time2Vec algorithm (essence of AQOURS) by Kazemi et al., 2019, code adapted from yuezhihan@GitHub
- Copyright (c) 2022 Zhihan Yue
- KMeans acceleration on PyTorch by subhadarship@GitHub, with adaptations
- Copyright (c) 2020 subhadarshi
- DTW algorithm implemented by DynamicTimeWarping@GitHub
- Copyright (c) 2019 Toni Giorgino
- GAT structure by Veličković et al., 2017, code inspired by Stanford CS224w, pyg-team@GitHub, DGraphXinye@GitHub
- Copyright (c) 2021 Matthias Fey, Jiaxuan You (pyg-team)
- MLP & ResNet (prediction tail) structures inspired by Wang et al., 2017
- Data from the UCR Time Series Classification Archive, as documented in Dau et al., 2018
- Python modules:
torch
,torch_geometric
,kmeans
,dtw
,xgboost
,sklearn