@@ -604,6 +604,8 @@ class ElasticNet(LinearModel, RegressorMixin):
604
604
calculations. If set to ``'auto'`` let us decide. The Gram
605
605
matrix can also be passed as argument. For sparse input
606
606
this option is always ``True`` to preserve sparsity.
607
+ WARNING : The ``'auto'`` option is deprecated and will
608
+ be removed in 0.18.
607
609
608
610
max_iter : int, optional
609
611
The maximum number of iterations
@@ -665,7 +667,7 @@ class ElasticNet(LinearModel, RegressorMixin):
665
667
path = staticmethod (enet_path )
666
668
667
669
def __init__ (self , alpha = 1.0 , l1_ratio = 0.5 , fit_intercept = True ,
668
- normalize = False , precompute = 'auto' , max_iter = 1000 ,
670
+ normalize = False , precompute = False , max_iter = 1000 ,
669
671
copy_X = True , tol = 1e-4 , warm_start = False , positive = False ,
670
672
random_state = None , selection = 'cyclic' ):
671
673
self .alpha = alpha
@@ -708,6 +710,13 @@ def fit(self, X, y):
708
710
warnings .warn ("With alpha=0, this algorithm does not converge "
709
711
"well. You are advised to use the LinearRegression "
710
712
"estimator" , stacklevel = 2 )
713
+
714
+ if self .precompute == 'auto' :
715
+ warnings .warn ("Setting precompute to 'auto', has found to be "
716
+ "slower even when n_samples > n_features. Hence "
717
+ "it will be removed in 0.18." ,
718
+ DeprecationWarning , stacklevel = 2 )
719
+
711
720
X = check_array (X , 'csc' , dtype = np .float64 , order = 'F' , copy = self .copy_X
712
721
and self .fit_intercept )
713
722
# From now on X can be touched inplace
@@ -830,6 +839,8 @@ class Lasso(ElasticNet):
830
839
calculations. If set to ``'auto'`` let us decide. The Gram
831
840
matrix can also be passed as argument. For sparse input
832
841
this option is always ``True`` to preserve sparsity.
842
+ WARNING : The ``'auto'`` option is deprecated and will
843
+ be removed in 0.18.
833
844
834
845
max_iter : int, optional
835
846
The maximum number of iterations
@@ -880,7 +891,7 @@ class Lasso(ElasticNet):
880
891
>>> clf = linear_model.Lasso(alpha=0.1)
881
892
>>> clf.fit([[0,0], [1, 1], [2, 2]], [0, 1, 2])
882
893
Lasso(alpha=0.1, copy_X=True, fit_intercept=True, max_iter=1000,
883
- normalize=False, positive=False, precompute='auto' , random_state=None,
894
+ normalize=False, positive=False, precompute=False , random_state=None,
884
895
selection='cyclic', tol=0.0001, warm_start=False)
885
896
>>> print(clf.coef_)
886
897
[ 0.85 0. ]
@@ -906,7 +917,7 @@ class Lasso(ElasticNet):
906
917
path = staticmethod (enet_path )
907
918
908
919
def __init__ (self , alpha = 1.0 , fit_intercept = True , normalize = False ,
909
- precompute = 'auto' , copy_X = True , max_iter = 1000 ,
920
+ precompute = False , copy_X = True , max_iter = 1000 ,
910
921
tol = 1e-4 , warm_start = False , positive = False ,
911
922
random_state = None , selection = 'cyclic' ):
912
923
super (Lasso , self ).__init__ (
0 commit comments