pyFTS.models.incremental package

Module contents

FTS methods with incremental/online learning

Submodules

pyFTS.models.incremental.TimeVariant module

Meta model that wraps another FTS method and continously retrain it using a data window with the most recent data

class pyFTS.models.incremental.TimeVariant.Retrainer(**kwargs)[source]

Bases: pyFTS.common.fts.FTS

Meta model for incremental/online learning that retrain its internal model after data windows controlled by the parameter ‘batch_size’, using as the training data a window of recent lags, whose size is controlled by the parameter ‘window_length’.

alpha_cut: float

A float with the minimal membership to be considered on fuzzyfication process

auto_update: bool

If true the model is updated at each time and not recreated

batch_size

The batch interval between each retraining

benchmark_only: bool

A boolean value indicating a façade for external (non-FTS) model used on benchmarks or ensembles.

detail: str

A string with the model detailed information

dump: bool
flrgs: dict

The list of Fuzzy Logical Relationship Groups - FLRG

forecast(data, **kwargs)[source]

Point forecast one step ahead

Parameters
  • data – time series data with the minimal length equal to the max_lag of the model

  • kwargs – model specific parameters

Returns

a list with the forecasted values

forecast_ahead(data, steps, **kwargs)[source]

Point forecast from 1 to H steps ahead, where H is given by the steps parameter

Parameters
  • data – time series data with the minimal length equal to the max_lag of the model

  • steps – the number of steps ahead to forecast (default: 1)

  • start_at – in the multi step forecasting, the index of the data where to start forecasting (default: 0)

Returns

a list with the forecasted values

fts_method

The FTS method to be called when a new model is build

fts_params

The FTS method specific parameters

has_interval_forecasting: bool

A boolean value indicating if the model supports interval forecasting, default: False

has_point_forecasting: bool

A boolean value indicating if the model supports point forecasting, default: True

has_probability_forecasting: bool

A boolean value indicating if the model support probabilistic forecasting, default: False

has_seasonality: bool

A boolean value indicating if the model supports seasonal indexers, default: False

is_clustered: bool

A boolean value indicating if the model support multivariate time series (Pandas DataFrame), but works like a monovariate method, default: False

is_high_order: bool

A boolean value indicating if the model support orders greater than 1, default: False

is_multivariate: bool

A boolean value indicating if the model support multivariate time series (Pandas DataFrame), default: False

is_time_variant: bool

A boolean value indicating if this model is time variant

is_wrapper: bool

Indicates that this model is a wrapper for other(s) method(s)

lags: list[int]

The list of lag indexes for high order models

log: pd.DataFrame
max_lag: int

A integer indicating the largest lag used by the model. This value also indicates the minimum number of past lags needed to forecast a single step ahead

min_order: int

In high order models, this integer value indicates the minimal order supported for the model, default: 1

model

The most recent trained model

name: str

A string with the model name

offset()[source]

Returns the number of lags to skip in the input test data in order to synchronize it with the forecasted values given by the predict function. This is necessary due to the order of the model, among other parameters.

Returns

An integer with the number of lags to skip

order: int

A integer with the model order (number of past lags are used on forecasting)

original_max: float

A float with the upper limit of the Universe of Discourse, the maximal value found on training data

original_min: float

A float with the lower limit of the Universe of Discourse, the minimal value found on training data

partitioner: partitioner.Partitioner

The most recent trained partitioner

partitioner_method

The partitioner method to be called when a new model is build

partitioner_params

The partitioner method parameters

shortname: str

A string with a short name or alias for the model

standard_horizon: int

Standard forecasting horizon (Default: 1)

train(data, **kwargs)[source]

Method specific parameter fitting

Parameters
  • data – training time series data

  • kwargs – Method specific parameters

transformations: list[transformation.Transformation]

A list with the data transformations (common.Transformations) applied on model pre and post processing, default: []

transformations_param: list

A list with the specific parameters for each data transformation

uod_clip: bool

Flag indicating if the test data will be clipped inside the training Universe of Discourse

