JoaquinAmatRodrigo / skforecast

Time series forecasting with machine learning models
https://skforecast.org
BSD 3-Clause "New" or "Revised" License
1.09k stars 125 forks source link

Using skforecast with panel data #659

Closed davidusb-geek closed 4 months ago

davidusb-geek commented 6 months ago

Hi, I couldn't find any information about this type of problem so I opened this issue. I wish to use skforecast to forecast some panel data. This type of data is in the form: image

Is is possible? How could you approach this type of problem with skforecast?

JavierEscobarOrtiz commented 6 months ago

Hello @davidusb-geek

It looks like a multi-series problem, but some preprocessing needs to be done.

Could you describe the problem a little more, what are the target variables and what are the exogenous variables?

Thanks

davidusb-geek commented 6 months ago

Hello @davidusb-geek

It looks like a multi-series problem, but some preprocessing needs to be done.

Could you describe the problem a little more, what are the target variables and what are the exogenous variables?

Thanks

The problem is exactly like in the image I posted. I have multiple time series instances (sometimes called samples), and each instance or sample has the same length with a timestamp. Well in my case the timestamp is already a DateTimeIndex so well fitted for skforecast. Then for each of these instances/samples I have features variables (var_0, var1, ...) and a target. All these variables are float, no NaN's. That's it. I want to forecast the target using the information from all the features.

JavierEscobarOrtiz commented 6 months ago

I see. In the current version it is not possible to face this problem, but in skforecast 0.12 (hopefully released in 2 weeks) the ForecasterAutoregMultiSeries will be able to handle this situation. I will come back to this issue when the release is ready.

davidusb-geek commented 6 months ago

Great to hear that Javier. Kudos for all this nice work!

JavierEscobarOrtiz commented 4 months ago

Hello @davidusb-geek,

The functionality to include series-specific exogenous variables in ForecasterMultiSeries is now available in skforecast 0.12.0:

https://skforecast.org/latest/user_guides/multi-series-with-different-length-and-different_exog

We will improve the user guide in the coming days. 😄

Hope it helps!