Merge branch 'master' of https://github.com/petroniocandido/pyFTS
This commit is contained in:
commit
52544aca88
@ -20,6 +20,10 @@ class HighOrderFTS(fts.FTS):
|
|||||||
|
|
||||||
def forecast(self, ndata, **kwargs):
|
def forecast(self, ndata, **kwargs):
|
||||||
|
|
||||||
|
if 'order' in kwargs:
|
||||||
|
self.order = kwargs.get('order',self.order)
|
||||||
|
self.max_lag = self.order
|
||||||
|
|
||||||
if self.sets == None:
|
if self.sets == None:
|
||||||
self.sets = self.partitioner.sets
|
self.sets = self.partitioner.sets
|
||||||
ordered_sets = self.partitioner.ordered_sets
|
ordered_sets = self.partitioner.ordered_sets
|
||||||
|
@ -82,13 +82,17 @@ class ContextualMultiSeasonalFTS(sfts.SeasonalFTS):
|
|||||||
|
|
||||||
for k in np.arange(0, len(data)):
|
for k in np.arange(0, len(data)):
|
||||||
|
|
||||||
flrg = self.flrgs[str(index[k])]
|
if str(index[k]) in self.flrgs:
|
||||||
|
|
||||||
d = FuzzySet.get_fuzzysets(ndata[k], self.sets, ordered_sets, alpha_cut=self.alpha_cut)
|
flrg = self.flrgs[str(index[k])]
|
||||||
|
|
||||||
mp = self.get_midpoints(flrg, d)
|
d = FuzzySet.get_fuzzysets(ndata[k], self.sets, ordered_sets, alpha_cut=self.alpha_cut)
|
||||||
|
|
||||||
ret.append(sum(mp) / len(mp))
|
mp = self.get_midpoints(flrg, d)
|
||||||
|
|
||||||
|
ret.append(sum(mp) / len(mp))
|
||||||
|
else:
|
||||||
|
ret.append(np.nan)
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user