pyFTS.models.multivariate package

Module contents

Multivariate Fuzzy Time Series methods

Submodules

pyFTS.models.multivariate.FLR module

class pyFTS.models.multivariate.FLR.FLR[source]

Bases: object

Multivariate Fuzzy Logical Relationship

set_lhs(var, set)[source]
set_rhs(set)[source]

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

membership(x)[source]

Calculate the membership value of a given input

Parameters

x – input value

Returns

membership value of x at this fuzzy set

set_target_variable(variable)[source]
pyFTS.models.multivariate.common.fuzzyfy_instance(data_point, var, tuples=True)[source]
pyFTS.models.multivariate.common.fuzzyfy_instance_clustered(data_point, cluster, **kwargs)[source]

pyFTS.models.multivariate.variable module

pyFTS.models.multivariate.flrg module

class pyFTS.models.multivariate.flrg.FLRG(**kwargs)[source]

Bases: pyFTS.common.flrg.FLRG

Multivariate Fuzzy Logical Rule Group

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_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

get_upper(sets)[source]

Returns the upper bound value for the RHS fuzzy sets

Parameters

sets – fuzzy sets

Returns

upper bound value

set_lhs(var, fset)[source]

pyFTS.models.multivariate.partitioner module

class pyFTS.models.multivariate.partitioner.MultivariatePartitioner(**kwargs)[source]

Bases: pyFTS.partitioners.partitioner.Partitioner

Base class for partitioners which use the MultivariateFuzzySet

append(fset)[source]
build(data)[source]

Perform the partitioning of the Universe of Discourse

Parameters

data – training data

Returns

build_index()[source]
change_target_variable(variable)[source]
format_data(data)[source]
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

prune()[source]
search(data, **kwargs)[source]

Perform a search for the nearest fuzzy sets of the point ‘data’. This function were designed to work with several overlapped fuzzy sets.

Parameters
  • data – the value to search for the nearest fuzzy sets

  • type – the return type: ‘index’ for the fuzzy set indexes or ‘name’ for fuzzy set names.

Returns

a list with the nearest fuzzy sets

pyFTS.models.multivariate.grid 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

build(data)[source]

Perform the partitioning of the Universe of Discourse

Parameters

data – training data

Returns

defuzzyfy(values, mode='both')[source]
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

prune()[source]

pyFTS.models.multivariate.mvfts module

pyFTS.models.multivariate.wmvfts module

pyFTS.models.multivariate.cmvfts module

pyFTS.models.multivariate.granular module