October 2018
Beginner to intermediate
676 pages
18h 30m
English
Here are the steps to create the desired plot:
fig = plt.figure(figsize=(10,8))ax = fig.gca(projection='3d')
# Read Loss, theta0 and theta1 valuesLoss = pd.read_excel('Loss.xlsx')theta0_vals = pd.read_excel('theta0.xlsx')theta1_vals = pd.read_excel('theta1.xlsx')
X, Y = np.meshgrid(theta0_vals, theta1_vals)
# Plot contour curvescset = ax.contour(X, Y, Loss, np.logspace(-2,3,100), cmap=cm.coolwarm)
fig.colorbar(cset, shrink=0.5, aspect=5)
ax.set_xlabel('theta0')ax.set_ylabel('theta1')ax.set_zlabel('Loss')
Read now
Unlock full access