October 2018
Beginner to intermediate
676 pages
18h 30m
English
The data for Loss, theta0, theta1, and theta (optimal values of theta0 and theta1 that give the lowest error) are taken from one of the regression problems for plotting the contour plot. If theta0 and theta1 are vectors of size 1 x n, then the Loss will be in the form of an n x n matrix.
Import the required libraries. We will introduce one more library for color mapping from Matplotlib:
import matplotlib.pyplot as pltimport pandas as pdimport numpy as npfrom matplotlib import cm
We also need to understand the concept of a mesh grid, since the contour, surface, and stream plots also use this concept:
Read now
Unlock full access