In this recipe, we will perform simple linear regression based on the number of rooms (RM) on the Boston house price dataset.
House price estimation-simple linear regression
Getting ready
Our goal is to predict the house price given in the last column (MEDV). In this recipe, we load the dataset from the TensorFlow Contrib dataset directly. We optimize the coefficients for an individual training sample using the stochastic gradient descent optimizer.
How to do it...
We proceed with the recipe as follows:
- The first step is to import all the packages that we will need: