Repository navigation
Commit 1a08f32
authored
[ENH] Add
This PR adds the new Add `TimeSeries` datatype and update datamodule
with the new design.
See #2407, #2398
- `TimeSeries` is now a standarised datatype. Updated the tests and
renamed the file to `test_timeseries_v2` as this is no more a D1 layer!
- Also, we now have `metadata` as a dataclass, instead of the `dict` to
make it more user friendly.
Updated tests also updates some old ones (and removes some tests like
`init` checks - which are not needed i think?)
This PR is aimed at `v2-dev` instead of `main`, so that we dont break
current user code until this design is complete and stable. See #2407
for details. So I had to update the branch target in the workflows for
the tests to run (which might fail due to the changes)
## Stack
- `TimeSeries` - #2410 **<- This PR**
- `Datamodule` - #2423
- `Forecaster` - #2434
## Note
The tutorials will fail for sure, will update the notebook in one of the
branchs stacked over this PR.
Still need to add the `Forecaster` and tests - will add the notebook and
docs changes on the upcoming branches as the vignette is incomplete
without `forecaster` which is not in this PR.
## Changes made
- Changed the test file of `TimeSeries` from `test_d1` tro
`test_timeseries_v2`
- updates to `TimeSeries`
- Now uses `TimeSeriesMetadata` as metadata inplace of a `dict`
- Not a `Dataset` anymore
- Added some auto-detection of cols
- `target` is the last column of `data`.
- `time` is the first column not already used as `group`, `target`,
`static` or `weight`. If no such column exists, `ValueError` is raised -
pass `time` explicitly.
- `num` and `cat` are the dtype split over all columns that are not
`group`, `time` or `weight`
- data validation
- `to_pandas` to create a df
- `from_tensors` to create a `TimeSeries` class for predicitons
- which lack a lot of metadata, so need special handling otherwise will
interfere with the input data validationTimeSeries datatype as per new API (#2410)1 parent 67c354f commit 1a08f32
8 files changed
Lines changed: 477 additions & 50 deletions
File tree
- .github/workflows
- pytorch_forecasting
- data
- timeseries
- utils
- tests/test_data
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| 71 | + | |
69 | 72 | | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
0 commit comments