0 votes
1 view
in Data Science by (17.6k points)

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

lm = sklearn.linear_model.LinearRegression()


1 Answer

0 votes
by (32.5k points)

Use statsmodels regression to pull of the p-values:

import statsmodels.api as sm

mod = sm.OLS(Y,X)

fii = mod.fit()

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.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !