There are many ways to calculate the error for ML algorithms, but in this chapter we will be using one of the most popular techniques: sum of squared distance error. Now we are going straight into details.
What does this error function do for us? Recall our goal: we want to get the line of best fit for our dataset. Refer to Figure 9.19, which is the equation of line slope. Here, m is the slope of line, b is the y intercept, x and y are the data points--in our case, x is the numbers of hours the student studies and y is the test score. Refer to Figure 9.19: