unit8co / darts

A python library for user-friendly forecasting and anomaly detection on time series.
https://unit8co.github.io/darts/
Apache License 2.0
7.61k stars 830 forks source link

future_covariate support to NBEATS & NHits models #2043

Open hberande opened 8 months ago

hberande commented 8 months ago

Hi, presently I'm getting the good accuracy for my data using "NBEATS & N-Hits" Models from Darts library. But I am also want to use "future_covariates" to above models. Is there any possibility to do so in the current version or in future??

madtoinou commented 8 months ago

Hi @hberande,

As explained in the table summarizing the models available in darts here, NBEATS and NHiTs do not support future covariates at the moment.

I don't think that modifying these models architectures to support such covariates is a priority at the moment, it might come in future releases if someone takes the time to implement it.

hberande commented 8 months ago

Hi @madtoinou, Thanks for the prompt response. Is it possible to implement this at my level?

madtoinou commented 8 months ago

It should be, but you might diverge from the initial architecture and there is no guarantee of performance gain. Be careful about data leakage.

1943 links to a paper presenting NBEATSx, an improved version of NBEATS with future covariates supports. It would probably be a good start. Otherwise, you could check how it's done for DLinearModel and NLinearModel model.

ivelin commented 6 months ago

It looks like NHITS now supports future covariates. From the nixtla implementation:

https://github.com/Nixtla/neuralforecast/blob/main/nbs/models.nhits.ipynb

#| export
class NHITS(BaseWindows):
    """ NHITS

    The Neural Hierarchical Interpolation for Time Series (NHITS), is an MLP-based deep
    neural architecture with backward and forward residual links. NHITS tackles volatility and
    memory complexity challenges, by locally specializing its sequential predictions into
    the signals frequencies with hierarchical interpolation and pooling.

    **Parameters:**
    `h`: int, Forecast horizon. 
    `input_size`: int, autorregresive inputs size, y=[1,2,3,4] input_size=2 -> y_[t-2:t]=[1,2].
    `stat_exog_list`: str list, static exogenous columns.
    `hist_exog_list`: str list, historic exogenous columns.
    `futr_exog_list`: str list, future exogenous columns.
    ...