skforecast icon indicating copy to clipboard operation
skforecast copied to clipboard

Custom predictors with additional variables that unrelated to time series

Open oy321 opened this issue 2 years ago • 9 comments

Thanks for the great library! I am trying to apply it to a use case where I need to train a predictor to make a recursive multi-step predictions into the future, where I'd wish to use multiple predicting variables that not related to the target time series itself, but it seems impossible.

First I am aware of the exogenous variables but it requires the future values of exogenous variables are known. In my case, as I need the final forecaster to be able to make multi-steps prediction into future, so this function is not relevant.

For the 'ForecasterAutoregCustom' function where it supports argument of 'fun_predictors', I looked at the source code line 246: X_train.append(self.create_predictors(y=y_values[train_index]))

It only takes the "y" values as the input but not the other variables that not related to "y". Well, it's very common to have a multi-variate and multi-step forecasting scenario when the future exogenous variables are unknown, I am not quite sure how to do it with this library.

Thank you

oy321 avatar Mar 21 '22 10:03 oy321

Hi @oy321 If I do understood your explanation, you are trying to train a forecaster using multiple time series at once. This feature is not yet available, but will be in the 0.5 release, that I hope will be release soon.

JoaquinAmatRodrigo avatar Mar 21 '22 22:03 JoaquinAmatRodrigo

Dear author,

Yes that's correct. I'll implement it manually as for now. Hopefully can use this package later.

oy321 avatar Mar 22 '22 01:03 oy321

This is something already demanded by several users so it will be one of the priorities for next release. @JavierEscobarOrtiz let's keep in mind.

JoaquinAmatRodrigo avatar Mar 22 '22 08:03 JoaquinAmatRodrigo

That's great. Please let me know if I can be of any help. Excuse me from going further on this topic, would this new feature support multi-step recursive predictions with multiple time series inputs, or only the direct predictions using multiple models?

oy321 avatar Mar 22 '22 22:03 oy321

The idea I have so fare is to generalizer the input y in a way that it allows using dataframes. Each column of the dataframe will be considered as independent time series from which the forecaster will learn. This approach should be compatible with both, multi-step recursive and multi-step direct. I will share an initial draft as soon as possible :-)

JoaquinAmatRodrigo avatar Mar 23 '22 08:03 JoaquinAmatRodrigo

Thanks for sharing your thoughts. I could imagine the way you described as "Each column of the dataframe will be considered as independent time series from which the forecaster will learn". However I have a doubt about how it could work with multi-step recursive forecasting. When there is only one predictor which is the target 'y', the recursive strategy works. But when there are multiple (independent or interdependent) time series inputs besides the target time series, you could make one step prediction on 'y', but then for the following steps it would require not only the target variable but also the other input time series to move forward together, but the future values of those X's would not be available. Therefore I thought only the multi-step direct approach is possible?

oy321 avatar Mar 23 '22 20:03 oy321

You are right @oy321 I will do some research about how multiple time series may be used in a multi-step recursive strategy but, as you explained, it may be only possible for multi-step direct approach. Thanks a lot for sharing your thoughts, any new idea is very welcome!

JoaquinAmatRodrigo avatar Mar 24 '22 09:03 JoaquinAmatRodrigo

My pleasure! Would get in touch if there is any. And please let me know if I am proved wrong re. above.

oy321 avatar Mar 26 '22 13:03 oy321

New feature for multi-series forecasting has been added in version 0.5.0

https://joaquinamatrodrigo.github.io/skforecast/0.5.0/user_guides/multi-time-series-forecasting.html

JoaquinAmatRodrigo avatar Sep 24 '22 09:09 JoaquinAmatRodrigo

Hi, first of all congrats for your incredible library, awesome work! I have been exploring the latest features in 0.5.0 and specially the Multi Time Series forecasting. One question arised was about the idea of Multivariate Multi time series ones. Due to the recursive way isn't possible because the interdependencies between targets and lagged features, the only way to deal with this problem would be the direct approach, right? I guess using the MultiOutput function.

pmateosmasa1 avatar Oct 05 '22 15:10 pmateosmasa1

Hi @pmateosmasa1, You are right, for multivariate time series forecasting, the aproach we are working on is by using the Direct strtategy. However, there are also other models that are able to handle multivariate scenarios, one of them is Vector Autoregression (VAR).

https://www.machinelearningplus.com/time-series/vector-autoregression-examples-python/

JoaquinAmatRodrigo avatar Oct 10 '22 08:10 JoaquinAmatRodrigo

Hi @pmateosmasa1

Multivariate approach has been released in skforecast 0.6.0 😄 Check the user guide:

https://joaquinamatrodrigo.github.io/skforecast/latest/user_guides/multivariate-forecasting.html

JavierEscobarOrtiz avatar Dec 01 '22 11:12 JavierEscobarOrtiz

It has been more than 60 days since the last activity on this GitHub issue. Since we have not received any updates or progress reports, we will be closing this issue.

If this issue is still relevant and requires attention, please feel free to reopen it and provide an update. We appreciate your contributions and would love to see this issue resolved if it is still relevant.

Thank you for your participation and cooperation!

JoaquinAmatRodrigo avatar Apr 05 '23 09:04 JoaquinAmatRodrigo