Skip to content

Commit 5403e9f

Browse files
authored
DOC Explicitly remove support for precompute='auto' for Lasso (scikit-learn#19412)
1 parent a870f43 commit 5403e9f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

sklearn/linear_model/_coordinate_descent.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -939,12 +939,11 @@ class Lasso(ElasticNet):
939939
:class:`~sklearn.preprocessing.StandardScaler` before calling ``fit``
940940
on an estimator with ``normalize=False``.
941941
942-
precompute : 'auto', bool or array-like of shape (n_features, n_features),\
942+
precompute : bool or array-like of shape (n_features, n_features),\
943943
default=False
944944
Whether to use a precomputed Gram matrix to speed up
945-
calculations. If set to ``'auto'`` let us decide. The Gram
946-
matrix can also be passed as argument. For sparse input
947-
this option is always ``False`` to preserve sparsity.
945+
calculations. The Gram matrix can also be passed as argument.
946+
For sparse input this option is always ``False`` to preserve sparsity.
948947
949948
copy_X : bool, default=True
950949
If ``True``, X will be copied; else, it may be overwritten.

sklearn/linear_model/tests/test_coordinate_descent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,9 +813,11 @@ def test_precompute_invalid_argument():
813813
assert_raises_regex(ValueError, ".*should be.*True.*False.*auto.*"
814814
"array-like.*Got 'invalid'", clf.fit, X, y)
815815

816-
# Precompute = 'auto' is not supported for ElasticNet
816+
# Precompute = 'auto' is not supported for ElasticNet and Lasso
817817
assert_raises_regex(ValueError, ".*should be.*True.*False.*array-like.*"
818818
"Got 'auto'", ElasticNet(precompute='auto').fit, X, y)
819+
assert_raises_regex(ValueError, ".*should be.*True.*False.*array-like.*"
820+
"Got 'auto'", Lasso(precompute='auto').fit, X, y)
819821

820822

821823
def test_elasticnet_precompute_incorrect_gram():

0 commit comments

Comments
 (0)