nixtla icon indicating copy to clipboard operation
nixtla copied to clipboard

[FIX] Same output type as input in timegpt forecast function

Open MMenchero opened this issue 1 year ago • 0 comments

When calling the API, the output of timegpt for the time column always uses the format "yyyy-mm-dd hh:mm:ss", even when the initial timestamps don't go to the hour-minute-second level.

When using the SDK, the timegpt.forecast function returns dates in the same format as the input. Hence, if the time column doesn't include the hour, minutes and seconds, then the output doesn't include them either.

Here's an example using the AirPassengers dataset

timestamp API timestamp SDK TimeGPT
1961-01-01 00:00:00 1961-01-01 437.83
1961-02-01 00:00:00 1961-02-01 426.06
1961-03-01 00:00:00 1961-03-01 463.11

This issue is relevant because it would be better to be consistent in the API and the SDK. I also think that including the hour, minutes, and seconds could be burdensome for users that don't need this level of precision.

MMenchero avatar Dec 04 '23 22:12 MMenchero