Explore Courses Blog Tutorials Interview Questions
0 votes
in Data Science by (17.6k points)

How can I find the p-value (significance) of each coefficient?

lm = sklearn.linear_model.LinearRegression(),y)

1 Answer

0 votes
by (41.4k points)

Use statsmodels regression to pull of the p-values:

import statsmodels.api as sm

mod = sm.OLS(Y,X)

fii =

p_values = fii.summary2().tables[1]['P>|t|']

If you wish to learn more about Data Science, visit Data Science tutorial and Data Science courses by Intellipaat.

Browse Categories