Hacker News new | past | comments | ask | show | jobs | submit | hrzn's comments login

A few years back I made a modest attempt at writing a concise yet readable sudoku solver in Python - in about 29 lines: https://github.com/hrzn/sudoku/blob/master/sudoku.py

Could have been made shorter at the price of readability.


Looks nice. Since imports numpy can utilize (more of) numpy's operations to squeeze validation functions and nested fors to one. Should result in shorter code but readability will probably depend on reader's experience in array programming.


We likely overestimate AI's short-term impact, and there might even be a financial bubble about to pop. But I also think we underestimate the long-term impact. We're building absolutely amazing capabilities faster than many would have thought possible only a few years ago - I especially think applications to science and engineering will be huge and transformative.


> Python had nothing comparable

This is in part why we built Darts. Now I think we can say the situation is quite different. Darts offers many things offered by the R forecast package, and then some (for instance the ability to train ML models on large datasets made of multiple potentially high-dimensional series).


I would recommend Darts in Python [1]. It's easy to use (think fit()/predict()) and includes

* Statistical models (ETS, (V)ARIMA(X), etc)

* ML models (sklearn models, LGBM, etc)

* Many recent deep learning models (N-BEATS, TFT, etc)

* Seamlessly works on multi-dimensional series

* Models can be trained on multiple series

* Several models support taking in external data (covariates), known either in the past only, or also in the future

* Many models offer rich support for probabilistic forecasts

* Model evaluation is easy: Darts has many metrics, offers backtest etc

* Deep learning scales to large datasets, using GPUs, TPUs, etc

* You can do reconciliation of forecasts at different hierarchical levels

* There's even now an explainability module for some of the models - showing you what matters for computing the forecasts

* (coming soon): an anomaly detection module :)

* (also, it even include FB Prophet if you really want to use it)

Warning: I'm probably biased because I'm Darts creator.

[1] https://github.com/unit8co/darts


Note that the actual EV of a Cauchy random variable is undefined...


You can install darts with conda using

    conda install u8darts-all
We are working on improving our support of conda based installs.


I would say that compared to Greykite, Darts really attempts to unify a wide variety of forecasting models under a common simple and user-friendly API. There are many differences, but for instance, AFAIK there's no deep learning model in Greykite (it focuses on two algorithms: their built-in algorithm and Prophet), whereas Darts tries to lower the barrier for using deep learning models for forecasting. Crucially for ML-based models, it also means being able to train on multiple (possibly thousands or more) of possibly multi-dimensional time series.


In some cases Darts is wrapping around existing models (like Prophet, or statsmodels-based models for instance); in other cases we wrote our own implementations, so it's really a mix.


I didn't realize that. Darts is a great library that we use all the time. Thanks for all the hard work!


You're welcome, glad you like it and thanks for the feedback :)


I was trying to use Darts earlier for some multivariate data and was struggling to figure out how to use it for it and eventually just gave up and switched to making my own code.

Is there a good "how to" multivariate data example? Or is it just turning every column in my pandas dataframe into a series to pass into the covariates array?

And rather than just bother you, is there a discord/forum to ask questions on darts?


> Or is it just turning every column in my pandas dataframe into a series to pass into the covariates array?

Basically if you have a multivariate series represented as a pandas dataframe with several columns, the way to go is to create your TimeSeries by calling TimeSeries.from_dataframe(my_df). That will return a multivariate time series.

We don't yet have a discord channel, but I'm planning to open a Slack channel sometime soon. If you have other questions feel free to drop me an email: julien@unit8.co


Hi! I'm one core developer (and creator) of the library. Thanks for all the comments. I just wanted to highlight a couple of things that we think are quite cool about Darts:

* It makes using all sorts of forecasting models (from ARIMA to deep learning) easy, using fit() and predict(), similar to scikit-learn.

* It's easy to fit deep learning and other ML-based models on multiple time series, potentially on big datasets too. The time series can be multivariate.

