Skip to content

Commit 5c80870

Browse files
implement suggested change from Badr in skglm/cv.py
Co-authored-by: Badr MOUFAD <[email protected]>
1 parent a96899e commit 5c80870

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

skglm/cv.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,8 @@ def _solve_fold(k, train, test, alpha, l1, w_init):
151151
pen_kwargs = {k: v for k, v in self.penalty.__dict__.items()
152152
if k not in ("alpha", "l1_ratio")}
153153
if has_l1_ratio:
154-
best_penalty = type(self.penalty)(
155-
alpha=self.alpha_, l1_ratio=self.l1_ratio_, **pen_kwargs
156-
)
157-
else:
158-
best_penalty = type(self.penalty)(
159-
alpha=self.alpha_, **pen_kwargs
160-
)
154+
pen_kwargs["l1_ratio_"] = self.l1_ratio_
155+
best_penalty = type(self.penalty)(alpha=self.alpha_, **pen_kwargs)
161156
best_estimator = GeneralizedLinearEstimator(
162157
datafit=self.datafit,
163158
penalty=best_penalty,

0 commit comments

Comments
 (0)