Simple linear regression
You might have used other machine learning libraries; now let's practice learning the simple linear regression model using TensorFlow. We will explain the concepts first using a generated dataset before moving on to domain-specific examples.
We will use generated datasets so that readers from all different domains can learn without getting overwhelmed with the details of the specific domain of the example.
Note
You can follow along with the code in the Jupyter notebook ch-04a_Regression
.
Data preparation
To generate the dataset, we use the  make_regression
 function from the datasets
module of the sklearn
 library:
from sklearn import datasets as skds X, y = skds.make_regression(n_samples=200, n_features=1, n_informative=1, n_targets=1, noise = 20.0)
This generates a dataset for regression with 200 sample values for one feature and one target each, with some noise...