https://github.com/nixtla logo
#general
Title
# general
m

Mehmet Can Yıldırım

05/16/2023, 12:21 PM
Hello, I am new in mlforecast and i have a question about this library. Is it possible that add external features such as weather temperature or trend, seasonality of series that i will forecast ? Thank you for your answer.
m

Max (Nixtla)

05/16/2023, 3:09 PM
Yes, it is possible to add external features such as weather temperature or trend, seasonality of series that you will forecast. The
MLForecast
class in
mlforecast
framework supports exogenous variables and static covariates. These can be included as additional columns in the pandas dataframe that is passed to the
fit
and
predict
methods. You can define these additional features by creating additional columns in the pandas dataframe that is passed to the
fit
and
predict
methods. Seehttps://nixtla.github.io/mlforecast/docs/end_to_end_walkthrough.html
m

Mehmet Can Yıldırım

05/17/2023, 8:15 AM
Thank you for your interest. I checked this link but i couldn't see the anything about adding specific features such as trend, seasonality of series. I add lag features, date features at the below picture. However when i try to add trend of this serie, it cannot be added. What should i do now ? Note: I decomposed the serie and obtained trend component at the above of my notebook.
m

Max (Nixtla)

05/17/2023, 4:48 PM
Hi @Mehmet Can Yıldırım, you are right. I was under the impression we included static and dynamic covariates in that tutorial. Please check this link. You can find an example on hoe to add external features https://nixtla.github.io/mlforecast/forecast.html#dynamic-features
m

Mehmet Can Yıldırım

05/18/2023, 6:19 AM
Hi @Max (Nixtla), Thank you! I have one more question about it. You're saying that we can add the features such as trend, temperature, sensor data etc. as dynamic features. However, when we forecast next steps (future), i have again dynamic features and i want to see the effect of the dynamic features at the end of the forecast. Here is an example about it: Let's say, i have demand data daily. Then i want to forecast demand for next 2 steps (future). And i have also dynamic feature like flag that contains 1's and 0's. Then, i want to add the effect of the this flag for the forecast. I also add example picture above. In a summary, I know what happened in the past when flags were 1 and 0 and how many demands were received. Since I know that it has an effect on demand and I want to see this effect in my forecasts in the future demands, that's why, I should use this flag feature when forecasting. Can i do this with MLForecast? Thank you for your interest.