diff --git a/content/demo.html b/content/demo.html index ca4a976..c0a7698 100644 --- a/content/demo.html +++ b/content/demo.html @@ -80,10 +80,10 @@

CDAO AI Assurance Portal

- M. K. + MK
-

I'm testing out this simple logistic regression model but it does not work, how can I fix that?

+

Hi, I'm following a tutorial on scikit-learn and having trouble with one of the exercises. I'm trying to build a simple logistic regression model but keep getting a ValueError about the solver not supporting the l1 penalty and I'm not sure how to fix it. Any help would be appreciated. Thanks in advance!

from sklearn import datasets from sklearn.linear_model import LogisticRegression @@ -101,10 +101,10 @@

CDAO AI Assurance Portal

- D. P. + DP
-

You need to change solver, by passing an argument like this solver="saga", see below:

+

Hi MK, welcome to the portal. I would be glad to help you out. This is actually a common issue with scikit-learn and isn't very well documented. By default LogisticalRegression uses the lbfgs solver that only supports the l2 penalty. If you want to use l1 you will need to use a different solver. I pasted some example code below that uses the saga solver (i.e. solver="saga")

from sklearn import datasets from sklearn.linear_model import LogisticRegression