Skip to content

Latest commit

 

History

History
6 lines (4 loc) · 818 Bytes

File metadata and controls

6 lines (4 loc) · 818 Bytes

linear-regression-by-hand-vs-libraries-in-python

This notebook creates a linear regression model and related statistics by hand using the underlying mathematical formulas and a sample dataset. It then creates another linear regression model and related statistics using python libraries and the same sample dataset. Both methods include calculating the equation of a line $y = mx+b$, the line's slope ($m$) and y-intercept ($b$), the coefficient of determination R-squared ($r^2$), and Pearson's correlation coefficient ($r$). The results of the two modeling methods are then compared and summarized.

Highlights

Both models produced the same linear regression line $y = mx+b$, slope ($m$) and y-intercept ($b$), the coefficient of determination R-squared ($r^2$), and Pearson's correlation coefficient ($r$).