facebook / facebook/prophet

Model fit behaves very differently between `datetime64[ns]` and `datetime64[ms]`.

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

Description

I was unknowingly passing a dtype of `datetime64[ms]` to prophet and getting a _very_ poor fit. Converted back to `datetime64[ns]` and model fit behaved as expected. It might be worth adding a check to warn other users.

My approach to convert was: `df['ds'] = pd.to_datetime(df['ds'].dt.strftime('%Y-%m-%d'))`

NB: A possible cause of getting the `[ms]` type is converting from a polars frame.

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.