Skip to content

Commit 2e515ef

Browse files
authored
ENH raise error when passing Cox to GLE (#182)
1 parent c7d0465 commit 2e515ef

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

skglm/estimators.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ def fit(self, X, y):
237237
n_iters : array, shape (n_alphas,), optional
238238
The number of iterations along the path. If return_n_iter is set to `True`.
239239
"""
240+
# TODO: add support for Cox datafit in `_glm_fit`
241+
# `_glm_fit` interpret `Cox` as a multitask datafit which breaks down solvers
242+
if isinstance(self.datafit, Cox):
243+
raise ValueError(
244+
"`GeneralizedLinearEstimator` doesn't currently support "
245+
"`Cox` datafit"
246+
)
247+
240248
self.penalty = self.penalty if self.penalty else L1(1.)
241249
self.datafit = self.datafit if self.datafit else Quadratic()
242250
self.solver = self.solver if self.solver else AndersonCD()

0 commit comments

Comments
 (0)