From 2682aace85245311388190e6dfc1791786b9eda9 Mon Sep 17 00:00:00 2001 From: BalzaniEdoardo Date: Wed, 18 Dec 2024 12:49:46 -0500 Subject: [PATCH] nan mean fix --- src/nemos/initialize_regressor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nemos/initialize_regressor.py b/src/nemos/initialize_regressor.py index 2fd5a0ee..15d0c11f 100644 --- a/src/nemos/initialize_regressor.py +++ b/src/nemos/initialize_regressor.py @@ -81,7 +81,7 @@ def initialize_intercept_matching_mean_rate( # return inverse if analytical solution is available analytical_inv = INVERSE_FUNCS.get(inverse_link_function, None) - means = jnp.atleast_1d(jnp.mean(y, axis=0)) + means = jnp.atleast_1d(jnp.nanmean(y, axis=0)) if analytical_inv: out = analytical_inv(means) if jnp.any(jnp.isnan(out)):