a Time Series Regression Model – TechToday

Borrowing ideas from Meta’s Prophet to build a powerful time series regression model

Bradley Stephen Shaw
Towards Data Science
Photo by Niklas Rhöse on Unsplash

In this follow up article, I continue my mission to build Frankenstein’s time series monster by combining ideas from the popular Prophet package¹ and the talk “Winning with Simple, even Linear, Models”².

After we’ve reminded ourselves of what we’re up to we’ll touch on the regression model — what it is, and why it’s special.

We’ll then move on to hyper-parameter tuning using time series cross-validation to get an “optimal” model parameterisation.

Finally, we’ll validate the model using SHAP before taking advantage of the model form to allow bespoke investigations and manual adjustments.

That’s a lot of ground to cover — let’s get cracking.

Aside: we covered the underlying data preparation and feature engineering in a previous article, and so are jumping straight to modelling. Catch up on what went on there:

Let’s remind ourselves of what we’re doing.

The end goal is simple: to generate the most accurate forecast of future events across a specified time horizon.

We started from scratch with a time series containing only a date variable and the quantity of interest. From this, we derived additional features to help us model future outcomes accurately; these were heavily “inspired” by Prophet’s approach.

That brings us to where we are now: about ready to feed our engineered data into a lightweight model, training it to forecast into the future. Later on we’ll dive into the model’s internal workings.

Let’s remind ourselves of what the data looks like before we carry on.

We’re using real-world data from the UK — in this case, the STATS19 road traffic accidents data set which…

Source link

Source link