Super learner

28 Apr 2023

Posted on:

25 Apr 2023

1

# Resolved:Final Exam - Question 5

Dear Professor Manov

I believe in question 5 of the final exam there is a misake finding the Lasso Regression Model RMSE,

The code should be as follows:

print("Lasso Regression Model RMSE is: ", math.sqrt(mean_squared_error(y_test, lasso_reg_y_pred)))

However, You have the ridge_Y_pred in both cases so i believe the result should be :

Best Regards,

Mani

Instructor
Posted on:

26 Apr 2023

0

Hi Mani!

Thanks for reaching out!

You are absolutely correct that in the explanation, the parameter for lasso should be `lasso_reg_y_pred` instead of `ridge_reg_y_pred`. However, the results I obtained with the required input are indeed 26525 for ridge and 26173 for lasso.

Are you sure you are applying the correct arguments for the` RepeatedKFold` method, namely 10, 5, and 1? Also, you can check if the cross-validator values you're using correspond to the ones from the task. Either way, feel free to post the rest of your code here.

Thank you again - we will edit the typo in the explanation as soon as possible.

Best,

Ivan

Super learner
Posted on:

26 Apr 2023

0

Dear Ivan

Thank you in advance; I checked my code again and still get the same results; here is my code; I'd appreciate it if you could point out where I went wrong:

Best Regards,

Mani

Instructor
Posted on:

27 Apr 2023

1

Hi Mani!

The difference in the answer comes from the fact that you've integrated the optimization tolerance parameter with a value of 1 (`tol=1`) as it was done in the lecture. However, as the task in the exam does not provoke any duality gap issues, we decided not to assign a value to the tol parameter which means it used its default value: `tol=0.0001`. This is why we didn't designate the necessity of specifying an optimization tolerance in the task.

Hope this helps.

Best,

Ivan

Super learner
Posted on:

28 Apr 2023

0

Dear Ivan

So whenever we don't assign a value to the Tol Parameter it is 0.0001 by default.

Thank you, Ivan,

Sincerely yours,

Mani

Instructor
Posted on:

28 Apr 2023

1

Hi Mani!

Yes, precisely!

Please feel free to post another question should you encounter other difficulties. Thank you.
Best,
Ivan