Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-hse-repository committed Mar 31, 2023
1 parent 91ab764 commit 271809b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions etna/pipeline/autoregressive_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _forecast(self, ts: TSDataset, return_components: bool) -> TSDataset:
current_ts_future = self.model.forecast(ts=current_ts_forecast, return_components=return_components)
current_ts_future.inverse_transform(self.transforms)

if len(current_ts_future.target_components_names) > 0:
if return_components:
target_components_dfs.append(current_ts_future.get_target_components())
current_ts_future.drop_target_components()

Expand All @@ -159,7 +159,7 @@ def _forecast(self, ts: TSDataset, return_components: bool) -> TSDataset:
prediction_ts.df = prediction_ts.df.tail(self.horizon)
prediction_ts.raw_df = prediction_ts.raw_df.tail(self.horizon)

if len(target_components_dfs) > 0:
if return_components:
target_components_df = pd.concat(target_components_dfs)
prediction_ts.add_target_components(target_components_df=target_components_df)

Expand Down

0 comments on commit 271809b

Please sign in to comment.