From b1b2dbd387a7cf32187398d901e72188f7a9ca89 Mon Sep 17 00:00:00 2001 From: lbittarello Date: Mon, 11 Nov 2024 08:15:49 +0000 Subject: [PATCH] Patch --- CHANGELOG.rst | 2 +- src/glum/_glm.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e8037610..e5a88a91 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,7 +7,7 @@ Changelog ========= -3.1.0 - 2024-11-08 +3.1.0 - 2024-11-11 ------------------ **New features:** diff --git a/src/glum/_glm.py b/src/glum/_glm.py index d5a1a36c..2a9dde21 100644 --- a/src/glum/_glm.py +++ b/src/glum/_glm.py @@ -452,7 +452,7 @@ def _one_over_var_inf_to_val(arr: np.ndarray, val: float) -> np.ndarray: If values are zeros, return val. """ - zeros = np.where(np.abs(arr) < np.sqrt(np.finfo(arr.dtype).eps)) + zeros = np.where(np.abs(arr) < 10 * np.sqrt(np.finfo(arr.dtype).eps)) with np.errstate(divide="ignore"): one_over = 1 / arr one_over[zeros] = val @@ -1104,7 +1104,7 @@ def _solve( family=self._family_instance, link=self._link_instance, max_iter=max_iter, - max_inner_iter=self.max_inner_iter, + max_inner_iter=getattr(self, "max_inner_iter", 100_000), gradient_tol=self._gradient_tol, step_size_tol=self.step_size_tol, fixed_inner_tol=fixed_inner_tol,