From 722055166bb94cdafa205a7c25110b0f493edd84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20Kir=C3=A1ly?= Date: Sun, 27 Aug 2023 01:31:50 +0100 Subject: [PATCH] [BUG] fix missing `np.abs` in `ResidualDouble` (#47) This PR fixes an unreported bug, a missing `np.abs` in `ResidualDouble`. Acknowledging that the estimator does not have all its features migrated yet, but the abs operator was missing. Tests did not catch this as this would just result in bad predictions. --- skpro/regression/residual.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/skpro/regression/residual.py b/skpro/regression/residual.py index be3951e08..72f3552ad 100644 --- a/skpro/regression/residual.py +++ b/skpro/regression/residual.py @@ -4,6 +4,7 @@ __author__ = ["fkiraly"] +import numpy as np import pandas as pd from sklearn import clone @@ -104,7 +105,7 @@ def _fit(self, X, y): y = y.values.flatten() est.fit(X, y) - resids = y - est.predict(X) + resids = np.abs(y - est.predict(X)) resids = resids.flatten()