From 409f9d5b6bd4a502081aece5b29f32f9996f4cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=C3=B4nio=20C=C3=A2ndido?= Date: Thu, 7 Jun 2018 12:51:55 -0300 Subject: [PATCH] FTS.predict bugfix for multivariate FTS --- pyFTS/common/fts.py | 4 ++-- pyFTS/tests/multivariate.py | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pyFTS/common/fts.py b/pyFTS/common/fts.py index 37cf196..4b11206 100644 --- a/pyFTS/common/fts.py +++ b/pyFTS/common/fts.py @@ -76,8 +76,8 @@ class FTS(object): else: ndata = self.apply_transformations(data) - if self.uod_clip: - ndata = np.clip(ndata, self.original_min, self.original_max) + if self.uod_clip: + ndata = np.clip(ndata, self.original_min, self.original_max) if 'distributed' in kwargs: distributed = kwargs.pop('distributed') diff --git a/pyFTS/tests/multivariate.py b/pyFTS/tests/multivariate.py index e0658a6..02db63e 100644 --- a/pyFTS/tests/multivariate.py +++ b/pyFTS/tests/multivariate.py @@ -7,7 +7,7 @@ from pyFTS.common import Transformations from pyFTS.data import SONDA df = SONDA.get_dataframe() train = df.iloc[0:578241] #three years -#test = df.iloc[1572480:2096640] #ears +test = df.iloc[1572480:2096640] #one year del df from pyFTS.partitioners import Grid, Util as pUtil @@ -58,8 +58,10 @@ model1.target_variable = vavg #model.fit(train, num_batches=60, save=True, batch_save=True, file_path='mvfts_sonda') -model1.fit(train, num_batches=200, save=True, batch_save=True, file_path='mvfts_sonda', distributed=True, - nodes=['192.168.0.110'], batch_save_interval=10) +#model1.fit(train, num_batches=200, save=True, batch_save=True, file_path='mvfts_sonda', distributed=False, +# nodes=['192.168.0.110'], batch_save_interval=10) -#model = Util.load_obj('mvfts_sonda') \ No newline at end of file +model = Util.load_obj('mvfts_sonda') + +forecasts = model.predict(test) \ No newline at end of file