Skip to content

Commit cd7ccea

Browse files
authored
Improve time series filtering based on cutoff, horizon and min_context_length (#18)
1 parent cba7198 commit cd7ccea

File tree

7 files changed

+263
-103
lines changed

7 files changed

+263
-103
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,12 @@ Get an evaluation summary
5555
task.evaluation_summary(predictions, model_name="naive")
5656
# {'model_name': 'naive',
5757
# 'dataset_name': 'chronos_datasets_monash_kdd_cup_2018',
58-
# 'dataset_fingerprint': '8a50d3417859652b',
5958
# 'dataset_path': 'autogluon/chronos_datasets',
6059
# 'dataset_config': 'monash_kdd_cup_2018',
6160
# 'horizon': 12,
6261
# 'cutoff': -12,
6362
# 'lead_time': 1,
64-
# 'min_ts_length': 13,
63+
# 'min_context_length': 1,
6564
# 'max_context_length': None,
6665
# 'seasonality': 1,
6766
# 'eval_metric': 'MASE',
@@ -70,15 +69,16 @@ task.evaluation_summary(predictions, model_name="naive")
7069
# 'id_column': 'id',
7170
# 'timestamp_column': 'timestamp',
7271
# 'target_column': 'target',
73-
# 'multiple_target_columns': None,
72+
# 'generate_univariate_targets_from': None,
7473
# 'past_dynamic_columns': [],
7574
# 'excluded_columns': [],
76-
# 'test_error': 3.3784518,
75+
# 'test_error': 3.3784518866750513,
7776
# 'training_time_s': None,
7877
# 'inference_time_s': None,
78+
# 'dataset_fingerprint': 'a22d13d4c1e8641c',
7979
# 'trained_on_this_dataset': False,
80-
# 'fev_version': '0.3.0',
81-
# 'MASE': 3.3784518}
80+
# 'fev_version': '0.5.0',
81+
# 'MASE': 3.3784518866750513}
8282
```
8383
The evaluation summary contains all information necessary to uniquely identify the forecasting task.
8484

docs/01-quickstart.ipynb

Lines changed: 73 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,54 @@
3838
{
3939
"data": {
4040
"application/vnd.jupyter.widget-view+json": {
41-
"model_id": "351a9be21f444cfc90440176e41763d5",
41+
"model_id": "da69c728429643ca867244061497eeca",
4242
"version_major": 2,
4343
"version_minor": 0
4444
},
4545
"text/plain": [
46-
"Validating dataset format (num_proc=10): 0%| | 0/270 [00:00<?, ? examples/s]"
46+
"Validating dataset format (num_proc=48): 0%| | 0/270 [00:00<?, ? examples/s]"
47+
]
48+
},
49+
"metadata": {},
50+
"output_type": "display_data"
51+
},
52+
{
53+
"data": {
54+
"application/vnd.jupyter.widget-view+json": {
55+
"model_id": "b285297ae35c45ceac7c55115bded869",
56+
"version_major": 2,
57+
"version_minor": 0
58+
},
59+
"text/plain": [
60+
"Filtering short time series (num_proc=48): 0%| | 0/270 [00:00<?, ? examples/s]"
61+
]
62+
},
63+
"metadata": {},
64+
"output_type": "display_data"
65+
},
66+
{
67+
"data": {
68+
"application/vnd.jupyter.widget-view+json": {
69+
"model_id": "5d148bdd05444470a6e8387d74f0e5ef",
70+
"version_major": 2,
71+
"version_minor": 0
72+
},
73+
"text/plain": [
74+
"Selecting past data (num_proc=48): 0%| | 0/270 [00:00<?, ? examples/s]"
75+
]
76+
},
77+
"metadata": {},
78+
"output_type": "display_data"
79+
},
80+
{
81+
"data": {
82+
"application/vnd.jupyter.widget-view+json": {
83+
"model_id": "cad0f53a10854ebba967c941804e2616",
84+
"version_major": 2,
85+
"version_minor": 0
86+
},
87+
"text/plain": [
88+
"Selecting future data (num_proc=48): 0%| | 0/270 [00:00<?, ? examples/s]"
4789
]
4890
},
4991
"metadata": {},
@@ -87,15 +129,15 @@
87129
{
88130
"data": {
89131
"text/plain": [
90-
"{'id': np.str_('T000000'),\n",
132+
"{'id': 'T000000',\n",
91133
" 'timestamp': array(['2017-01-01T14:00:00.000', '2017-01-01T15:00:00.000',\n",
92134
" '2017-01-01T16:00:00.000', ..., '2018-03-31T01:00:00.000',\n",
93135
" '2018-03-31T02:00:00.000', '2018-03-31T03:00:00.000'],\n",
94136
" dtype='datetime64[ms]'),\n",
95137
" 'target': array([453., 417., 395., ..., 99., 102., 97.], dtype=float32),\n",
96-
" 'city': np.str_('Beijing'),\n",
97-
" 'station': np.str_('aotizhongxin_aq'),\n",
98-
" 'measurement': np.str_('PM2.5')}"
138+
" 'city': 'Beijing',\n",
139+
" 'station': 'aotizhongxin_aq',\n",
140+
" 'measurement': 'PM2.5'}"
99141
]
100142
},
101143
"execution_count": 5,
@@ -139,17 +181,17 @@
139181
{
140182
"data": {
141183
"text/plain": [
142-
"{'id': np.str_('T000000'),\n",
184+
"{'id': 'T000000',\n",
143185
" 'timestamp': array(['2018-03-31T04:00:00.000', '2018-03-31T05:00:00.000',\n",
144186
" '2018-03-31T06:00:00.000', '2018-03-31T07:00:00.000',\n",
145187
" '2018-03-31T08:00:00.000', '2018-03-31T09:00:00.000',\n",
146188
" '2018-03-31T10:00:00.000', '2018-03-31T11:00:00.000',\n",
147189
" '2018-03-31T12:00:00.000', '2018-03-31T13:00:00.000',\n",
148190
" '2018-03-31T14:00:00.000', '2018-03-31T15:00:00.000'],\n",
149191
" dtype='datetime64[ms]'),\n",
150-
" 'city': np.str_('Beijing'),\n",
151-
" 'station': np.str_('aotizhongxin_aq'),\n",
152-
" 'measurement': np.str_('PM2.5')}"
192+
" 'city': 'Beijing',\n",
193+
" 'station': 'aotizhongxin_aq',\n",
194+
" 'measurement': 'PM2.5'}"
153195
]
154196
},
155197
"execution_count": 7,
@@ -189,7 +231,7 @@
189231
{
190232
"data": {
191233
"application/vnd.jupyter.widget-view+json": {
192-
"model_id": "3034f4b2cdc3471eac2bc3caeab28d75",
234+
"model_id": "5a5df4eb7fd94875a6b9fb0cf4f757c8",
193235
"version_major": 2,
194236
"version_minor": 0
195237
},
@@ -200,6 +242,20 @@
200242
"metadata": {},
201243
"output_type": "display_data"
202244
},
245+
{
246+
"data": {
247+
"application/vnd.jupyter.widget-view+json": {
248+
"model_id": "fc07c39251fb416a8de6b007b43490fa",
249+
"version_major": 2,
250+
"version_minor": 0
251+
},
252+
"text/plain": [
253+
"Map (num_proc=48): 0%| | 0/270 [00:00<?, ? examples/s]"
254+
]
255+
},
256+
"metadata": {},
257+
"output_type": "display_data"
258+
},
203259
{
204260
"data": {
205261
"text/plain": [
@@ -210,7 +266,7 @@
210266
" 'horizon': 12,\n",
211267
" 'cutoff': -12,\n",
212268
" 'lead_time': 1,\n",
213-
" 'min_ts_length': 13,\n",
269+
" 'min_context_length': 1,\n",
214270
" 'max_context_length': None,\n",
215271
" 'seasonality': 1,\n",
216272
" 'eval_metric': 'MASE',\n",
@@ -219,15 +275,15 @@
219275
" 'id_column': 'id',\n",
220276
" 'timestamp_column': 'timestamp',\n",
221277
" 'target_column': 'target',\n",
222-
" 'multiple_target_columns': None,\n",
278+
" 'generate_univariate_targets_from': None,\n",
223279
" 'past_dynamic_columns': [],\n",
224280
" 'excluded_columns': [],\n",
225281
" 'test_error': 3.3784518866750513,\n",
226282
" 'training_time_s': None,\n",
227283
" 'inference_time_s': None,\n",
228-
" 'dataset_fingerprint': 'e91f446bd0b05d16',\n",
284+
" 'dataset_fingerprint': 'a22d13d4c1e8641c',\n",
229285
" 'trained_on_this_dataset': False,\n",
230-
" 'fev_version': '0.2.1',\n",
286+
" 'fev_version': '0.5.0',\n",
231287
" 'MASE': 3.3784518866750513}"
232288
]
233289
},
@@ -250,7 +306,7 @@
250306
},
251307
{
252308
"cell_type": "code",
253-
"execution_count": null,
309+
"execution_count": 10,
254310
"metadata": {},
255311
"outputs": [
256312
{
@@ -634,7 +690,7 @@
634690
"name": "python",
635691
"nbconvert_exporter": "python",
636692
"pygments_lexer": "ipython3",
637-
"version": "3.11.10"
693+
"version": "3.11.11"
638694
}
639695
},
640696
"nbformat": 4,

0 commit comments

Comments
 (0)