Step 2a - Compute the Loss

Learn about the difference between error and loss, the relationship between gradient descent and loss, and how the loss can be computed.

Difference between error and loss

There is a subtle but fundamental difference between error and loss.

The error is the difference between the actual value (label) and the predicted value computed for a single data point. So, for a given ith point (from our dataset of N points), its error is:

errori=yi^yierror_i = \hat{y_i} - y_i

The error of the first point in our dataset (i = 0) can be represented like this:

Get hands-on with 1200+ tech skills courses.