Resolved: Mistake in Linear Regression Practice Exam: 2
In Question 3 of the exam, the task is to mark which is the correct scatter plot. In the insurance.ipynb file, there is a mistake in the code under Step 5: Plot the predicted versus the actual outputs. It should be ax.scatter(y_test, y_hat, alpha = 0.2). We should use y_test instead of y_train. Also it should be changed when setting the label for the x axis.
Thank you for your comment!
There is really nothing wrong in making predictions on the training data. In fact, that is very often done when studying the performance of an algorithm and searching for possible overtraining. Just as the explanation of the task reads,
y_hat stores the predictions made on the training data.
Hope this helps!