IFTS now heritages from WHOFTS
This commit is contained in:
parent
4b8b0243d7
commit
838140d0f2
@ -66,8 +66,35 @@ class WeightedHighOrderFLRG(flrg.FLRG):
|
|||||||
return self.w
|
return self.w
|
||||||
|
|
||||||
def get_midpoint(self, sets):
|
def get_midpoint(self, sets):
|
||||||
mp = np.array([sets[c].centroid for c in self.RHS.keys()])
|
if self.midpoint is None:
|
||||||
return mp.dot(self.weights())
|
mp = np.array([sets[c].centroid for c in self.RHS.keys()])
|
||||||
|
self.midpoint = mp.dot(self.weights())
|
||||||
|
|
||||||
|
return self.midpoint
|
||||||
|
|
||||||
|
def get_lower(self, sets):
|
||||||
|
"""
|
||||||
|
Returns the lower bound value for the RHS fuzzy sets
|
||||||
|
|
||||||
|
:param sets: fuzzy sets
|
||||||
|
:return: lower bound value
|
||||||
|
"""
|
||||||
|
if self.lower is None:
|
||||||
|
lw = np.array([sets[s].lower for s in self.RHS.keys()])
|
||||||
|
self.lower = lw.dot(self.weights())
|
||||||
|
return self.lower
|
||||||
|
|
||||||
|
def get_upper(self, sets):
|
||||||
|
"""
|
||||||
|
Returns the upper bound value for the RHS fuzzy sets
|
||||||
|
|
||||||
|
:param sets: fuzzy sets
|
||||||
|
:return: upper bound value
|
||||||
|
"""
|
||||||
|
if self.upper is None:
|
||||||
|
up = np.array([sets[s].upper for s in self.RHS.keys()])
|
||||||
|
self.upper = up.dot(self.weights())
|
||||||
|
return self.upper
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
_str = ""
|
_str = ""
|
||||||
|
@ -13,7 +13,7 @@ from pyFTS.common import FuzzySet, FLR, fts, tree
|
|||||||
from pyFTS.models import hofts
|
from pyFTS.models import hofts
|
||||||
|
|
||||||
|
|
||||||
class IntervalFTS(hofts.HighOrderFTS):
|
class IntervalFTS(hofts.WeightedHighOrderFTS):
|
||||||
"""
|
"""
|
||||||
High Order Interval Fuzzy Time Series
|
High Order Interval Fuzzy Time Series
|
||||||
"""
|
"""
|
||||||
@ -43,9 +43,9 @@ class IntervalFTS(hofts.HighOrderFTS):
|
|||||||
if len(flrg.LHS) > 0:
|
if len(flrg.LHS) > 0:
|
||||||
if flrg.get_key() in self.flrgs:
|
if flrg.get_key() in self.flrgs:
|
||||||
tmp = self.flrgs[flrg.get_key()]
|
tmp = self.flrgs[flrg.get_key()]
|
||||||
ret = tmp.get_lower(self.sets)
|
ret = tmp.get_lower(self.partitioner.sets)
|
||||||
else:
|
else:
|
||||||
ret = self.sets[flrg.LHS[-1]].lower
|
ret = self.partitioner.sets[flrg.LHS[-1]].lower
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def get_sequence_membership(self, data, fuzzySets):
|
def get_sequence_membership(self, data, fuzzySets):
|
||||||
|
Loading…
Reference in New Issue
Block a user