From 8c7b78fa04c0bdcbfc094cecb056ebccb198f237 Mon Sep 17 00:00:00 2001 From: Patricio Cerda Mardini Date: Mon, 12 Jun 2023 20:49:46 -0400 Subject: [PATCH] fix numerical encoder sign none handling --- lightwood/encoder/numeric/numeric.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightwood/encoder/numeric/numeric.py b/lightwood/encoder/numeric/numeric.py index 1a1cf8b25..9c040ca43 100644 --- a/lightwood/encoder/numeric/numeric.py +++ b/lightwood/encoder/numeric/numeric.py @@ -58,7 +58,7 @@ def encode(self, data: Union[np.ndarray, pd.Series]): data = data.values if not self.positive_domain: - sign_data = np.nan_to_num(data, nan=0, posinf=0, neginf=0) + sign_data = np.nan_to_num(data.astype(float), nan=0, posinf=0, neginf=0) sign = np.vectorize(self._sign_fn, otypes=[float])(sign_data) else: sign = np.zeros(len(data))