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 in linear regression.
Understanding loss functions in linear regression
Getting ready
We will use the same iris data set as in the prior recipe, but 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, until we get to our loss function. We load the necessary libraries, start...