10000 Pass `check_input` to `_pre_fit` in `ElasticNet` · scikit-learn/scikit-learn@9a59e73 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9a59e73

Browse files
committed
Pass check_input to _pre_fit in ElasticNet
If we want to skip `check_array` calls in `ElasticNet` or `Lasso`, we should disable them in `_pre_fit` as well. Otherwise we will still have to do the same checks that we skipped previously.
1 parent f21ba6f commit 9a59e73

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sklearn/linear_model/coordinate_descent.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def enet_path(X, y, l1_ratio=0.5, eps=1e-3, n_alphas=100, alphas=None,
418418
if check_input:
419419
X, y, X_offset, y_offset, X_scale, precompute, Xy = \
420420
_pre_fit(X, y, Xy, precompute, normalize=False,
421-
fit_intercept=False, copy=False)
421+
fit_intercept=False, copy=False, check_input=check_input)
422422
if alphas is None:
423423
# No need to normalize of fit_intercept: it has been done
424424
# above
@@ -717,7 +717,8 @@ def fit(self, X, y, check_input=True):
717717
should_copy = self.copy_X and not X_copied
718718
X, y, X_offset, y_offset, X_scale, precompute, Xy = \
719719
_pre_fit(X, y, None, self.precompute, self.normalize,
720-
self.fit_intercept, copy=should_copy)
720+
self.fit_intercept, copy=should_copy,
721+
check_input=check_input)
721722
if y.ndim == 1:
722723
y = y[:, np.newaxis]
723724
if Xy is not None and Xy.ndim == 1:

0 commit comments

Comments
 (0)
0