Understanding loss functions in linear regression
It is important to know the effect of loss functions in algorithm convergence. Here, we will illustrate how the L1 and L2 loss functions affect convergence and predictions in linear regression. This is the first customization that we are applying to our canned Keras Estimator. More recipes in this chapter will enhance that initial Estimator by adding more functionality.
Getting ready
We will use the same Boston Housing dataset as in the previous recipe, as well as utilize the following functions:
* define_feature_columns_layers
* make_input_fn
* create_interactions
However, we will change our loss functions and learning rates to see how convergence changes.
How to do it...
We proceed with the recipe as follows:
The start of the program is the same as the last recipe. We therefore load the necessary packages and also we download the Boston Housing dataset, if it is not already available:
import tensorflow...