# Feature selection with L1 regularization on sklearn's LogisticRegression

I'm using sklearn's LogisticRegression with penaly=l1 (lasso regularization, as opposed to ridge regularization l2). Lasso is causing the optimization function to do implicit feature selection by setting some of the feature weights to zero (as opposed to ridge regularization, which will preserve all features with some non zero weight). Is it possible to extract this weight information (feature selection) from sklearn somehow?

• Thanks. So the magic attribute is coef_, called on the LogisticRegression object after fitting, eg. alg.coef_. Sep 24, 2016 at 18:41