Skip to content

Commit

Permalink
Fix STL inverse transform bug (#4328)
Browse files Browse the repository at this point in the history
* Switch old_seasonal to old_seasonality in inverse_transform

* release notes
  • Loading branch information
eccabay authored Oct 4, 2023
1 parent 02df25e commit 6b291b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/source/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Release Notes
* Extended TimeSeriesRegularizer to support multiseries :pr:`4303`
* Fixes
* Fixed forecast period generation function for multiseries :pr:`4320`
* Fixed bug in ``STLDecomposer.inverse_transform`` causing incorrect seasonality projections :pr:`4328`
* Changes
* Updated ``split_data`` to call ``split_multiseries_data`` when passed stacked multiseries data :pr:`4312`
* Pinned pandas version under 2.1.0 :pr:`4315`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,12 @@ def inverse_transform(
if len(y_t.columns) > 1:
old_trend = self.trends[id]
old_seasonal = self.seasonals[id]
old_seasonality = self.seasonalities[id]
period = self.periods[id]
else:
old_trend = list(self.trends.values())[0]
old_seasonal = list(self.seasonals.values())[0]
old_seasonality = list(self.seasonalities.values())[0]
period = list(self.periods.values())[0]
# For partially and wholly in-sample data, retrieve stored results.
if index[0] <= series_y.index[0] <= index[-1]:
Expand Down Expand Up @@ -423,7 +425,7 @@ def inverse_transform(
) = self._project_trend_and_seasonality(
truncated_y_t,
old_trend,
old_seasonal,
old_seasonality,
period,
)

Expand Down

0 comments on commit 6b291b6

Please sign in to comment.