Evolutive bugfixes

This commit is contained in:
Petrônio Cândido 2019-01-18 16:18:53 -02:00
parent dd78b7e559
commit 9936a184ef
2 changed files with 4 additions and 2 deletions

View File

@ -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):

View File

@ -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)