Forecast time series with Prophet and Streamlit

prophet

Hi everyone! :wave:

I have built an app to generate forecasts using the Prophet library:

Here is the app: https://share.streamlit.io/giandata/forecast-app/forecastapp.py

I have included the possibility to download a sample dataset, give it a try and let me know what you think or suggest me how to improve it! Let me know as well if you think I should add any other feature of Prophet which you would like me to include!

It is possible to tweak almost all the parameters or settings of the model:

  • select the horizon, then change seasonality and the growth model
  • specify what components to look for and add holidays (just for a few countries for now).

Not only that, after the forecast is generated you can cross-validate using k-fold and then automatically optimize the hyperparameters! (beware it will take a a little while)
Last but not least it is possible to export the predictions, the evaluation and the model configuration to csv/json for reproducibility :star_struck:.

I was initially inspired from the @zachrenwick with his first app with Streamlit and Prophet, and I started building on that idea!

I hope you enjoy it and find useful !

Cheers!

10 Likes

Great work!

Iā€™m finding this error when trying to export the results:

TypeError: spinner() got an unexpected keyword argument 'key'

1 Like

Looks brilliant! :clap:

However and FYI, it seems to have crashed.

@amey-st Possibly a memory issue?

Thanks,
Charly

2 Likes

Thank you for letting know, I have no idea what those keys were doing in the spinners :wink: I have fixed it now, let me know

Hi @Charly_Wargnier thank you for letting me know about it.

I now wonder if there is a way to receive alerts when an app crash. It may be an idea for future releases?

It was indeed a memory problem. I have now added a caching.clear_cache()

at the very beginning of the application tab, so at any refresh it should run.
Also, I added a button in the sidebar to give the possibility of clearing cache to the users.

I hope this will be enough to avoid the same problem in the future.

cache

Cheers!

2 Likes

Looks fab.
I hope it fixes the issue!

1 Like