- Initial infrastructure for multivariate methods
This commit is contained in:
parent
1d583e8b0a
commit
0e2ea9927d
22
pyFTS/models/multivariate/FLR.py
Normal file
22
pyFTS/models/multivariate/FLR.py
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
class FLR(object):
|
||||
"""Multivariate Fuzzy Logical Relationship"""
|
||||
|
||||
def __init__(self):
|
||||
"""
|
||||
Creates a Fuzzy Logical Relationship
|
||||
:param LHS: Left Hand Side fuzzy set
|
||||
:param RHS: Right Hand Side fuzzy set
|
||||
"""
|
||||
self.LHS = {}
|
||||
self.RHS = None
|
||||
|
||||
def set_lhs(self,var,set):
|
||||
self.LHS[var] = set
|
||||
|
||||
def set_rhs(self, set):
|
||||
self.RHS = set
|
||||
|
||||
def __str__(self):
|
||||
return str([k.name for k in self.LHS]) + " -> " + self.RHS.name
|
0
pyFTS/models/multivariate/__init__.py
Normal file
0
pyFTS/models/multivariate/__init__.py
Normal file
26
pyFTS/models/multivariate/common.py
Normal file
26
pyFTS/models/multivariate/common.py
Normal file
@ -0,0 +1,26 @@
|
||||
from pyFTS.common import fts
|
||||
|
||||
|
||||
class Variable:
|
||||
def __init__(self,name, **kwargs):
|
||||
self.name = name
|
||||
self.alias = kwargs.get('alias', self.name)
|
||||
self.data_label = kwargs.get('alias', self.name)
|
||||
self.partitioner = kwargs.get('partitioner',None)
|
||||
self.type = kwargs.get('type', 'common')
|
||||
self.transformation = kwargs.get('transformation', None)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class MVFTS(fts.FTS):
|
||||
def __init__(self, name, **kwargs):
|
||||
super(MVFTS, self).__init__(1, name, **kwargs)
|
||||
self.explanatory_variables = []
|
||||
self.target_variable = None
|
||||
|
||||
def append_variable(self, var):
|
||||
self.explanatory_variables.append(var)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user