What does the parameter seriesLength do in the ForecastBySsa-algorithm in ML.NET?

Viewed 169

I'm currently trying to forecast the temperature based on the data from a temperature sensor. I'm using the ForecastBySSa-algorithm in ML.NET. This algorithm has a parameter called seriesLength, but I can't figure out what this parameter does.

A search on the internet came up with multiple contradicting answers to this question, such as:

  • "This parameter specifies the number of data points that are used when performing a forecast." (source)
  • "The forecastingPipeline takes 365 data points for the first year [trainSize = 365] and samples or splits the time-series dataset into 30-day (monthly) intervals as specified by the seriesLength parameter. Each of these samples is analyzed through weekly or a 7-day window. [windowSize = 7]" (source)
  • And the documentation itself states that the parameter seriesLength is: "The length of series that is kept in buffer for modeling (parameter N)." (source)

I've tried several thing to figure out what this parameter does:

  1. I've tried varying the seriesLength while fixing the other parameters. But this didn't change anything when making predictions. I've also tried varying the seriesLength while one at a time varying the parameters: trainSize and windowSize, but that didn't make any changes either.
  2. I've tried tracing seriesLength throughout the entire algorithm, and it does appear as the size of some buffer. But when making a prediction the algorithm only uses the last L elements of the buffer to make a forecast (where L is the windowSize, which by design has to be smaller than the seriesLength). So the rest of the elements in the buffer seemes to not matter at all?

So my best conclusion is that the seriesLength doesn't do anything at all. But that doesn't make sense since it is not an optional parameter.

Another conclusion could be that seriesLength is not yet fully implemented, since that is the case for e.g. the parameter isAdaptive, which ends in a comment: "REVIEW: to be implemented in the next version based on the FAPI algorithm in https://hal-institut-mines-telecom.archives-ouvertes.fr/hal-00479772/file/twocolumns.pdf."

What does this parameter seriesLength actually do?

1 Answers

The official docs says the following about seriesLength:

The length of series that is kept in buffer for modeling (parameter N).

Looking into the source code of ML.NET I can see that the ForecastBySSA algorithm uses the next class: AdaptiveSingularSpectrumSequenceModeler. Maybe looking inside the class will explain more about the parameter. Also, a great way to find the answer is to google for Adaptive Singular Spectrum Sequence. ML.NET has the tendency to use different names for their algorithms than that is commonly used, e.c. Python libraries.

My last bit of advice is looking at the samples ML.NET provides at their Github: https://github.com/dotnet/machinelearning-samples/tree/main/samples/csharp/end-to-end-apps/Forecasting-Sales

Related