Datasets:

Formats:
arrow
ArXiv:
Libraries:
Datasets
License:
ZDandsomSP commited on
Commit
97b9177
1 Parent(s): b15cdbf

update readme

Browse files
Files changed (3) hide show
  1. README.md +126 -0
  2. dataset_evaluation.py +79 -0
  3. source.csv +30 -0
README.md CHANGED
@@ -1,3 +1,129 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ configs:
4
+ - config_name: default
5
+ data_files:
6
+ - split: train
7
+ path: "*/*.arrow"
8
+ - config_name: "UTSD-1G"
9
+ data_files:
10
+ - split: train
11
+ path: "UTSD-1G/*.arrow"
12
+ - config_name: "UTSD-2G"
13
+ data_files:
14
+ - split: train
15
+ path: "UTSD-2G/*.arrow"
16
+ - config_name: "UTSD-4G"
17
+ data_files:
18
+ - split: train
19
+ path: "UTSD-4G/*.arrow"
20
+ - config_name: "UTSD-12G"
21
+ data_files:
22
+ - split: train
23
+ path: "UTSD-12G/*.arrow"
24
  ---
25
+
26
+ # Unified Time Series Dataset (UTSD)
27
+
28
+ ## Introduction
29
+
30
+ We curate **Unified Time Series Dataset (UTSD)** that includes **7 domains** with up to **1 billion time points** with hierarchical capacities to facilitate research of scalability and domain transfer.
31
+
32
+ <p align="center">
33
+ <img src="./figures/utsd.png" alt="" align=center />
34
+ </p>
35
+ **Unified Time Series Dataset (UTSD)** is meticulously assembled from a blend of publicly accessible online data repositories and empirical data derived from real-world machine operations.
36
+
37
+ All datasets are classified into seven distinct domains by their source: **Energy, Environment, Health, Internet of Things (IoT), Nature, Transportation, and Web** with diverse sampling frequencies.
38
+
39
+ See the [paper](https://arxiv.org/abs/2402.02368) and [codebase](https://github.com/thuml/Large-Time-Series-Model) for more information.
40
+
41
+ ## Dataset detailed descriptions.
42
+
43
+ We analyze each dataset within our collection, examining the time series through the lenses of stationarity and forecastability to allows us to characterize the level of complexity inherent to each dataset.
44
+
45
+ | Domain | Dataset | Time Points | File Size | Freq. | ADF. | Forecast. | Source |
46
+ |--------------|----------------------------------|-------------|-----------|-------|---------|-----------|-------------------------------------------|
47
+ | Energy | London Smart Meters | 166.50M | 4120M | Hourly| -13.158 | 0.173 | [1] |
48
+ | Energy | Wind Farms | 7.40M | 179M | 4 sec | -29.174 | 0.811 | [1] |
49
+ | Energy | Aus. Electricity Demand | 1.16M | 35M | 30 min| -27.554 | 0.730 | [1] |
50
+ | Environment | AustraliaRainfall | 11.54M | 54M | Hourly| -150.10 | 0.458 | [2] |
51
+ | Environment | BeijingPM25Quality | 3.66M | 26M | Hourly| -31.415 | 0.404 | [2] |
52
+ | Environment | BenzeneConcentration | 16.34M | 206M | Hourly| -65.187 | 0.526 | [2] |
53
+ | Health | MotorImagery | 72.58M | 514M | 0.001 sec| -3.132 | 0.449 | [3] |
54
+ | Health | SelfRegulationSCP1 | 3.02M | 18M | 0.004 sec| -3.191 | 0.504 | [3] |
55
+ | Health | SelfRegulationSCP2 | 3.06M | 18M | 0.004 sec| -2.715 | 0.481 | [3] |
56
+ | Health | AtrialFibrillation | 0.04M | 1M | 0.008 sec| -7.061 | 0.167 | [3] |
57
+ | Health | PigArtPressure | 0.62M | 7M | - | -7.649 | 0.739 | [3] |
58
+ | Health | PigCVP | 0.62M | 7M | - | -4.855 | 0.577 | [3] |
59
+ | Health | IEEEPPG | 15.48M | 136M | 0.008 sec| -7.725 | 0.380 | [2] |
60
+ | Health | BIDMC32HR | 63.59M | 651M | - | -14.135 | 0.523 | [2] |
61
+ | Health | TDBrain | 72.30M | 1333M | 0.002 sec| -3.167 | 0.967 | [5] |
62
+ | IoT | SensorData | 165.4M | 2067M | 0.02 sec| -15.892 | 0.917 | Real-world machine logs |
63
+ | Nature | Phoneme | 2.16M | 25M | - | -8.506 | 0.243 | [3] |
64
+ | Nature | EigenWorms | 27.95M | 252M | - | -12.201 | 0.393 | [3] |
65
+ | Nature | ERA5 Surface | 58.44M | 574M | 3 h | -28.263 | 0.493 | [4] |
66
+ | Nature | ERA5 Pressure | 116.88M | 1083M | 3h | -22.001 | 0.853 | [4] |
67
+ | Nature | Temperature Rain | 23.25M | 109M | Daily | -10.952 | 0.133 | [1] |
68
+ | Nature | StarLightCurves | 9.46M | 109M | - | -1.891 | 0.555 | [3] |
69
+ | Nature | Saugen River Flow | 0.02M | 1M | Daily | -19.305 | 0.300 | [1] |
70
+ | Nature | KDD Cup 2018 | 2.94M | 67M | Hourly | -10.107 | 0.362 | [1] |
71
+ | Nature | US Births | 0.00M | 1M | Daily | -3.352 | 0.675 | [1] |
72
+ | Nature | Sunspot | 0.07M | 2M | Daily | -7.866 | 0.287 | [1] |
73
+ | Nature | Worms | 0.23M | 4M | 0.033 sec| -3.851 | 0.395 | [3] |
74
+ | Transport | Pedestrian Counts | 3.13M | 72M | Hourly | -23.462 | 0.297 | [1] |
75
+ | Web | Web Traffic | 116.49M | 388M | Daily | -8.272 | 0.299 | [1] |
76
+
77
+ You can find the specific source address in `source.csv`.
78
+
79
+ [1]: [Monash Time Series Forecasting Archive](https://arxiv.org/abs/2105.06643)
80
+ [2]: [Time series extrinsic regression Predicting numeric values from time series data](https://link.springer.com/article/10.1007/s10618-021-00745-9)
81
+ [3]: [The UCR Time Series Archive](https://arxiv.org/abs/1810.07758)
82
+ [4]: [ERA5-Land: a state-of-the-art global reanalysis dataset for land applications](https://essd.copernicus.org/articles/13/4349/2021/)
83
+ [5]: [Contrast Everything: A Hierarchical Contrastive Framework for Medical Time-Series](https://arxiv.org/abs/2310.14017)
84
+
85
+
86
+ ## Hierarchy of Datasets
87
+
88
+ UTSD is constructed with hierarchical capacities, namely **UTSD-1G, UTSD-2G, UTSD-4G, and UTSD-12G**, where each smaller dataset is a subset of the larger ones. A larger subset means greater data **difficulty** and **diversity**, allowing you to conduct detailed scaling experiments.
89
+
90
+ <p align="center">
91
+ <img src="./figures/utsd_complexity.png" alt="" align=center />
92
+ </p>
93
+ ## Usage
94
+
95
+ You can load UTSD according to the following code:
96
+
97
+ ```python
98
+ import datasets
99
+
100
+ # Load UTSD dataset
101
+ UTSD_12G = datasets.load_from_disk('UTSD-12G')
102
+ print(UTSD_12G)
103
+ for item in UTSD_12G:
104
+ print(item.keys(), 'len of target:', len(item['target']))
105
+ ```
106
+
107
+ It should be noted that due to the construction of our dataset with diverse lengths, the sequence lengths of different samples vary. You can construct the data organization logic according to your own needs.
108
+
109
+ In addition, we provide code `dataset_evaluation.py` for evaluating time series datasets, which you can use to evaluate your Huggingface formatted dataset. The usage of this script is as follows:
110
+
111
+ ```bash
112
+ python dataset_evaluation.py --root_path <dataset root path> --log_path <output log path>
113
+ ```
114
+
115
+ ## Citation
116
+
117
+
118
+ If you're using UTSD in your research or applications, please cite it using this BibTeX:
119
+
120
+ **BibTeX:**
121
+
122
+ ```markdown
123
+ @article{liu2024timer,
124
+ title={Timer: Transformers for Time Series Analysis at Scale},
125
+ author={Liu, Yong and Zhang, Haoran and Li, Chenyu and Huang, Xiangdong and Wang, Jianmin and Long, Mingsheng},
126
+ journal={arXiv preprint arXiv:2402.02368},
127
+ year={2024}
128
+ }
129
+ ```
dataset_evaluation.py ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from arch.unitroot import ADF
2
+ from scipy.stats import entropy
3
+ import numpy as np
4
+ import torch
5
+ import argparse
6
+ from datasets import load_from_disk
7
+
8
+ def adf_evaluator(x):
9
+ return ADF(x).stat
10
+
11
+
12
+ def forecastability_evaluator(x, seq_len=256):
13
+ x = torch.tensor(x).squeeze() # L
14
+ forecastability_list = []
15
+ for i in range(max(x.shape[0]-seq_len, 0) // seq_len + 1):
16
+ start_idx = i * seq_len
17
+ end_idx = min(start_idx + seq_len, x.shape[0])
18
+ window = x[start_idx:end_idx]
19
+ amps = torch.abs(torch.fft.rfft(window))
20
+ amp = torch.sum(amps)
21
+ forecastability = 1 - entropy(amps/amp, base=len(amps))
22
+ forecastability_list.append(forecastability)
23
+ np_forecastability_list = np.array(forecastability_list)
24
+ # replace nan with 1
25
+ np_forecastability_list[np.isnan(np_forecastability_list)] = 1
26
+ return np.mean(np_forecastability_list)
27
+
28
+
29
+ def save_log(path, content):
30
+ with open(path, 'a') as f:
31
+ f.write(content)
32
+
33
+
34
+ if __name__ == '__main__':
35
+ parser = argparse.ArgumentParser(description='Dataset Evaluation')
36
+ parser.add_argument('--root_path', type=str, required=True, help='Root path of the dataset, e.g. ./data/bdg-2_bear')
37
+ parser.add_argument('--log_path', type=str, required=False, default='log.txt', help='Path to save the log file')
38
+ args = parser.parse_args()
39
+ print("Evaluate dataset at ", args.root_path)
40
+
41
+ dataset = load_from_disk(args.root_path)
42
+ print(dataset)
43
+ series_list = dataset['target']
44
+
45
+ if not isinstance(series_list[0][0], list):
46
+ series_list = [series_list]
47
+
48
+ time_point_list = []
49
+ adf_stat_list = []
50
+ forecastability_list = []
51
+
52
+ for i in range(len(series_list)):
53
+ for j in range(len(series_list[i])):
54
+ try:
55
+ series = series_list[i][j]
56
+ # fill missing value with 0 for evaluation
57
+ series = [0 if np.isnan(x) else x for x in series]
58
+ adf_stat = adf_evaluator(series)
59
+ forecastability = forecastability_evaluator(series)
60
+ forecastability_list.append(forecastability)
61
+ adf_stat_list.append(adf_stat)
62
+ time_point_list.append(len(series))
63
+ except Exception as e:
64
+ save_log(args.log_path, f'Error: {args.root_path} {i} {j}\n'+str(e)+'\n')
65
+ continue
66
+
67
+ time_point_list = np.array(time_point_list)
68
+ adf_stat_list = np.array(adf_stat_list)
69
+ forecastability_list = np.array(forecastability_list)
70
+
71
+ time_points = np.sum(time_point_list)
72
+ weighted_adf = np.sum(adf_stat_list * time_point_list) / time_points
73
+ weighted_forecastability = np.sum(forecastability_list * time_point_list) / time_points
74
+
75
+ print("Weighted ADF:", weighted_adf)
76
+ print("Weighted Forecastability:", weighted_forecastability)
77
+ print("Total Time Points:", time_points)
78
+ print("Finish evaluation ", args.root_path)
79
+ save_log(args.log_path, f"root_path: {args.root_path}\n Weighted ADF: {weighted_adf}\n Weighted Forecastability: {weighted_forecastability}\n Total Time Points: {time_points}\n\n")
source.csv ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Domain,Dataset,Time Points,File Size,Freq,ADF,Forecast.,Source
2
+ Energy,London Smart Meters,166.50M,4120M,Hourly,-13.158,0.173,https://arxiv.org/abs/2105.06643
3
+ Energy,Wind Farms,7.40M,179M,4 sec,-29.174,0.811,https://arxiv.org/abs/2105.06643
4
+ Energy,Aus. Electricity Demand,1.16M,35M,30 min,-27.554,0.730,https://arxiv.org/abs/2105.06643
5
+ Environment,AustraliaRainfall,11.54M,54M,Hourly,-150.10,0.458,https://link.springer.com/article/10.1007/s10618-021-00745-9
6
+ Environment,BeijingPM25Quality,3.66M,26M,Hourly,-31.415,0.404,https://link.springer.com/article/10.1007/s10618-021-00745-9
7
+ Environment,BenzeneConcentration,16.34M,206M,Hourly,-65.187,0.526,https://link.springer.com/article/10.1007/s10618-021-00745-9
8
+ Health,MotorImagery,72.58M,514M,0.001 sec,-3.132,0.449,https://arxiv.org/abs/1810.07758
9
+ Health,SelfRegulationSCP1,3.02M,18M,0.004 sec,-3.191,0.504,https://arxiv.org/abs/1810.07758
10
+ Health,SelfRegulationSCP2,3.06M,18M,0.004 sec,-2.715,0.481,https://arxiv.org/abs/1810.07758
11
+ Health,AtrialFibrillation,0.04M,1M,0.008 sec,-7.061,0.167,https://arxiv.org/abs/1810.07758
12
+ Health,PigArtPressure,0.62M,7M,-,-7.649,0.739,https://arxiv.org/abs/1810.07758
13
+ Health,PigCVP,0.62M,7M,-,-4.855,0.577,https://arxiv.org/abs/1810.07758
14
+ Health,IEEEPPG,15.48M,136M,0.008 sec,-7.725,0.380,https://link.springer.com/article/10.1007/s10618-021-00745-9
15
+ Health,BIDMC32HR,63.59M,651M,-,-14.135,0.523,https://link.springer.com/article/10.1007/s10618-021-00745-9
16
+ Health,TDBrain,72.30M,1333M,0.002 sec,-3.167,0.967,https://arxiv.org/abs/2310.14017
17
+ IoT,SensorData,165.4M,2067M,0.02 sec,-15.892,0.917,Real-world machine logs
18
+ Nature,Phoneme,2.16M,25M,-,-8.506,0.243,https://arxiv.org/abs/1810.07758
19
+ Nature,EigenWorms,27.95M,252M,-,-12.201,0.393,https://arxiv.org/abs/1810.07758
20
+ Nature,ERA5 Surface,58.44M,574M,3 h,-28.263,0.493,https://essd.copernicus.org/articles/13/4349/2021/
21
+ Nature,ERA5 Pressure,116.88M,1083M,3h,-22.001,0.853,https://essd.copernicus.org/articles/13/4349/2021/
22
+ Nature,Temperature Rain,23.25M,109M,Daily,-10.952,0.133,https://arxiv.org/abs/2105.06643
23
+ Nature,StarLightCurves,9.46M,109M,-,-1.891,0.555,https://arxiv.org/abs/1810.07758
24
+ Nature,Saugen River Flow,0.02M,1M,Daily,-19.305,0.300,https://arxiv.org/abs/2105.06643
25
+ Nature,KDD Cup 2018,2.94M,67M,Hourly,-10.107,0.362,https://arxiv.org/abs/2105.06643
26
+ Nature,US Births,0.00M,1M,Daily,-3.352,0.675,https://arxiv.org/abs/2105.06643
27
+ Nature,Sunspot,0.07M,2M,Daily,-7.866,0.287,https://arxiv.org/abs/2105.06643
28
+ Nature,Worms,0.23M,4M,0.033 sec,-3.851,0.395,https://arxiv.org/abs/1810.07758
29
+ Transport,Pedestrian Counts,3.13M,72M,Hourly,-23.462,0.297,https://arxiv.org/abs/2105.06643
30
+ Web,Web Traffic,116.49M,388M,Daily,-8.272,0.299,https://arxiv.org/abs/2105.06643