Skip to content

Commit 6376620

Browse files
ENH - implement intercept update for Poisson and Gamma datafits (#189)
Co-authored-by: Badr MOUFAD <[email protected]>
1 parent a9f88f6 commit 6376620

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

skglm/datafits/single_task.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ def gradient_scalar_sparse(self, X_data, X_indptr, X_indices, y, Xw, j):
498498
grad += X_data[i] * (np.exp(Xw[idx_i]) - y[idx_i])
499499
return grad / len(y)
500500

501-
def intercept_update_self(self, y, Xw):
502-
pass
501+
def intercept_update_step(self, y, Xw):
502+
return np.sum(self.raw_grad(y, Xw))
503503

504504

505505
class Gamma(BaseDatafit):
@@ -555,8 +555,8 @@ def gradient_scalar(self, X, y, w, Xw, j):
555555
def gradient_scalar_sparse(self, X_data, X_indptr, X_indices, y, Xw, j):
556556
pass
557557

558-
def intercept_update_self(self, y, Xw):
559-
pass
558+
def intercept_update_step(self, y, Xw):
559+
return np.sum(self.raw_grad(y, Xw))
560560

561561

562562
class Cox(BaseDatafit):

0 commit comments

Comments
 (0)