MFLES is a simple time series method based on gradient boosting time series decomposition.There are numerous methods that can enter the boosting loop depending on user-provided parameters or some quick logic MFLES does automatically that seems to work ok. Some of these methods are:
- SES Ensemble
- Simple Moving Average
- Piecewise Linear Trend
- Fourier Basis function regression for seasonality
- Simple Median
- A Robust Linear Method for trend
Gradient Boosted Decomposition
This approach aims to view a time series decomposition (trend, seasonality, and exogenous) as the ‘weak’ estimator in a gradient boosting procedure. The major relevant changes to note are:- The trend estimator will always go from simple to complex. Beginning with a median, then to a linear/piecewise linear, then to some sort of smoother.
- Multiple seasonality is fit one seasonality per boosting round rather than simultaneously. This means you should organize your seasonality in order of perceived importance. Also, theoretically, you can have up to 50 seasonalities present by default, but after 3 you should expect degraded performance.
- Learning rates are now estimator specific rather than a single parameter like you would see in something like XGBoost. This is useful if you have exogenous signals that are also seasonal, you (this will not be done automatically) can optimize for the combination of the seasonal signal and the exogenous signal.
Let’s forecast
- season_length: a list of seasonal periods, in order of perceived importance preferably.
- test_size: AutoMFLES is optimized via time series cross validation. The test size dictates how many periods to use in each test fold. This is probably the most important parameter when it comes to optimizing and you should weigh the season length, forecast horizon, and general data length when setting this. But a good rule of thumb is either the most important season length or half that to allow MFLES to pick up on seasonality.
- n_windows: how many test sets are used in optimizing parameters. In this example, 2 means that we, in total, use 24 months (12 * 2) split between the 2 windows.
- metric: this one is easy, it is simply the metric we want to optimize for with our parameters. Here we use the default which is smape that is defaulted to reproduce experiment results on M4. You can also pass ‘rmse’, ‘mape’, or ‘mae’ to optimize for another metric.
A deeper look at a more customized model
The previous fit is done with 99% automated logic checks and grid searched parameters. But we can manipulate the fit greatly (maybe too much). This section will overview some very important parameters and how they effect the output.The parameter grid search
First, let’s take a look at the default grid of parameters AutoMFLES will try:- seasonality_weights: If True, we will weigh more recent observations more when calculating seasonality. The allows a deterministic seasonality to reflect more recent changes.
- smoother: True means we will use a simple exponential smoother to fit on residuals after a few rounds of boosting. If the parameter is False then we use a simple moving average
- ma: This parameter is the number of past observations to include when using a moving average, None indicates it will be semi-auto set or disregarded in the case of ‘smoother’ being True. For optimizing we search for the minimum season length provided by you or that number divided by 2.
- seasonal_period: this is the list of season_length provided by the you

