From 9936a184ef3fe884c851d150a720ed740552bc32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=C3=B4nio=20C=C3=A2ndido?= Date: Fri, 18 Jan 2019 16:18:53 -0200 Subject: [PATCH] Evolutive bugfixes --- pyFTS/benchmarks/Measures.py | 2 +- pyFTS/hyperparam/Evolutionary.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyFTS/benchmarks/Measures.py b/pyFTS/benchmarks/Measures.py index 310d72d..94e55bb 100644 --- a/pyFTS/benchmarks/Measures.py +++ b/pyFTS/benchmarks/Measures.py @@ -68,7 +68,7 @@ def mape(targets, forecasts): targets = np.array(targets) if isinstance(forecasts, list): forecasts = np.array(forecasts) - return np.mean(np.abs((targets - forecasts) / targets)) * 100 + return np.mean(np.abs(np.divide((targets - forecasts), targets))) * 100 def smape(targets, forecasts, type=2): diff --git a/pyFTS/hyperparam/Evolutionary.py b/pyFTS/hyperparam/Evolutionary.py index 452e08e..13a0765 100644 --- a/pyFTS/hyperparam/Evolutionary.py +++ b/pyFTS/hyperparam/Evolutionary.py @@ -142,7 +142,9 @@ def evaluate(dataset, individual, **kwargs): if model is None: raise Exception("Phenotype returned None") - rmse, _, _ = Measures.get_point_statistics(test, model) + forecasts = model.predict(test) + + rmse = Measures.rmse(test[model.order:], forecasts[:-1]) #.get_point_statistics(test, model) lengths.append(len(model)) results.append(rmse)