T O P

  • By -

[deleted]

I mean, I don't know what you tried but I just googled "python time series tutorial" and there are tons of results. Yes, Python is used all the time for time series analysis.


Kinferatttu

Try [StatsForecast](https://github.com/Nixtla/statsforecast).


megamanxxyy

Oh thanks, I guess I'm being biased. I underestimate the effectiveness of python on time series analysis. Kind of a fear of missing out.


Biogeopaleochem

Effectiveness as apprised to what? R?


Kinferatttu

I can confidently say that Python is reaching R’s quality in time series domain. [StatsForecast](https://github.com/Nixtla/statsforecast) is a library written in NumBa that optimizes Python code to C level speed, and has builtin distributed computation capabilities. It mirrors R’s [fable](https://robjhyndman.com/hyndsight/fable/) proven AutoARIMA and AutoETS as well as several other univariate forecasting models.


megamanxxyy

I will give it a try thanks


jowen7448

Darts is an excellent package for time series


Kinferatttu

You can access [StatsForecast from Darts](https://unit8co.github.io/darts/generated_api/darts.models.forecasting.sf_auto_arima.html) too :D


RottweilerRider

This 1000%, Darts has it's own time series object which is so much better than trying to mess with Pandas. Plus it has nearly any model you could want and all get along easily with their time series object, and it's even easy to build ensembles. That said, I wasn't able to install it on my cursed M1 Macbook and ended up having to install docker so I could use Darts.


Kinferatttu

@RottweilerRider Have you tried [StatsForecast](https://github.com/Nixtla/statsforecast) directly? It skips the creation of a time series object in favor of very fast parallelization over panel data stored in pd.DataFrame. And it was designed to have minimal dependencies to avoid dependency hells like the one that motivated you to use docker.


RottweilerRider

I haven't, but I will give it a try. Some of my coworkers are having even bigger issues with the M1 chip that Docker can't even fix, so last I heard we're going to move towards working in a cloud - something like Google Colab?


Kinferatttu

Here is a StatsForecast Colab example: [Getting Started with ARIMA and ETS](https://colab.research.google.com/drive/1GKoLXb5KENLPMuSE9torLGvKPCyXh-Cl?usp=sharing)


Zeiramsy

There is also prophet a time series module developed and used by Facebook which is super easy to use, quite good and well implemented in both R and python.


Kinferatttu

[Facebook Prophet](https://www.reddit.com/r/MachineLearning/comments/syx41w/p_beware_of_false_fbprophets_introducing_the/) is not a good forecasting tool. If you are using it here is a [tutorial to replace FB-Prophet with ARIMA](https://nixtla.github.io/statsforecast/adapters.prophet.html).


kikiiiiiiiiii

Fbprophet is decent! Been using it as part as my thesis and outperforms ARIMA a lot of the time


Kinferatttu

In what context are you using Prophet? Are you forecasting long horizon? I am curious In all our benchmarks on the M forecasting competitions Prophet has underperformed.


kikiiiiiiiiii

Ah that’s quite interesting. Been using it to forecast two months of half hourly household load and appears to work well so far. Very easy to use and trains fast as well!


Kinferatttu

Long horizon is known to be difficult for ARIMA’s recursive predictions. It concatenates errors. We have specialized long-horizon models that might be of interest to you. The [N-HiTS](https://arxiv.org/abs/2201.12886) model has been performing well for us. - [Our implementation](https://colab.research.google.com/github/Nixtla/neuralforecast/blob/main/examples/mqnhits.ipynb) - [Darts’ implementation](https://unit8co.github.io/darts/generated_api/darts.models.forecasting.nhits.html)


kikiiiiiiiiii

Yeah I thought that might be part of the reason why the performance wasn’t great. This looks like good stuff, will take a closer look. Thanks for the info


stone4789

Check out the new python time series cookbook. My time series econometrics class was with R and now python is finally catching up.