Jerry
Jerry

Reputation: 175

Python Time Series forecasting (sales volumes)

I'm trying to make daily cash flow (inflow - outflow) prediction for the half year for a chain of stores. I have daily cash inflow and cash outflow for past 3 years, inflation rates, dates of national holidays and number of stores. Already processed data with pandas dataframe.

What Python tools (libraries, algorithms) will suit best for the forecast?

Upvotes: 1

Views: 992

Answers (3)

rrobby86
rrobby86

Reputation: 1474

The common basic tools I would definitely suggest to import, represent and make basic (or not-so-basic) transformation and analysis are:

  • pandas providing "smart" data structures allowing to easily import data and perform many transformations
  • Jupyter to easily create notebooks integrating narrative text, code and results
  • matplotlib for easy plotting of data (there is also a plot API in pandas which is based on it)

Specifically about time series forecasting I don't know much: you should be able to implement basic algorithms using pandas, otherwise example of useful libraries I found with a quick googling are StatsModels and Prophet

Upvotes: 0

wind
wind

Reputation: 1020

You can look at TSFresh, that is a popular python library for extraction of features from time-series. Then you need to experiment with algorithms and the most popular python library for that is Scikit-learn.

Upvotes: 0

Tarek
Tarek

Reputation: 725

I would recomand to follow those steps:

  • Find a correlation between dates and number of sales or any other variables (but i think date will do the trick people buy more stuff on holidays and weekends usually ) you can use the numpy library for that here

  • assuming that the sales follows seasonal trends or weekends picks sales, you should compute those features based on dates you can add columns to your data frame such as dayofweek , season .. , pandas is great for that dt.dayofweek its as simple as that, split your data to train set and test set.

  • Now cool stuff, you can try Linear regression using the sklearn here i think it will work great! you can try other algorithm as well such as Ridge regression... alot of examples can be found on the sklearn web site http://scikit-learn.org
  • Evaluate your model !

Upvotes: 1

Related Questions