杨同学2018-09-25 20:20:03
线性回归后应该先检验其p-value是否小于0.05才能用吧. 不然强行拟合没有意义啊. 如何在python里检验线性回归的p-value呢?查了一圈没查到简单的
回答(1)
180****86962025-02-28 20:59:27
It is important to check the p-value of the linear regression model before drawing conclusions, as a p-value less than 0.05 indicates that the relationship between the independent and dependent variables is statistically significant. In Python, you can easily check the p-value of a linear regression model using statsmodels library. After fitting a linear regression model using sm.OLS() (Ordinary Least Squares), you can access the p-values through the summary() function. In the summary output, you will see the p-value for each coefficient (including the intercept) in the regression model. If the p-value is less than 0.05, it suggests that the relationship between the independent and dependent variables is statistically significant.
- 评论(0)
- 追问(0)


评论
0/1000
追答
0/1000
+上传图片