From 9ad5af49a43c1e2b09df5284e2d6a04d912c7028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=C3=B4nio=20C=C3=A2ndido=20de=20Lima=20e=20Silva?= Date: Tue, 18 Oct 2016 10:09:36 -0200 Subject: [PATCH] =?UTF-8?q?Padroniza=C3=A7=C3=A3o=20dos=20nomes=20das=20fu?= =?UTF-8?q?n=C3=A7=C3=B5es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chen.py | 4 ++-- fts.py | 8 ++++---- hwang.py | 8 ++++---- ismailefendi.py | 4 ++-- sadaei.py | 4 ++-- sfts.py | 8 ++++---- yu.py | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/chen.py b/chen.py index 2781b48..0efe40b 100644 --- a/chen.py +++ b/chen.py @@ -22,7 +22,7 @@ class ConventionalFTS(fts.FTS): def __init__(self,name): super(ConventionalFTS, self).__init__(1,name) - def defuzzy(self,data): + def forecast(self,data): actual = self.fuzzy(data) @@ -40,7 +40,7 @@ class ConventionalFTS(fts.FTS): return denom/count - def learn(self, data, sets): + def train(self, data, sets): last = {"fuzzyset":"", "membership":0.0} actual = {"fuzzyset":"", "membership":0.0} diff --git a/fts.py b/fts.py index c4cd802..7def69a 100644 --- a/fts.py +++ b/fts.py @@ -18,17 +18,17 @@ class FTS: return best - def defuzzy(self,data): + def forecast(self,data): pass - def learn(self, data, sets): + def train(self, data, sets): pass def predict(self,data): - return self.defuzzy(data) + return self.forecast(data) def predictDiff(self,data,t): - return data[t] + self.defuzzy(data[t-1]-data[t]) + return data[t] + self.forecast(data[t-1]-data[t]) def __str__(self): tmp = self.name + ":\n" diff --git a/hwang.py b/hwang.py index 4ae777b..42dcfea 100644 --- a/hwang.py +++ b/hwang.py @@ -5,7 +5,7 @@ class HighOrderFTS(fts.FTS): def __init__(self,order,name): super(HighOrderFTS, self).__init__(order,name) - def defuzzy(self,data,t): + def forecast(self,data,t): cn = np.array([0.0 for k in range(len(self.sets))]) ow = np.array([[0.0 for k in range(len(self.sets))] for z in range(self.order-1)]) rn = np.array([[0.0 for k in range(len(self.sets))] for z in range(self.order-1)]) @@ -27,11 +27,11 @@ class HighOrderFTS(fts.FTS): return out / count - def learn(self, data, sets): + def train(self, data, sets): self.sets = sets def predict(self,data,t): - return self.defuzzy(data,t) + return self.forecast(data,t) def predictDiff(self,data,t): - return data[t] + self.defuzzy(common.differential(data),t) + return data[t] + self.forecast(common.differential(data),t) diff --git a/ismailefendi.py b/ismailefendi.py index 7027e37..e3fde55 100644 --- a/ismailefendi.py +++ b/ismailefendi.py @@ -31,7 +31,7 @@ class ImprovedWeightedFTS(fts.FTS): def __init__(self,name): super(ImprovedWeightedFTS, self).__init__(1,name) - def defuzzy(self,data): + def forecast(self,data): actual = self.fuzzy(data) if actual["fuzzyset"] not in self.flrgs: return self.sets[actual["fuzzyset"]].centroid @@ -39,7 +39,7 @@ class ImprovedWeightedFTS(fts.FTS): mi = np.array([self.sets[s].centroid for s in flrg.RHS.keys()]) return mi.dot( flrg.weights() ) - def learn(self, data, sets): + def train(self, data, sets): last = {"fuzzyset":"", "membership":0.0} actual = {"fuzzyset":"", "membership":0.0} diff --git a/sadaei.py b/sadaei.py index 5676978..60b4d1f 100644 --- a/sadaei.py +++ b/sadaei.py @@ -34,7 +34,7 @@ class ExponentialyWeightedFTS(fts.FTS): def __init__(self,name): super(ExponentialyWeightedFTS, self).__init__(1,name) - def defuzzy(self,data): + def forecast(self,data): actual = self.fuzzy(data) @@ -47,7 +47,7 @@ class ExponentialyWeightedFTS(fts.FTS): return mi.dot( flrg.weights() ) - def learn(self, data, sets): + def train(self, data, sets): last = {"fuzzyset":"", "membership":0.0} actual = {"fuzzyset":"", "membership":0.0} diff --git a/sfts.py b/sfts.py index 3891d45..8b4a1a5 100644 --- a/sfts.py +++ b/sfts.py @@ -21,9 +21,9 @@ class SeasonalFLRG(fts.FTS): class SeasonalFTS(fts.FTS): def __init__(self,name): - super(WeightedFTS, self).__init__(1,name) + super(SeasonalFTS, self).__init__(1,name) - def defuzzy(self,data): + def forecast(self,data): actual = self.fuzzy(data) @@ -36,7 +36,7 @@ class SeasonalFTS(fts.FTS): return mi.dot( flrg.weights() ) - def learn(self, data, sets): + def train(self, data, sets): last = {"fuzzyset":"", "membership":0.0} actual = {"fuzzyset":"", "membership":0.0} @@ -50,7 +50,7 @@ class SeasonalFTS(fts.FTS): if count > self.order: if last["fuzzyset"] not in self.flrgs: - self.flrgs[last["fuzzyset"]] = WeightedFLRG(last["fuzzyset"]) + self.flrgs[last["fuzzyset"]] = SeasonalFLRG(last["fuzzyset"]) self.flrgs[last["fuzzyset"]].append(actual["fuzzyset"]) count = count + 1 diff --git a/yu.py b/yu.py index 47ee4b3..55f89e0 100644 --- a/yu.py +++ b/yu.py @@ -32,7 +32,7 @@ class WeightedFTS(fts.FTS): def __init__(self,name): super(WeightedFTS, self).__init__(1,name) - def defuzzy(self,data): + def forecast(self,data): actual = self.fuzzy(data) @@ -45,7 +45,7 @@ class WeightedFTS(fts.FTS): return mi.dot( flrg.weights() ) - def learn(self, data, sets): + def train(self, data, sets): last = {"fuzzyset":"", "membership":0.0} actual = {"fuzzyset":"", "membership":0.0}