Open Harry-N opened 4 years ago
Hey @Harry-N,
the copy_aggregate()
method does not aggregate over the time-axis, but over the target axis for multi-dimensional targets in multi-variate forecasting. That is probably not what you are after. I assume you have a uni-variate target and want to aggregate over the time axis.
I think there is no function for that in GluonTS currently, but you could do it like this:
for target, forecast in islice(zip(tss, forecasts), num_plots):
target=target[-past_length:].resample("1D").sum()
ax = target.plot(figsize=(12, 5), linewidth=2)
samples = []
for sample in forecast.samples:
samples.append(pd.Series(sample, index=f.index).resample("1D").sum().values)
forecast.samples = np.array(samples)
forecast.plot(color='g')
plt.show()
Hello everyone, I am new to GluonTS.
I saw in the documentation that an object "gluonts.model.forecast" has a function (copy_aggregate(agg_fun:Callable)) which aggregates and returns a new Forecast object with a time series aggregated over the dimension axis.
I tried to implement this code :
Did I something wrong?
In advance, thank you !