0

I know this one: Find p-value (significance) in scikit-learn LinearRegression

I've never extended a class in python and I'm not sure whether this is the right solution for me (I've tried but getting a TypeError). I'm calculating an elastic net regression with scikitlearn. Since my regressors are in a sparse matrix, Statsmodels package is not an option. Thus, I'm looking for a reliable solution to calculate p-values for each coefficient in my elastic net regression. Is there a solution given by scikitlearn nowadays?

cian
  • 191
  • 2
  • 11
  • To my knowledge, you generate p-values from using a statistical test against 2 different distributions. I don't know if you can do that with the coefs in sklearn? Unless you had a bunch of models with coefficients for each attribute maybe but I don't think that's what you're going for. – O.rka Feb 26 '18 at 20:43
  • 2
    p-values for lasso or elastic net are "non-trivial" and also not yet available in statsmodels. Research in this area is still recent or ongoing. https://stats.stackexchange.com/questions/45449/when-using-glmnet-how-to-report-p-value-significance-to-claim-significance-of-pr . For lasso there is https://github.com/selective-inference/Python-software – Josef Feb 26 '18 at 21:02
  • @user333700 thanks a lot, actually I didn't even think about that it may not work statistically wise but just assumed it's a missing feature of scikitlearn. Thank you for the great link! – cian Feb 28 '18 at 09:48

0 Answers0