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)