window_length

The memory window length

pyFTS.models.incremental.IncrementalEnsemble module

Time Variant/Incremental Ensemble of FTS methods

class pyFTS.models.incremental.IncrementalEnsemble.IncrementalEnsembleFTS(**kwargs)[source]

Bases: pyFTS.models.ensemble.ensemble.EnsembleFTS

Time Variant/Incremental Ensemble of FTS methods

alpha_cut: float

A float with the minimal membership to be considered on fuzzyfication process

auto_update: bool

A boolean value indicating that model is incremental

batch_size

The batch interval between each retraining

benchmark_only: bool

A boolean value indicating a façade for external (non-FTS) model used on benchmarks or ensembles.

detail: str

A string with the model detailed information

dump: bool
flrgs: dict

The list of Fuzzy Logical Relationship Groups - FLRG

forecast(data, **kwargs)[source]

Point forecast one step ahead

Parameters
  • data – time series data with the minimal length equal to the max_lag of the model

  • kwargs – model specific parameters

Returns

a list with the forecasted values

forecast_ahead(data, steps, **kwargs)[source]

Point forecast from 1 to H steps ahead, where H is given by the steps parameter

Parameters
  • data – time series data with the minimal length equal to the max_lag of the model

  • steps – the number of steps ahead to forecast (default: 1)

  • start_at – in the multi step forecasting, the index of the data where to start forecasting (default: 0)

Returns

a list with the forecasted values

fts_method

The FTS method to be called when a new model is build

fts_params

The FTS method specific parameters

has_interval_forecasting: bool

A boolean value indicating if the model supports interval forecasting, default: False

has_point_forecasting: bool

A boolean value indicating if the model supports point forecasting, default: True

has_probability_forecasting: bool

A boolean value indicating if the model support probabilistic forecasting, default: False

has_seasonality: bool

A boolean value indicating if the model supports seasonal indexers, default: False

is_clustered: bool

A boolean value indicating if the model support multivariate time series (Pandas DataFrame), but works like a monovariate method, default: False

is_high_order: bool

A boolean value indicating if the model support orders greater than 1, default: False

is_multivariate: bool

A boolean value indicating if the model support multivariate time series (Pandas DataFrame), default: False

is_time_variant: bool

A boolean value indicating if this model is time variant

is_wrapper: bool

Indicates that this model is a wrapper for other(s) method(s)

lags: list[int]

The list of lag indexes for high order models

log: pd.DataFrame
max_lag: int

A integer indicating the largest lag used by the model. This value also indicates the minimum number of past lags needed to forecast a single step ahead

min_order: int

In high order models, this integer value indicates the minimal order supported for the model, default: 1

name: str

A string with the model name

num_models

The number of models to hold in the ensemble

offset()[source]

Returns the number of lags to skip in the input test data in order to synchronize it with the forecasted values given by the predict function. This is necessary due to the order of the model, among other parameters.

Returns

An integer with the number of lags to skip

order: int

A integer with the model order (number of past lags are used on forecasting)

original_max: float

A float with the upper limit of the Universe of Discourse, the maximal value found on training data

original_min: float

A float with the lower limit of the Universe of Discourse, the minimal value found on training data

partitioner: partitioner.Partitioner

A pyFTS.partitioners.Partitioner object with the Universe of Discourse partitioner used on the model. This is a mandatory dependecy.

partitioner_method

The partitioner method to be called when a new model is build

partitioner_params

The partitioner method parameters

shortname: str

A string with a short name or alias for the model

standard_horizon: int

Standard forecasting horizon (Default: 1)

train(data, **kwargs)[source]

Method specific parameter fitting

Parameters
  • data – training time series data

  • kwargs – Method specific parameters

transformations: list[transformation.Transformation]

A list with the data transformations (common.Transformations) applied on model pre and post processing, default: []

transformations_param: list

A list with the specific parameters for each data transformation

uod_clip: bool

Flag indicating if the test data will be clipped inside the training Universe of Discourse

window_length

The memory window length