wangdx25 commited on
Commit
012b018
·
verified ·
1 Parent(s): 003b841

Add TsFile (converted from ChengsenWang/CGTSF)

Browse files
Files changed (5) hide show
  1. .gitattributes +3 -0
  2. README.md +110 -0
  3. cgtsf_leu.tsfile +3 -0
  4. cgtsf_mspg.tsfile +3 -0
  5. cgtsf_ptf.tsfile +3 -0
.gitattributes CHANGED
@@ -58,3 +58,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
 
 
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
+ cgtsf_leu.tsfile filter=lfs diff=lfs merge=lfs -text
62
+ cgtsf_mspg.tsfile filter=lfs diff=lfs merge=lfs -text
63
+ cgtsf_ptf.tsfile filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ task_categories:
4
+ - time-series-forecasting
5
+ size_categories:
6
+ - 10K<n<100K
7
+ tags:
8
+ - tsfile
9
+ - timeseries
10
+ - modality:timeseries
11
+ - format:tsfile
12
+ - multimodal-time-series
13
+ - context-guided-time-series-forecasting
14
+ - energy
15
+ - traffic
16
+ modality: timeseries
17
+ pretty_name: CGTSF Context-Guided Time Series Forecasting (TsFile format)
18
+ configs:
19
+ - config_name: leu
20
+ data_files:
21
+ - split: train
22
+ path: "cgtsf_leu.tsfile"
23
+ - config_name: mspg
24
+ data_files:
25
+ - split: train
26
+ path: "cgtsf_mspg.tsfile"
27
+ - config_name: ptf
28
+ data_files:
29
+ - split: train
30
+ path: "cgtsf_ptf.tsfile"
31
+ ---
32
+
33
+ # CGTSF: Context-Guided Time Series Forecasting (TsFile format)
34
+
35
+ Apache TsFile version of [`ChengsenWang/CGTSF`](https://huggingface.co/datasets/ChengsenWang/CGTSF).
36
+
37
+ Modalities: Time-series.
38
+
39
+ ## Overview
40
+
41
+ CGTSF addresses context-guided time-series forecasting by aligning numerical
42
+ history and prediction windows with textual background, weather, and date
43
+ information. The source provides three logically distinct multimodal domains:
44
+ London electricity usage (LEU), Melbourne solar power generation (MSPG), and
45
+ Paris traffic flow (PTF). The source card reports the following frequencies and
46
+ series counts:
47
+
48
+ | Config | Rows | Series | Frequency | Array widths (Hist / Pred) |
49
+ |---|---:|---:|---|---:|
50
+ | LEU | 11,616 | 16 | 30 minutes | 240 / 48 |
51
+ | MSPG | 10,557 | 27 | 15 minutes | 480 / 96 |
52
+ | PTF | 11,520 | 32 | 1 hour | 120 / 24 |
53
+
54
+ The three source files remain separate because their serialized array widths
55
+ are incompatible. The source card describes PTF as a 2012 traffic dataset,
56
+ while the observed source dates at this pinned revision are in 2022; the
57
+ conversion follows the source date values without changing them.
58
+
59
+ ## Schema (TsFile structure)
60
+
61
+ Each config contains its own table with the same structural roles:
62
+
63
+ - **Time** (INT64, milliseconds) - the source target-day `Date` at UTC
64
+ midnight.
65
+ - **idx** (TAG, STRING) - `Idx`, identifying the source series/device.
66
+ - **hist_000 ... hist_N** (FIELD, DOUBLE) - the serialized `Hist` numeric
67
+ window expanded to scalar fields; `N` depends on the config.
68
+ - **pred_000 ... pred_N** (FIELD, DOUBLE) - the serialized `Pred` window
69
+ expanded to scalar fields; `N` depends on the config.
70
+ - **text** (FIELD, STRING) - the aligned textual context.
71
+
72
+ `Hist` and `Pred` are parsed with a safe literal/JSON parser and expanded
73
+ without changing their numeric values. The source `Date` is represented
74
+ losslessly by `Time`; no source row or semantic column is dropped.
75
+
76
+ ## Usage
77
+
78
+ Install the Apache TsFile Python SDK (`pip install tsfile`) and read a converted file:
79
+
80
+ ```python
81
+ from pathlib import Path
82
+ from tsfile import TsFileReader
83
+
84
+ path = Path("cgtsf_leu.tsfile")
85
+ with TsFileReader(str(path)) as reader:
86
+ schemas = reader.get_all_table_schemas()
87
+ print("tables:", list(schemas))
88
+ table_name = next(iter(schemas))
89
+ table = schemas[table_name]
90
+ columns = [column.get_column_name() for column in table.get_columns()]
91
+ print("columns:", columns)
92
+ field_names = [
93
+ column.get_column_name()
94
+ for column in table.get_columns()
95
+ if column.get_column_name() not in {"Time", "time"}
96
+ ]
97
+ if field_names:
98
+ with reader.query_table(table_name, field_names[:3], batch_size=1024) as result:
99
+ batch = result.read_arrow_batch()
100
+ if batch is not None:
101
+ print(batch.to_pandas().head())
102
+ ```
103
+
104
+ ## Source & license
105
+
106
+ - **Original dataset:** https://huggingface.co/datasets/ChengsenWang/CGTSF
107
+ - **Source revision:** `f85b3fa3a8b3f1a2adbc6edf49f82b7d9d1758c9`
108
+ - **Author / publisher:** Chengsen Wang, Qi Qi, Jingyu Wang, Haifeng Sun, Zirui Zhuang, Jinming Wu, Lei Zhang, Jianxin Liao.
109
+ - **Paper:** https://arxiv.org/abs/2412.11376
110
+ - **License:** Apache-2.0.
cgtsf_leu.tsfile ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5334a8a57b4c7d61f9df72d41faf34b8125167974fcc61c8ae2104b2b76e86b4
3
+ size 23926977
cgtsf_mspg.tsfile ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2f0bce53d847d2ed970c66abdbfe0cb558cdecaf18193a4224203cf4e1bd6b3d
3
+ size 10081780
cgtsf_ptf.tsfile ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e5e26c13190f750294f19b8cff01b9d2f2ef7ab86c2c11308b57661541286fd3
3
+ size 6392858