darts icon indicating copy to clipboard operation
darts copied to clipboard

future_covariate support to NBEATS & NHits models

Open hberande opened this issue 1 year ago • 4 comments

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??

hberande avatar Oct 31 '23 09:10 hberande

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.

madtoinou avatar Oct 31 '23 09:10 madtoinou

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

hberande avatar Oct 31 '23 10:10 hberande

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.

madtoinou avatar Oct 31 '23 12:10 madtoinou

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.
    ...

ivelin avatar Dec 30 '23 15:12 ivelin