Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lostella committed Dec 5, 2023
1 parent da9dc3a commit 0ad33c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gluonts/ext/rotbaum/_preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,12 @@ def make_features(self, time_series: Dict, starting_index: int) -> List:
end_index = starting_index + self.context_window_size
if starting_index < 0:
prefix = [None] * abs(starting_index)
time_series_window = time_series["target"]
else:
prefix = []
time_series_window = time_series["target"][
starting_index:end_index
]
time_series_window = time_series["target"][starting_index:end_index]
only_lag_features, transform_dict = self._pre_transform(
time_series_window, self.subtract_mean, self.count_nans
Expand All @@ -480,10 +484,10 @@ def make_features(self, time_series: Dict, starting_index: int) -> List:
list(
chain(
*[
list(ent[0]) + list(ent[1].values())
prefix + list(ent[0]) + list(ent[1].values())
for ent in [
self._pre_transform(
ts[starting_index:end_index],
ts if prefix else ts[starting_index:end_index],
self.subtract_mean,
self.count_nans,
)
Expand Down

0 comments on commit 0ad33c2

Please sign in to comment.