Skip to content

Commit 2fcbab6

Browse files
fixed reporting of singularity capture bug
1 parent 64ad498 commit 2fcbab6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

batchglm/train/numpy/base_glm/estimator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def iwls_step(
290290
invertible = np.where(np.linalg.cond(a, p=None) < 1 / sys.float_info.epsilon)[0]
291291
delta_theta[:, idx_update[invertible]] = np.linalg.solve(a[invertible], b[invertible]).T
292292
if invertible.shape[0] < len(idx_update):
293-
print("caught %i linalg singular matrix errors" % len(idx_update) - invertible.shape[0])
293+
print("caught %i linalg singular matrix errors" % (len(idx_update) - invertible.shape[0]))
294294
# Via np.linalg.lsts:
295295
#delta_theta[:, idx_update] = np.concatenate([
296296
# np.expand_dims(np.linalg.lstsq(a[i, :, :], b[i, :])[0], axis=-1)

0 commit comments

Comments
 (0)