Abstract—To analyze multivariate time series, most previous methods assume regular subsampling of time series, where the interval between adjacent measurements and the number of samples remain unchanged. Practically, data collection systems could produce irregularly sampled time series due to sensor failures and interventions. However, existing methods designed for regularly sampled multivariate time series cannot directly handle irregularity owing to misalignment along both temporal and variate dimensions. To fill this gap, we propose Compatible Transformer (CoFormer), a transformer-based encoder to achieve comprehensive temporal-interaction feature learning for each individual sample in irregular multivariate time series. In CoFormer, we view each sample as a unique variatetime point and leverage intra-variate/inter-variate attentions to learn sample-wise temporal/interaction features based on intravariate/inter-variate neighbors. With CoFormer as the core, we can analyze irregularly sampled multivariate time series for many downstream tasks, including classification and prediction. We conduct extensive experiments on 3 real-world datasets and validate that the proposed CoFormer significantly and consistently outperforms existing methods.
Python >= 3.9, and ensure your python, cuda, torch and dgl are compatible versions.
You can use the codes under /preprocess folder to preprocess the data. Initial raw data and split index can be downloaded from Raindrop. You should prepare the PTdict_list.npy or PTdict_list6.npy for preprocess, and the processed data is saved at a specified path, which is also the data root of the dataset. You can also download from preprocessed to get the preprocessed data and split index.
Run train_medical.py can both train and test CoFormer. --split parameter specifies the train/test split index, --data_root parameter specifies the data root, where the .npy files are saved, --dataset parameter specifies the dataset type, including p19, p12 and pam.
If you find CoFormer is useful for your research, please consider citing this paper:
@article{wei2023compatible,
title={Compatible Transformer for Irregularly Sampled Multivariate Time Series},
author={Wei, Yuxi and Peng, Juntong and He, Tong and Xu, Chenxin and Zhang, Jian and Pan, Shirui and Chen, Siheng},
journal={arXiv preprint arXiv:2310.11022},
year={2023}
}