Live data from Hacker News

Ask HN: Data Scientists, what libraries do you use for timeseries forecasting?

news.ycombinator.com

61–70 of 91 posts

Re: Ask HN: Data Scientists, what libraries do you use for timeseries forecasting?

#61
post #27

Earlier quoted context omitted.

A Software Engineer. I'm just specialised a bit in DevOps, Data Engineering, and (beware buzzword) MLOps

What's MLops? Is it what I imagine? Maintaining repos of training/data, APIfying the pipeline, deploying an ML processing pipeline with CI/CD, etc?

Pretty much this. "ML engineering" has come to refer to the somewhat specialized task of implementing models and algorithms, and "ML ops" has come to refer to all of the other stuff that you just mentioned.

Re: Ask HN: Data Scientists, what libraries do you use for timeseries forecasting?

#62
post #48
post #39

Stuff I've used: - Prophet - seems to be the current 'standard' choice - ARIMA - Classical choice - Exponential Moving Average - dead simple to implement, works well for stuff that's a time series but not very seasonal - Kalman/Statespace model - used by Splunk's predict[1] command (pretty sure I always used LLP5) I did some anomaly detection work, in business transactions, and found the best way was to create a sort…

> - 2-3 anomalies in a row > - high deviation from expected > - multiple models all detected anomaly This is basically what statistical process control charts do for you. If you haven't learned about it already, I can recommend looking it up!

Statistical process control always seemed like some thing that would benefit me in my work, but I don't know anything about it. I have looked up random Wikipedia articles, but that's all I know. Do you know of any more "serious" learning resources in that area?

Re: Ask HN: Data Scientists, what libraries do you use for timeseries forecasting?

#63
post #20

Easiest is to use cvxpy with your own objective function. You can easily add seasonality regularization etc. other things are too much black box. Also pivot tables. They are free now in online version of google sheets and online excel. Set the time as a row field and it will automatically aggregate. Or if you want irregular spacing you can group by 100 samples.

I don't know why you were being downvoted for this, it's certainly a bit idiosyncratic but there's also nothing wrong with it.

Edit: I do question why you think this is "easiest". Do you have some really unusual/specific modeling needs?

Re: Ask HN: Data Scientists, what libraries do you use for timeseries forecasting?

#64
post #36

Former Reuters Research Director here. When modeling time series, you will want a model that is sensitive both to short term and longer term movements. In other words, a Long Term Short Term Memory (LSTM). Sepp Hochreiter invented this concept in his Master's thesis supervised by Jürgen Schmidhuber in Munich in the 1990s; today, it's the most-cited type of neural network. Here are papers describing it: https://people…

LSTMs have been going the way of the dinosaurs since 2018. If you really need a complex neural network (over 1D convolution approaches), transformers are the current SOTA. Example implementation in "temporal fusion": https://pytorch-forecasting.readthedocs.io/en/stable/tutoria... Mind you, in practice I've found these DL approaches overkill for simple problems of the "trends + cyclics + noise" kind.

My impression is that these kinds of models need a lot of data to train properly. I made a comment elsewhere in this thread, musing that tree ensemble models could do the same job, as a kind of low resolution quantized approximation. If you have experience in this area of research, I'd love to hear your thoughts on that.

Re: Ask HN: Data Scientists, what libraries do you use for timeseries forecasting?

#65

Lots of people have already made good library recommendations, so I will make a non-recommendation for all the data science students out there: stop thinking about libraries, and start thinking about models. "What library do I use?" is the wrong question. "What model do I use?" is the right question. Libraries are just part of the process of answering that question. That said, high quality implementations of interest…

I wouldn't mind a magic box, honestly.

Re: Ask HN: Data Scientists, what libraries do you use for timeseries forecasting?

#67
post #27

Earlier quoted context omitted.

A Software Engineer. I'm just specialised a bit in DevOps, Data Engineering, and (beware buzzword) MLOps

What's MLops? Is it what I imagine? Maintaining repos of training/data, APIfying the pipeline, deploying an ML processing pipeline with CI/CD, etc?

You got it. It's unbelievably difficult to get model devs out of the mindset of training on their own VM, saving model outputs and metrics dumps to arcanely named file shares, etc. Once you can convince them that using stuff like workflow pipelining tools and centralized model repo servers isn't going to impede their creative process and that it prevents the mad scramble to find artifacts when there's turnover on the team, things become much more efficient.

Re: Ask HN: Data Scientists, what libraries do you use for timeseries forecasting?

#68
As a few other people have mentioned, I find R to be the easiest tool for this job, specifically the forecast package [0]. I had to use this package for an applied econometrics course in college a few years ago, and I have been using it ever since. I find the syntax to be more straightforward than comparable libraries in Python. I also assume that this library (and other libraries in R) offer higher quality models and results than their counterparts in Python, but this is just an assumption.

[0] https://github.com/robjhyndman/forecast

Re: Ask HN: Data Scientists, what libraries do you use for timeseries forecasting?

#69
I once built a forecasting framework for a unicorn startup. Revenue and Pipeline predictability was the key as the company was going through the IPO phase. There were three approaches I took and 'ensemble'd them to predict the revenue and pipeline.

1. Time series based forecast based on revenue (the one OP is referring to). All the statistical time-series models come here. I primarily used H2O.ai for this.

2. Conversion based revenue forecast (input -> pipeline, output -> revenue). This proved to be quite tricky as there was a time lag between pipeline creation and revenue conversion

3. Delphi-method: Got the sales/pre-sales folks on-ground to predict a bottom-up number and used that as a forecast.

Finally, I combined them by applying weightages to the above approaches - based on how accurate they were on the test dataset.

IMHO, Like many of them have pointed out - the model/assumptions are more important than the library. The job of a data scientist is to make the prediction as reliable and explainable as possible.

Post reply on HN