From f9d6538baea0d4a86baa5fef99d2f86102817598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=C3=B4nio=20C=C3=A2ndido?= Date: Mon, 18 Jun 2018 13:15:34 -0300 Subject: [PATCH] Util.plot_rules bugfix --- pyFTS/common/Util.py | 12 +++++++++--- pyFTS/models/nonstationary/cvfts.py | 4 ---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pyFTS/common/Util.py b/pyFTS/common/Util.py index 1c2ca2b..a0ab700 100644 --- a/pyFTS/common/Util.py +++ b/pyFTS/common/Util.py @@ -10,10 +10,11 @@ import numpy as np def plot_rules(model, size=[5, 5], axis=None, rules_by_axis=None, columns=1): if axis is None and rules_by_axis is None: - fig, axis = plt.subplots(nrows=1, ncols=1, figsize=size) + rows = 1 elif axis is None and rules_by_axis is not None: rows = (((len(model.flrgs.keys())//rules_by_axis)) // columns)+1 - fig, axis = plt.subplots(nrows=rows, ncols=columns, figsize=size) + + fig, axis = plt.subplots(nrows=rows, ncols=columns, figsize=size) if rules_by_axis is None: draw_sets_on_axis(axis, model, size) @@ -31,7 +32,12 @@ def plot_rules(model, size=[5, 5], axis=None, rules_by_axis=None, columns=1): colcount = (ct // rules_by_axis) % columns rowcount = (ct // rules_by_axis) // columns - ax = axis[rowcount, colcount] if columns > 1 else axis[rowcount] + if rows > 1 and columns > 1: + ax = axis[rowcount, colcount] + elif columns > 1: + ax = axis[rowcount] + else: + ax = axis if ct % rules_by_axis == 0: draw_sets_on_axis(ax, model, size) diff --git a/pyFTS/models/nonstationary/cvfts.py b/pyFTS/models/nonstationary/cvfts.py index 334eba4..e7d155e 100644 --- a/pyFTS/models/nonstationary/cvfts.py +++ b/pyFTS/models/nonstationary/cvfts.py @@ -69,10 +69,6 @@ class ConditionalVarianceFTS(hofts.HighOrderFTS): self.forecasts = self.forecasts[-self.memory_window:] self.inputs = np.array(ndata[-self.memory_window:]).tolist() - print(self.mean_residual) - print(self.variance_residual) - print([self.original_min,self.original_max]) - def generate_flrg(self, flrs, **kwargs): for flr in flrs: