From 043c28d4805d322f4825bff54eca0f52d17a9b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=C3=B4nio=20C=C3=A2ndido=20de=20Lima=20e=20Silva?= Date: Tue, 3 Jul 2018 18:57:00 -0300 Subject: [PATCH 1/2] Bugfix in cmsfts --- pyFTS/models/seasonal/cmsfts.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pyFTS/models/seasonal/cmsfts.py b/pyFTS/models/seasonal/cmsfts.py index 45302cc..08d0e80 100644 --- a/pyFTS/models/seasonal/cmsfts.py +++ b/pyFTS/models/seasonal/cmsfts.py @@ -81,14 +81,18 @@ class ContextualMultiSeasonalFTS(sfts.SeasonalFTS): ndata = self.indexer.get_data(data) for k in np.arange(0, len(data)): + + if str(index[k]) in self.flrgs: - flrg = self.flrgs[str(index[k])] + flrg = self.flrgs[str(index[k])] - d = FuzzySet.get_fuzzysets(ndata[k], self.sets, ordered_sets, alpha_cut=self.alpha_cut) + d = FuzzySet.get_fuzzysets(ndata[k], self.sets, ordered_sets, alpha_cut=self.alpha_cut) - mp = self.get_midpoints(flrg, d) + mp = self.get_midpoints(flrg, d) - ret.append(sum(mp) / len(mp)) + ret.append(sum(mp) / len(mp)) + else: + ret.append(np.nan) return ret From fd9b823d8e13d497c577d002e0e42e3477f5a083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=C3=B4nio=20C=C3=A2ndido=20de=20Lima=20e=20Silva?= Date: Thu, 5 Jul 2018 22:00:42 -0300 Subject: [PATCH 2/2] Bugfix in hwang --- pyFTS/models/hwang.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyFTS/models/hwang.py b/pyFTS/models/hwang.py index 6f862d7..dbfb050 100644 --- a/pyFTS/models/hwang.py +++ b/pyFTS/models/hwang.py @@ -19,6 +19,10 @@ class HighOrderFTS(fts.FTS): self.detail = "Hwang" 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: self.sets = self.partitioner.sets @@ -57,4 +61,4 @@ class HighOrderFTS(fts.FTS): return ret def train(self, data, **kwargs): - pass \ No newline at end of file + pass