pyFTS.models.multivariate package¶
Module contents¶
Multivariate Fuzzy Time Series methods
Submodules¶
pyFTS.models.multivariate.FLR module¶
pyFTS.models.multivariate.common module¶
-
class
pyFTS.models.multivariate.common.
MultivariateFuzzySet
(**kwargs)[source]¶ Bases:
pyFTS.common.Composite.FuzzySet
Multivariate Composite Fuzzy Set
-
append_set
(variable, set)[source]¶ Appends a new fuzzy set from a new variable
Parameters: - variable – an multivariate.variable instance
- set – an common.FuzzySet instance
-
pyFTS.models.multivariate.variable module¶
-
class
pyFTS.models.multivariate.variable.
Variable
(name, **kwargs)[source]¶ Bases:
object
A variable of a fuzzy time series multivariate model. Each variable contains its own transformations and partitioners.
-
alias
= None¶ A string with the alias of the variable
-
alpha_cut
= None¶ Minimal membership value to be considered on fuzzyfication process
-
data_label
= None¶ A string with the column name on DataFrame
-
data_type
= None¶ The type of the data column on Pandas Dataframe
-
mask
= None¶ The mask for format the data column on Pandas Dataframe
-
name
= None¶ A string with the name of the variable
-
partitioner
= None¶ UoD partitioner for the variable data
-
transformation
= None¶ Pre processing transformation for the variable
-
pyFTS.models.multivariate.flrg module¶
-
class
pyFTS.models.multivariate.flrg.
FLRG
(**kwargs)[source]¶ Bases:
pyFTS.common.flrg.FLRG
Multivariate Fuzzy Logical Rule Group
-
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, variables)[source]¶ Returns the membership value of the FLRG for the input data
Parameters: - data – input data
- sets – fuzzy sets
Returns: the membership value
-
pyFTS.models.multivariate.partitioner module¶
-
class
pyFTS.models.multivariate.grid.
GridCluster
(**kwargs)[source]¶ Bases:
pyFTS.models.multivariate.partitioner.MultivariatePartitioner
A cartesian product of all fuzzy sets of all variables
-
class
pyFTS.models.multivariate.grid.
IncrementalGridCluster
(**kwargs)[source]¶ Bases:
pyFTS.models.multivariate.partitioner.MultivariatePartitioner
Create combinations of fuzzy sets of the variables on demand, incrementally increasing the multivariate fuzzy set base.
-
fuzzyfy
(data, **kwargs)[source]¶ Fuzzyfy the input data according to this partitioner fuzzy sets.
Parameters: - data – input value to be fuzzyfied
- alpha_cut – the minimal membership value to be considered on fuzzyfication (only for mode=’sets’)
- method – the fuzzyfication method (fuzzy: all fuzzy memberships, maximum: only the maximum membership)
- mode – the fuzzyfication mode (sets: return the fuzzy sets names, vector: return a vector with the membership
values for all fuzzy sets, both: return a list with tuples (fuzzy set, membership value) )
:returns a list with the fuzzyfied values, depending on the mode
-
pyFTS.models.multivariate.mvfts module¶
-
class
pyFTS.models.multivariate.mvfts.
MVFTS
(**kwargs)[source]¶ Bases:
pyFTS.common.fts.FTS
Multivariate extension of Chen’s ConventionalFTS method
-
append_variable
(var)[source]¶ Append a new endogenous variable to the model
Parameters: var – variable object Returns:
-
apply_transformations
(data, params=None, updateUoD=False, **kwargs)[source]¶ Apply the data transformations for data preprocessing
Parameters: - data – input data
- params – transformation parameters
- updateUoD –
- kwargs –
Returns: preprocessed data
-
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 n steps ahead
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 – in the multi step forecasting, the index of the data where to start forecasting
Returns: a list with the forecasted values
-
pyFTS.models.multivariate.wmvfts module¶
-
class
pyFTS.models.multivariate.wmvfts.
WeightedFLRG
(**kwargs)[source]¶ Bases:
pyFTS.models.multivariate.flrg.FLRG
Weighted Multivariate Fuzzy Logical Rule Group
-
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
-
-
class
pyFTS.models.multivariate.wmvfts.
WeightedMVFTS
(**kwargs)[source]¶ Bases:
pyFTS.models.multivariate.mvfts.MVFTS
Weighted Multivariate FTS
pyFTS.models.multivariate.cmvfts module¶
-
class
pyFTS.models.multivariate.cmvfts.
ClusteredMVFTS
(**kwargs)[source]¶ Bases:
pyFTS.models.multivariate.mvfts.MVFTS
Meta model for high order, clustered multivariate FTS
-
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
-
forecast_ahead_multivariate
(data, steps, **kwargs)[source]¶ Multivariate forecast n step ahead
Parameters: - data – Pandas dataframe with one column for each variable and with the minimal length equal to the max_lag of the model
- steps – the number of steps ahead to forecast
- kwargs – model specific parameters
Returns: a Pandas Dataframe object representing the forecasted values for each variable
-
forecast_multivariate
(data, **kwargs)[source]¶ Multivariate forecast one step ahead
Parameters: - data – Pandas dataframe with one column for each variable and with the minimal length equal to the max_lag of the model
- kwargs – model specific parameters
Returns: a Pandas Dataframe object representing the forecasted values for each variable
-
fts_method
= None¶ The FTS method to be called when a new model is build
-
fts_params
= None¶ The FTS method specific parameters
-
model
= None¶ The most recent trained model
-
pyFTS.models.multivariate.granular module¶
-
class
pyFTS.models.multivariate.granular.
GranularWMVFTS
(**kwargs)[source]¶ Bases:
pyFTS.models.multivariate.cmvfts.ClusteredMVFTS
Granular multivariate weighted high order FTS
-
model
= None¶ The most recent trained model
-