Back
How can I find the p-value (significance) of each coefficient?
lm = sklearn.linear_model.LinearRegression()lm.fit(x,y)
lm = sklearn.linear_model.LinearRegression()
lm.fit(x,y)
Use statsmodels regression to pull of the p-values:
import statsmodels.api as smmod = sm.OLS(Y,X)fii = mod.fit()p_values = fii.summary2().tables[1]['P>|t|']
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 Scientist by Intellipaat.
31k questions
32.8k answers
501 comments
693 users