Skip to content

Commit

Permalink
Fix bug in to_quantile_forecast (#2225)
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneteoh authored and lostella committed Aug 26, 2022
1 parent 48231da commit 259481f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/gluonts/model/forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,14 @@ def __repr__(self):
]
)

def to_quantile_forecast(
self, quantiles: List[Union[float, str]]
) -> "QuantileForecast":
def to_quantile_forecast(self, quantiles: List[str]) -> "QuantileForecast":
return QuantileForecast(
forecast_arrays=np.array([self.quantile(q) for q in quantiles]),
forecast_arrays=np.array(
[
self.quantile(q) if q != "mean" else self.mean()
for q in quantiles
]
),
start_date=self.start_date,
forecast_keys=quantiles,
item_id=self.item_id,
Expand Down

0 comments on commit 259481f

Please sign in to comment.