Nixtla / mlforecast

Scalable machine 🤖 learning for time series forecasting.
https://nixtlaverse.nixtla.io/mlforecast
Apache License 2.0
789 stars 74 forks source link

Lag feature: how initial values are treated or populated once the data has been shifted? #313

Closed MaxSunDaxwell closed 4 months ago

MaxSunDaxwell commented 4 months ago

Description

Handling of Initial Values in Lagged Time Series Data

For example, with a lag of 1: The value for Day 2 becomes the value from Day 1. The value for Day 3 becomes the value from Day 2.

However, what value is assigned to Day 1 in this scenario, considering it has no preceding day's value to shift from? Please add documentation about how you fill in that value? Thanks.

mlf = MLForecast(models=models, freq='W', lags=[1, 4], date_features=['week', 'year'], num_threads=-1) prep = mlf.preprocess(data)

Link

No response

jmoralez commented 4 months ago

Hey @MaxSunDaxwell, thanks for using mlforecast. The preprocess method has a dropna argument which defaults to True, so the red numbers correspond to rows that were dropped, if you set dropna=False you'll be able to see all of them.

MaxSunDaxwell commented 4 months ago

Hey @MaxSunDaxwell, thanks for using mlforecast. The preprocess method has a dropna argument which defaults to True, so the red numbers correspond to rows that were dropped, if you set dropna=False you'll be able to see all of them.

Thanks. Problem solved.