Esc
Ask AIAnswers may be inaccurate; check the linked pages.Esc
Ask anything about these docs, like how to get started or what a function does.

AutoMFLES (Automated Multi-Feature Locally Exponential Smoothing)

This module provides an automated, parallelized grid-search wrapper for the MFLES forecasting engine. It automatically identifies the optimal hyperparameters using time-series cross-validation.

AutoMFLES

auto_mfles.AutoMFLES · inherits BaseForecaster

Automated MFLES wrapper with parallelized grid-search hyperparameter optimization.

Inherits from BaseForecaster, providing the standard fit() / predict() / forecast() interface. Internally wraps an MFLES base-estimator, automatically selecting optimal hyperparameters via time-series cross-validation.

Attributes

Attribute Type Description
alias str Custom system tracking ID.
model_ Optional[Dict[str, Any]] The fitted internal MFLES model and its fitted values.

__init__(self, test_size, season_length=None, n_windows=2, config=None, step_size=None, metric='smape', verbose=False, prediction_intervals=None, alias='AutoMFLES', n_jobs=4)

Initializes the AutoMFLES wrapper class.

Parameter Type Default Description
test_size int - Primary step horizon to evaluate internal cross validation.
season_length Optional[Union[int, List[int]]] None Structural repetition frequency.
n_windows int 2 Allowed number of cross validation iterations.
config Optional[List[Dict[str, Any]]] None Hardcoded overrides.
step_size Optional[int] None Steps separating CV windows. Defaults to test_size.
metric str "smape" Assessed target loss metric.
verbose bool False Reporting status flag.
prediction_intervals Optional[Any] None Settings dictating conformal bound output.
alias str "AutoMFLES" Custom system tracking ID.
n_jobs int 4 Authorized CPU Thread limits.

Raises: - ValueError: If test_size or n_windows are <= 0.

fit(self, y, X=None) -> Self

Fits the AutoMFLES engine to the given time series and regressors.

Accepts training time series data, conducts parallelized grid optimization, applies required structural scaling, and fits the base system.

Parameter Type Default Description
y Union[np.ndarray, jnp.ndarray] - Vector array of historical values.
X Optional[jnp.ndarray] None Structural feature regressor inputs.

Returns: Self (A reference mapping back to itself to permit operation chaining. Sets self.model_).

predict(self, h, X=None, level=None) -> Dict[str, Any]

Calculates out-of-sample forward observations utilizing parameterized state mapping.

Parameter Type Default Description
h int - Out-of-sample target evaluation step count.
X Optional[jnp.ndarray] None Expected out-of-sample features array.
level Optional[List[int]] None Percentage integer bounds (e.g. 90, 95).

Returns: dict (Dictionary keys mapping "mean", and conditionally bound arrays.) Keys include {"mean": jnp.ndarray} and optionally {"lo-{lv}": jnp.ndarray, "hi-{lv}": jnp.ndarray} if level is provided.

Raises: - RuntimeError: Tripped if action executed without preceding fit procedure. - ValueError: Tripped if inference attempts feature mapping absent historical features.

forecast(self, y, h, X=None, X_future=None, level=None, fitted=False) -> dict

Stateless fit+predict in one call.

Parameter Type Default Description
y jnp.ndarray - Input time series.
h int - Forecast horizon.
X jnp.ndarray or None None In-sample exogenous variables.
X_future jnp.ndarray or None None Future exogenous variables.
level list[int \| float] or None None Confidence levels for prediction intervals.
fitted bool False Whether to return in-sample fitted values.

Returns: dict (Keys: 'mean', and optionally 'lo-{lv}', 'hi-{lv}', 'fitted'.)