Forecasting Model Base Classes

A forecasting model captures the future values of a time series as a function of the past as follows:

\[y_{t+1} = f(y_t, y_{t-1}, ..., y_1),\]

where \(y_t\) represents the time series’ value(s) at time \(t\).

The main functions are fit() and predict(). fit() learns the function f(), over the history of one or several time series. The function predict() applies f() on one or several time series in order to obtain forecasts for a desired number of time stamps into the future.

class darts.models.forecasting.forecasting_model.ModelMeta(name, bases, namespace, **kwargs)[source]

Bases: ABCMeta

Meta class to store parameters used at model creation.

When creating a model instance, the parameters are extracted as follows:

  1. Get the model’s __init__ signature and store all arg and kwarg names as well as default values (empty for args) in an ordered dict all_params.

  2. Replace the arg values from all_params with the positional args used at model creation.

  3. Remove args from all_params that were not passed as positional args at model creation. This will enforce that an error is raised if not all positional args were passed. If all positional args were passed, no parameter will be removed.

  4. Update all_params kwargs with optional kwargs from model creation.

  5. Save all_params to the model.

  6. Call (create) the model with all_params.

Methods

__call__(*args, **kwargs)

Call self as a function.

mro(/)

Return a type's method resolution order.

register(subclass)

Register a virtual subclass of an ABC.

mro(/)

Return a type’s method resolution order.

register(subclass)

Register a virtual subclass of an ABC.

Returns the subclass, to allow usage as a class decorator.