pyFTS.models package

Module contents

Fuzzy Time Series methods

Submodules

pyFTS.models.song module

First Order Traditional Fuzzy Time Series method by Song & Chissom (1993)

  1. Song and B. S. Chissom, “Fuzzy time series and its models,” Fuzzy Sets Syst., vol. 54, no. 3, pp. 269–277, 1993.

class pyFTS.models.song.ConventionalFTS(**kwargs)[source]

Bases: pyFTS.common.fts.FTS

Traditional Fuzzy Time Series

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
flr_membership_matrix(flr)[source]
flrgs: dict

The list of Fuzzy Logical Relationship Groups - FLRG

forecast(ndata, **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

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

operation_matrix(flrs)[source]
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

pyFTS.models.chen module

First Order Conventional Fuzzy Time Series by Chen (1996)

S.-M. Chen, “Forecasting enrollments based on fuzzy time series,” Fuzzy Sets Syst., vol. 81, no. 3, pp. 311–319, 1996.

class pyFTS.models.chen.ConventionalFLRG(LHS, **kwargs)[source]

Bases: pyFTS.common.flrg.FLRG

First Order Conventional Fuzzy Logical Relationship Group

append_rhs(c, **kwargs)[source]
get_key(sets)[source]

Returns a unique identifier for this FLRG

class pyFTS.models.chen.ConventionalFTS(**kwargs)[source]

Bases: pyFTS.common.fts.FTS

Conventional Fuzzy Time Series

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(ndata, **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

generate_flrg(flrs)[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

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

pyFTS.models.yu module

First Order Weighted Fuzzy Time Series by Yu(2005)

H.-K. Yu, “Weighted fuzzy time series models for TAIEX forecasting,” Phys. A Stat. Mech. its Appl., vol. 349, no. 3, pp. 609–624, 2005.

class pyFTS.models.yu.WeightedFLRG(LHS, **kwargs)[source]

Bases: pyFTS.common.flrg.FLRG

First Order Weighted Fuzzy Logical Relationship Group

append_rhs(c, **kwargs)[source]
weights(sets)[source]
class pyFTS.models.yu.WeightedFTS(**kwargs)[source]

Bases: pyFTS.common.fts.FTS

First Order Weighted Fuzzy Time Series

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(ndata, **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

generate_FLRG(flrs)[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

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(ndata, **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.cheng module

Trend Weighted Fuzzy Time Series by Cheng, Chen and Wu (2009)

C.-H. Cheng, Y.-S. Chen, and Y.-L. Wu, “Forecasting innovation diffusion of products using trend-weighted fuzzy time-series model,” Expert Syst. Appl., vol. 36, no. 2, pp. 1826–1832, 2009.

class pyFTS.models.cheng.TrendWeightedFLRG(LHS, **kwargs)[source]

Bases: pyFTS.models.yu.WeightedFLRG

First Order Trend Weighted Fuzzy Logical Relationship Group

weights(sets)[source]
class pyFTS.models.cheng.TrendWeightedFTS(**kwargs)[source]

Bases: pyFTS.models.yu.WeightedFTS

First Order Trend Weighted Fuzzy Time Series

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

generate_FLRG(flrs)[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

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)

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.hofts module

High Order FTS

Severiano, S. A. Jr; Silva, P. C. L.; Sadaei, H. J.; Guimarães, F. G. Very Short-term Solar Forecasting using Fuzzy Time Series. 2017 IEEE International Conference on Fuzzy Systems. DOI10.1109/FUZZ-IEEE.2017.8015732

class pyFTS.models.hofts.HighOrderFLRG(order, **kwargs)[source]

Bases: pyFTS.common.flrg.FLRG

Conventional High Order Fuzzy Logical Relationship Group

append_lhs(c)[source]
append_rhs(c, **kwargs)[source]
class pyFTS.models.hofts.HighOrderFTS(**kwargs)[source]

Bases: pyFTS.common.fts.FTS

Conventional High Order Fuzzy Time Series

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.

configure_lags(**kwargs)[source]
detail: str

A string with the model detailed information

dump: bool
flrgs: dict

The list of Fuzzy Logical Relationship Groups - FLRG

forecast(ndata, **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

generate_flrg(data)[source]
generate_flrg_fuzzyfied(data)[source]
generate_lhs_flrg(sample, explain=False)[source]
generate_lhs_flrg_fuzzyfied(sample, explain=False)[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

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

class pyFTS.models.hofts.WeightedHighOrderFLRG(order, **kwargs)[source]

Bases: pyFTS.common.flrg.FLRG

Weighted High Order Fuzzy Logical Relationship Group

append_lhs(c)[source]
append_rhs(fset, **kwargs)[source]
get_lower(sets)[source]

Returns the lower bound value for the RHS fuzzy sets

Parameters

sets – fuzzy sets

Returns

lower bound value

get_midpoint(sets)[source]

Returns the midpoint value for the RHS fuzzy sets

Parameters

sets – fuzzy sets

Returns

the midpoint value

get_upper(sets)[source]

Returns the upper bound value for the RHS fuzzy sets

Parameters

sets – fuzzy sets

Returns

upper bound value

weights()[source]
class pyFTS.models.hofts.WeightedHighOrderFTS(**kwargs)[source]

Bases: pyFTS.models.hofts.HighOrderFTS

Weighted High Order Fuzzy Time Series

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

generate_lhs_flrg_fuzzyfied(sample, explain=False)[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

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)

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.hwang module

High Order Fuzzy Time Series by Hwang, Chen and Lee (1998)

Jeng-Ren Hwang, Shyi-Ming Chen, and Chia-Hoang Lee, “Handling forecasting problems using fuzzy time series,” Fuzzy Sets Syst., no. 100, pp. 217–228, 1998.

class pyFTS.models.hwang.HighOrderFTS(**kwargs)[source]

Bases: pyFTS.common.fts.FTS

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.

configure_lags(**kwargs)[source]
detail: str

A string with the model detailed information

dump: bool
flrgs: dict

The list of Fuzzy Logical Relationship Groups - FLRG

forecast(ndata, **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

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

pyFTS.models.ifts module

High Order Interval Fuzzy Time Series

SILVA, Petrônio CL; SADAEI, Hossein Javedani; GUIMARÃES, Frederico Gadelha. Interval Forecasting with Fuzzy Time Series. In: Computational Intelligence (SSCI), 2016 IEEE Symposium Series on. IEEE, 2016. p. 1-8.

class pyFTS.models.ifts.IntervalFTS(**kwargs)[source]

Bases: pyFTS.models.hofts.HighOrderFTS

High Order Interval Fuzzy Time Series

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_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_interval(ndata, **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_lower(flrg)[source]
get_sequence_membership(data, fuzzySets)[source]
get_upper(flrg)[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

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)

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.ifts.WeightedIntervalFTS(**kwargs)[source]

Bases: pyFTS.models.hofts.WeightedHighOrderFTS

Weighted High Order Interval Fuzzy Time Series

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_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_interval(ndata, **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_lower(flrg)[source]
get_sequence_membership(data, fuzzySets)[source]
get_upper(flrg)[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

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)

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.ismailefendi module

First Order Improved Weighted Fuzzy Time Series by Efendi, Ismail and Deris (2013)

R. Efendi, Z. Ismail, and M. M. Deris, “Improved weight Fuzzy Time Series as used in the exchange rates forecasting of US Dollar to Ringgit Malaysia,” Int. J. Comput. Intell. Appl., vol. 12, no. 1, p. 1350005, 2013.

class pyFTS.models.ismailefendi.ImprovedWeightedFLRG(LHS, **kwargs)[source]

Bases: pyFTS.common.flrg.FLRG

First Order Improved Weighted Fuzzy Logical Relationship Group

append_rhs(c, **kwargs)[source]
weights()[source]
class pyFTS.models.ismailefendi.ImprovedWeightedFTS(**kwargs)[source]

Bases: pyFTS.common.fts.FTS

First Order Improved Weighted Fuzzy Time Series

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(ndata, **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

generate_flrg(flrs)[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

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(ndata, **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.pwfts module

class pyFTS.models.pwfts.ProbabilisticWeightedFLRG(order)[source]

Bases: pyFTS.models.hofts.HighOrderFLRG

High Order Probabilistic Weighted Fuzzy Logical Relationship Group

append_rhs(c, **kwargs)[source]
get_lower(sets)[source]

Returns the lower bound value for the RHS fuzzy sets

Parameters

sets – fuzzy sets

Returns

lower bound value

get_membership(data, sets)[source]

Returns the membership value of the FLRG for the input data

Parameters
  • data – input data

  • sets – fuzzy sets

Returns

the membership value

get_midpoint(sets)[source]

Return the expectation of the PWFLRG, the weighted sum

get_upper(sets)[source]

Returns the upper bound value for the RHS fuzzy sets

Parameters

sets – fuzzy sets

Returns

upper bound value

lhs_conditional_probability(x, sets, norm, uod, nbins)[source]
lhs_conditional_probability_fuzzyfied(lhs_mv, sets, norm, uod, nbins)[source]
partition_function(sets, uod, nbins=100)[source]
rhs_conditional_probability(x, sets, uod, nbins)[source]
rhs_unconditional_probability(c)[source]
class pyFTS.models.pwfts.ProbabilisticWeightedFTS(**kwargs)[source]

Bases: pyFTS.models.ifts.IntervalFTS

High Order Probabilistic Weighted Fuzzy Time Series

add_new_PWFLGR(flrg)[source]
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
flrg_lhs_conditional_probability(x, flrg)[source]
flrg_lhs_conditional_probability_fuzzyfied(x, flrg)[source]
flrg_lhs_unconditional_probability(flrg)[source]
flrg_rhs_conditional_probability(x, flrg)[source]
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

forecast_ahead_distribution(ndata, 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(ndata, **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_distribution_from_distribution(previous_dist, smooth, uod, bins, **kwargs)[source]
forecast_interval(ndata, **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

generate_flrg(data)[source]
generate_flrg2(data)[source]
generate_flrg_fuzzyfied(data)[source]
generate_lhs_flrg(sample, explain=False)[source]
generate_lhs_flrg_fuzzyfied(sample, explain=False)[source]
get_lower(flrg)[source]
get_midpoint(flrg)[source]
get_sets_from_both_fuzzyfication(sample)[source]
get_upper(flrg)[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_heuristic(sample, **kwargs)[source]
interval_quantile(ndata, alpha, **kwargs)[source]
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.

point_expected_value(sample, **kwargs)[source]
point_heuristic(sample, **kwargs)[source]
pwflrg_lhs_memberhip_fuzzyfied(flrg, sample)[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

update_model(data)[source]
pyFTS.models.pwfts.highorder_fuzzy_markov_chain(model)[source]
pyFTS.models.pwfts.visualize_distributions(model, **kwargs)[source]

pyFTS.models.sadaei module

First Order Exponentialy Weighted Fuzzy Time Series by Sadaei et al. (2013)

H. J. Sadaei, R. Enayatifar, A. H. Abdullah, and A. Gani, “Short-term load forecasting using a hybrid model with a refined exponentially weighted fuzzy time series and an improved harmony search,” Int. J. Electr. Power Energy Syst., vol. 62, no. from 2005, pp. 118–129, 2014.

class pyFTS.models.sadaei.ExponentialyWeightedFLRG(LHS, **kwargs)[source]

Bases: pyFTS.common.flrg.FLRG

First Order Exponentialy Weighted Fuzzy Logical Relationship Group

append_rhs(c, **kwargs)[source]
weights()[source]
class pyFTS.models.sadaei.ExponentialyWeightedFTS(**kwargs)[source]

Bases: pyFTS.common.fts.FTS

First Order Exponentialy Weighted Fuzzy Time Series

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(ndata, **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

generate_flrg(flrs, c)[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

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