From 307836f2619db58b652e02096f6a3e9a48ba23f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=C3=B4nio=20C=C3=A2ndido=20de=20Lima=20e=20Silva?= Date: Thu, 1 Nov 2018 17:17:24 -0300 Subject: [PATCH 1/2] Shortname property on Retrainer --- pyFTS/models/incremental/Retrainer.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pyFTS/models/incremental/Retrainer.py b/pyFTS/models/incremental/Retrainer.py index 044c2b6..8f36c7d 100644 --- a/pyFTS/models/incremental/Retrainer.py +++ b/pyFTS/models/incremental/Retrainer.py @@ -36,6 +36,13 @@ class Retrainer(fts.FTS): """The batch interval between each retraining""" self.is_high_order = True self.uod_clip = False + + @property + def shortname(self): + if self.model is None: + self.model = self.fts_method() + + return self.model.shortname def train(self, data, **kwargs): self.partitioner = self.partitioner_method(data=data, **self.partitioner_params) @@ -75,4 +82,4 @@ class Retrainer(fts.FTS): :return: number of rules """ - return len(self.model) \ No newline at end of file + return len(self.model) From b2a889a73ed971d9c5eb792a405ff9c931f7f9f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=C3=B4nio=20C=C3=A2ndido=20de=20Lima=20e=20Silva?= Date: Thu, 1 Nov 2018 17:54:53 -0300 Subject: [PATCH 2/2] Bugfix on Retrainer.shortname --- pyFTS/models/incremental/Retrainer.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pyFTS/models/incremental/Retrainer.py b/pyFTS/models/incremental/Retrainer.py index 8f36c7d..d6d8604 100644 --- a/pyFTS/models/incremental/Retrainer.py +++ b/pyFTS/models/incremental/Retrainer.py @@ -36,18 +36,12 @@ class Retrainer(fts.FTS): """The batch interval between each retraining""" self.is_high_order = True self.uod_clip = False - - @property - def shortname(self): - if self.model is None: - self.model = self.fts_method() - - return self.model.shortname def train(self, data, **kwargs): self.partitioner = self.partitioner_method(data=data, **self.partitioner_params) self.model = self.fts_method(partitioner=self.partitioner, order=self.order, **self.fts_params) self.model.fit(data, **kwargs) + self.shortname = self.model.shortname def forecast(self, data, **kwargs): l = len(data)