Super learner
This user is a Super Learner. To become a Super Learner, you need to reach Level 8.
Last answered:

13 Apr 2022

Posted on:

13 Apr 2022

0

Resolved: Mistake in Linear Regression Practice Exam: 2

Hello,

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.

Regards,
Desislava Hristova

2 answers ( 1 marked as helpful)
Instructor
Posted on:

13 Apr 2022

0

Dear Desislava,

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!

Kind regards,
365 Hristina

Super learner
This user is a Super Learner. To become a Super Learner, you need to reach Level 8.
Posted on:

13 Apr 2022

0

Thank you so much for the response. I misread that we're supposed to use X_test instead of X_train and when I got the error, I assumed that there was a mistake. Thank you again for the answer.

Submit an answer