Comparing the algorithm’s predictions with the actual results happens during the:
answer
The correct answer is 2: the cost function. After making a prediction in the form of a line, the algorithm measures the distance between the prediction and the actual data, adds up the mistakes, and averages them.