facebook / facebook/prophet

Prophet's fit() method cannot handle dates prior to 1728-01-01

Open
#1,867 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
20.4k
Forks
4.6k
Avg merge
19h 52m
Merged PRs (30d)
1

Description

I have a dataset that goes back to 1700 up to the future. The fit() method will raise an exception because pandas cannot handle subtracting the current date from a date < 1728-01-01

OutOfBoundsDatetime: Result is too large for pandas.Timedelta. Convert inputs to datetime.datetime with 'Timestamp.to_pydatetime()' before subtracting.

Prophet method "setup_data()" will automatically convert your "ds" column to panda datetime - regardless of what value you pass in as your "ds" column.

I tried to start doing a conversion, just to see how far I could get to using python's datetime.datetime - instead of pandas time.

The exact line where the exception is thrown is:

self.t_scale = df['ds'].max() - self.start

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.