Member-only story
Interview question: Perform simple linear regression on Boston house prices dataset
In one of my recent posts, I discussed how to perform simple linear regression on the mtcars dataset, and that blog post can be seen here:- https://medium.com/@tracyrenee61/interview-question-perform-simple-linear-regression-on-the-mtcars-dataset-fc997de88660
In this post, I intend to discuss performing simple linear regression on the Boston house prices dataset. I intend to introduce a different technique to perform simple linear regression, however, as I intend to use scipy’s linregress method to perform the regression.
Simple linear regression is used to estimate the relationship between two quantitative variables. Two questions that simple linear regression will answer are:-
- How strong the relationship is between two variables, such as MEDV and LSTAT.
- The value of the dependent variable at a certain value of the independent variable (e.g., MEDV at a certain level of LSTAT).
Regression models describe the relationship between variables by fitting a line to the observed data. Linear regression models use a straight line. Regression allows you to estimate how a dependent variable changes as the independent variable(s) change.