pyFTS.models.ensemble package

Submodules

pyFTS.models.ensemble.ensemble module

EnsembleFTS wraps several FTS methods to ensemble their forecasts, providing point, interval and probabilistic forecasting.

Silva, P. C. L et al. Probabilistic Forecasting with Seasonal Ensemble Fuzzy Time-Series XIII Brazilian Congress on Computational Intelligence, 2017. Rio de Janeiro, Brazil.

class pyFTS.models.ensemble.ensemble.AllMethodEnsembleFTS(**kwargs)[source]

Bases: pyFTS.models.ensemble.ensemble.EnsembleFTS

Creates an EnsembleFTS with all point forecast methods, sharing the same partitioner

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

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

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

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.

set_transformations(model)[source]
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

class pyFTS.models.ensemble.ensemble.EnsembleFTS(**kwargs)[source]

Bases: pyFTS.common.fts.FTS

Ensemble FTS

alpha

The quantiles

alpha_cut: float

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

append_model(model)[source]

Append a new trained model to the ensemble

Parameters

model – FTS model

auto_update: bool

A boolean value indicating that model is incremental

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_distribution(data, steps, **kwargs)[source]

Probabilistic 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

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

Returns

a list with the forecasted Probability Distributions

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

Interval 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

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

Returns

a list with the forecasted intervals

forecast_distribution(data, **kwargs)[source]

Probabilistic 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 probabilistic.ProbabilityDistribution objects representing the forecasted Probability Distributions

forecast_interval(data, **kwargs)[source]

Interval 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 prediction intervals

get_UoD()[source]

Returns the interval of the known bounds of the universe of discourse (UoD), i. e., the known minimum and maximum values of the time series.

Returns

A set with the lower and the upper bounds of the UoD

get_distribution_interquantile(forecasts, alpha)[source]
get_interval(forecasts)[source]
get_models_forecasts(data)[source]
get_point(forecasts, **kwargs)[source]
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

interval_method

The method used to mix the several model’s forecasts into a interval forecast. Options: quantile, extremum, normal

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

models

A list of FTS models, the ensemble components

name: str

A string with the model name

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

parameters

A list with the parameters for each component model

partitioner: partitioner.Partitioner

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

point_method

The method used to mix the several model’s forecasts into a unique point forecast. Options: mean, median, quantile, exponential

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

class pyFTS.models.ensemble.ensemble.SimpleEnsembleFTS(**kwargs)[source]

Bases: pyFTS.models.ensemble.ensemble.EnsembleFTS

An homogeneous FTS method ensemble with variations on partitionings and orders.

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

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

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

method

FTS method class that will be used on internal models

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

order: int

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

orders

Possible variations of order on internal models

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

UoD partitioner class that will be used on internal methods

partitions

Possible variations of number of partitions on internal models

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

pyFTS.models.ensemble.ensemble.sampler(data, quantiles, bounds=False)[source]

pyFTS.models.ensemble.multiseasonal module

Silva, P. C. L et al. Probabilistic Forecasting with Seasonal Ensemble Fuzzy Time-Series XIII Brazilian Congress on Computational Intelligence, 2017. Rio de Janeiro, Brazil.

class pyFTS.models.ensemble.multiseasonal.SeasonalEnsembleFTS(name, **kwargs)[source]

Bases: pyFTS.models.ensemble.ensemble.EnsembleFTS

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

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_distribution(data, **kwargs)[source]

Probabilistic 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 probabilistic.ProbabilityDistribution objects representing the forecasted Probability Distributions

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

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.

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

update_uod(data)[source]
pyFTS.models.ensemble.multiseasonal.train_individual_model(partitioner, train_data, indexer)[source]

Module contents

Meta FTS that aggregates other FTS methods