Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ but cannot always guarantee backwards compatibility. Changes that may **break co

**Fixed**

- Fixed `examples/14-transfer-learning.ipynb` raising a NaN error on the `air` dataset: the `load_air()` helper now calls `fill_missing_values(..., fill="auto")` after `longest_contiguous_slice()` to handle residual gaps in the raw `carrier_passengers.csv`. Closes [#2752](https://github.com/unit8co/darts/issues/2752).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future reference, refer to the PR number and link here :) also if you want take credit (by ...)

Suggested change
- Fixed `examples/14-transfer-learning.ipynb` raising a NaN error on the `air` dataset: the `load_air()` helper now calls `fill_missing_values(..., fill="auto")` after `longest_contiguous_slice()` to handle residual gaps in the raw `carrier_passengers.csv`. Closes [#2752](https://github.com/unit8co/darts/issues/2752).
- Fixed `examples/14-transfer-learning.ipynb` raising a NaN error on the `air` dataset by calling `fill_missing_values(..., fill="auto")` to handle residual gaps in the raw `carrier_passengers.csv`. Closes [#3116](https://github.com/unit8co/darts/pull/3116).


**Dependencies**

### For developers of the library:
Expand Down
8 changes: 7 additions & 1 deletion examples/14-transfer-learning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@
" RandomForestModel,\n",
" Theta,\n",
")\n",
"from darts.utils.losses import SmapeLoss"
"from darts.utils.losses import SmapeLoss\n",
"from darts.utils.missing_values import fill_missing_values"
]
},
{
Expand Down Expand Up @@ -244,6 +245,11 @@
" series = series.longest_contiguous_slice()\n",
" except Exception:\n",
" continue\n",
" # Fill any residual missing values inside the chosen slice. The raw\n",
" # carrier_passengers.csv occasionally has gaps that survive the\n",
" # longest_contiguous_slice() call (e.g. zero-rows), which produce NaNs\n",
" # downstream and break model training. See issue #2752.\n",
" series = fill_missing_values(series, fill=\"auto\")\n",
Comment on lines +251 to +252
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bit too verbose compared to the rest of the notebook
should be fine with just

Suggested change
" # downstream and break model training. See issue #2752.\n",
" series = fill_missing_values(series, fill=\"auto\")\n",
" # fill missing values\n",
" series = fill_missing_values(series, fill=\"auto\")\n",

" # remove static covariates\n",
" series = series.with_static_covariates(None)\n",
" # remove short series\n",
Expand Down