From 933e1a1c844d34f28985ec83ef4cabb53e60fedc Mon Sep 17 00:00:00 2001 From: Alexandre Gramfort Date: Thu, 19 Dec 2019 13:21:50 +0100 Subject: [PATCH 1/2] change logreg solver in plot_logistic_path --- examples/linear_model/plot_logistic_path.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/linear_model/plot_logistic_path.py b/examples/linear_model/plot_logistic_path.py index 79b5522575eb0..589811b1e8f91 100644 --- a/examples/linear_model/plot_logistic_path.py +++ b/examples/linear_model/plot_logistic_path.py @@ -55,9 +55,10 @@ print("Computing regularization path ...") start = time() -clf = linear_model.LogisticRegression(penalty='l1', solver='saga', +clf = linear_model.LogisticRegression(penalty='l1', solver='liblinear', tol=1e-6, max_iter=int(1e6), - warm_start=True) + warm_start=True, + intercept_scaling=10000.) coefs_ = [] for c in cs: clf.set_params(C=c) From 62e9fc96c1a1a7fa0aaea48eed7cdfc4e186ebfc Mon Sep 17 00:00:00 2001 From: Alexandre Gramfort Date: Sat, 21 Dec 2019 18:43:13 +0100 Subject: [PATCH 2/2] remove ref to SAGA --- examples/linear_model/plot_logistic_path.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/linear_model/plot_logistic_path.py b/examples/linear_model/plot_logistic_path.py index 589811b1e8f91..7aead065f3445 100644 --- a/examples/linear_model/plot_logistic_path.py +++ b/examples/linear_model/plot_logistic_path.py @@ -14,7 +14,7 @@ coefficients are exactly 0. When regularization gets progressively looser, coefficients can get non-zero values one after the other. -Here we choose the SAGA solver because it can efficiently optimize for the +Here we choose the liblinear solver because it can efficiently optimize for the Logistic Regression loss with a non-smooth, sparsity inducing l1 penalty. Also note that we set a low value for the tolerance to make sure that the model