awslabs / gluonts

Probabilistic time series modeling in Python
https://ts.gluon.ai
Apache License 2.0
4.62k stars 753 forks source link

Add forward-fields support to shell for batch-transform #806

Closed jaheba closed 3 years ago

jaheba commented 4 years ago

When doing batch transform, one might want to store additional fields such as item_id alongside the prediction to be able to simply match input and output values.

Currently, we just ignore all additional values.

jaheba commented 4 years ago

This might be obsolete, since batch transform might be able to do it itself:

https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DataProcessing.html

gmcaixeta commented 4 years ago

If I have this json dataset format:

{"item_id": 1000, "store_id": 20, "start": "2011-01-29", "feat_static_cat": [0, 0, 0, 0], "feat_dynamic_real": [[30, 30, 30, 30, 30, 30 ..], [4, 4, 4, 4, 4, 4, 4, ...], [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4....], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2...], [0, 0, 0, 1, 1, 1...], [2.240234375, 2.240234375, 2.240234375, 2.240234375 ...]], "target": [5, 5, 1, 1, 0, 3, 3, 4, 9, 4, 7, 1, 2, 4, 14 ...]}

Is there someway to access store_id on forecast inference result ?

[gluonts.model.forecast.SampleForecast(freq="D", info=None, item_id="1000", samples=numpy.array()