From acc8977cb58707095a9aae0f6f21dc2aa8797e64 Mon Sep 17 00:00:00 2001 From: Misato Tanaka Date: Fri, 24 Oct 2025 21:01:09 +0900 Subject: [PATCH] Handle NaN values in Y normalization Since the results of Y normalization can contain not only `inf` but also `nan`, I added a process to replace them with 0. --- bdpy/ml/learning.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bdpy/ml/learning.py b/bdpy/ml/learning.py index d83a6ff7..f80dea9e 100644 --- a/bdpy/ml/learning.py +++ b/bdpy/ml/learning.py @@ -362,6 +362,7 @@ def run(self): y_norm = self.Y_normalize['std'] Y = (Y - y_mean) / y_norm Y[np.isinf(Y)] = 0 + Y[np.isnan(Y)] = 0 if not self.Y_sort is None: print('Sorting Y')