* Darts is not only wrapping existing models. We also have our own implementations, for instance of TCN (Temporal Convolutional Networks), or adaptations N-BEATS (which we extended to handle multivariate series), DeepAR and others.

* Darts makes it very easy to include past and/or future covariates as inputs for the predictions.

* Some models offer probabilistic forecasts; sometimes with the possibility to configure your favourite likelihood function (e.g. Gaussian for continuous values or Poisson for discrete values).

* Everything uses the "TimeSeries" class, which makes the API consistent across tools and models, and make it harder to make mistakes. For instance it's easy to consume the output of one model by another model, and all models can be backtested the same way.


I love to see more time series models becoming available in an easy-to-use format. There's always been such a gap between what is possible and what is convenient to use, much moreso than with other kinds of models.

This was also one of the areas where R always had better options than Python, but that seems to be gradually changing as well.

Darts looks very thorough and user-friendly, it makes me really want to work on a forecasting project!

It might be very helpful to readers/users if you could add a section to your documentation comparing Darts to Tslearn [0] (edit, and Sktime [1]), which already has a lot of time series models with the Scikit-learn style interface.

It would also be helpful to have some kind of writeup that explains the TimeSeries data structure and why you use that, instead of just a Series/DataFrame.

Finally - you really shouldn't say "non-Facebook alternative", because your Prophet implementation is literally a wrapper around Facebook's Prophet library. If anything, I suggest moving the Prophet, Torch, and Pmdarima dependencies to setuptools "extras", so you don't force the users to depend on those projects.

[0]: https://tslearn.readthedocs.io/en/stable/index.html

[1]: https://news.ycombinator.com/item?id=28155384


Thanks for the feedback, I absolutely agree about the need for easy-to-use tools for dealing with time series. This is exactly the motivation that prompted us to work on Darts initially.

I like your suggestions of adding comparison to the few other libraries out there, as well as explaining the need for having our own TimeSeries data structure. We should try to do that sometime soon.

Concerning dependencies, we already have some dependencies as extras. "pip install darts" will install everything, but "pip install u8darts" will install only the core (without Prophet and pmdarima), or "pip install u8darts[torch]" only the core+pytorch models.


Regarding deps, I just saw that you have two setup.py files, and one of them has the `extras` listed. Good stuff!


> I suggest moving the Prophet, Torch, and Pmdarima dependencies to setuptools "extras",

Yep, the dependence on Prophet prevented me to quickly try darts on a Windows machine because of the pystan issue with prophet:

https://github.com/facebook/prophet/issues/732

May try it later on Linux.


You can try installing it using

    pip install 'u8darts[torch]'
This will give you everything besides Prophet and pmdarima.


Will you add support for anomaly detection or classification (something like predictive maintenance)?


In short: yes, at least anomaly detection. That's one of the main things on our to-do list.


Do you have any plans to implement some sort of model averaging or stacking? I believe it would bring great benefits to this landscape to have a working implementation of hierarchical stacking across various backends wrapped in a Python library.


We do have ensemble models. Something like

    model = NaiveEnsembleModel([model1, model2, ...])
    model.fit(my_series)
    prediction = model.predict()
Will return an average prediction. Look at RegressionEnsembleModel for an ensemble model which uses a regression model to learn how to combine the individual forecasts.

At the moment Darts doesn't have hierarchical reconciliation methods (if that's what you meant), but it's on the backlog :)


FYI, Hacker News has code formatting if you indent by 4 spaces:

    model = NaiveEnsembleModel([model1, model2, ...])
    model.fit(my_series)
    prediction = model.predict()


Oh, nice, I didn't know that. I've edited my reply, thanks!


For training forecasting models on multiple time series (and potentially large datasets), you can take a look at Darts [1] and the blog post [2].

[1]: https://github.com/unit8co/darts/

[2]: https://medium.com/unit8-machine-learning-publication/traini...


Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: