darts icon indicating copy to clipboard operation
darts copied to clipboard

How to implement TIDE Model with similar lags to LGBM

Open ETTAN93 opened this issue 1 year ago • 3 comments

If I initially had a LGBM model with the covariates defined as below:

lgbm_model =  LightGBMModel(
    lags=None,
    lags_past_covariates=list(range(-8, 0)), 
    lags_future_covariates=list(range(-22, 21)), 
    output_chunk_length=3,
    ....
)

How would I define a similar setup if I want to test out the TIDE model?

What would the input_chunk_length and output_chunk_length be in this case to take into account the lags for both the past and future covariates? I assume the output chunk length should still be 3?

ETTAN93 avatar Aug 08 '24 14:08 ETTAN93

As implemented in DARTS the TiDE model will use input_chunk_length for both lags and lags_past_covariates as defined in the regression models and will correspondingly use output_chunk_length for lags_future_covariates. Nearly all of the Torch forecasting models work this way, so if this is functionality you need you will need to write your own model.

eschibli avatar Aug 08 '24 16:08 eschibli

Thanks. Is there a specific reason why it was implemented that way? Or is it just how the model architecture works?

ETTAN93 avatar Aug 12 '24 12:08 ETTAN93

I'm not a developer of the library myself, but it is near-ubiquitous for neural network-based forecasting models to define a single lookback for past target values and covariates, and a single horizon for targets and future covariates. This is how TiDE was initially reported and is how all of the torch-based forecasting models in DARTS are implemented. In addition to simplicity of it, it allows the assumptions that the future covariates can be aligned with the output time dimension and the past covariates can be aligned with the past target values.

That being said, you could definitely adapt TiDE to meet your needs as it does not really depend on these assumptions, though implementing those changes may not be trivial as you would need to add a new dataset type and corresponding torch_forecasting_model type, as well as the model proper. Making the model architecture changes should be straightforward but I'm not sure how challenging the rest would be as I am not familiar with that part of the project.

eschibli avatar Aug 16 '24 18:08 eschibli