Machine Learning

How To: Forecast Time Series Using Lags | by Haden Pelletier | January, 2025

Yellow columns can greatly increase the performance of your model. Here's how you can use them to your advantage

About Data Science
Photo by author

The nature of the time series model is that past values ​​often affect future values. Where there is any kind time of year in your data (in other words, your data follows an hourly, daily, weekly, monthly or yearly cycle) this relationship is even stronger.

Holding this relationship can be done with features such as hour, day of the week, month, etc., but you can also add lags, which can quickly take your model to the next level.

A value lag This is simply: A value that, at one time or another, preceded your current value.

Suppose you have a time series dataset with the following values: [5,10,15,20,25].

25, which is your latest value, the value at time t.

20 is the value at t-1. 15 value at t-2, and so on, until the beginning of the dataset.

This makes intuitive sense, since the word “lag” implies that something “lags behind” something else.

When we train a model using lag features, we can train it to recognize patterns about…

Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button