Skip to content
This repository has been archived by the owner on Mar 21, 2021. It is now read-only.

Exercise 3 baseline_cross_validate - assert problems #2

Closed
orlandocosta76 opened this issue Aug 19, 2018 · 5 comments
Closed

Exercise 3 baseline_cross_validate - assert problems #2

orlandocosta76 opened this issue Aug 19, 2018 · 5 comments

Comments

@orlandocosta76
Copy link

orlandocosta76 commented Aug 19, 2018

There are two problems in the asserts:

  • when converting dict to list you cannot predict the order, so one should use sets; otherwise these asserts can only pass by chance:
assert(list(baseline.bsl_options.values()) == ['sgd', 5e-05, 0.05])
assert(list(baseline_results.keys()) == ['test_rmse', 'test_mae', 'fit_time', 'test_time'])
  • it is asked a learning rate of 0.0005 but the assert contains 5e-05, instead of 5e-04 which is the equivalent.

(not sure how the grader handles this since I did not submit yet)

PS-Propose to change those 2 asserts to:

assert(set(baseline.bsl_options.values()) == {'sgd', 5e-04, 0.05})
assert(set(baseline_results.keys()) == {'test_rmse', 'test_mae', 'fit_time', 'test_time'})
@hugorcf
Copy link

hugorcf commented Aug 20, 2018

Thanks @orlandocosta76 I've also changed all the "lists" into "sets" and the problems were gone.

@orlandocosta76
Copy link
Author

@hugorcf But how did you go with the grader? I cannot get pass 15, and I think it is related to this issue

@yani992
Copy link

yani992 commented Aug 21, 2018

@orlandocosta76 Your approach (set instead of list) works with the grader. You must use 5e-05 in the model as well as in the grader, not the 5e-04 as described. This is valid for both exercise 3 and 4.

To the instructors @hershaw , @echo66 : please consider our "tweaking" of the asserts as a proof of our debugging efforts, not as cheating.

@hcastilho
Copy link
Member

I will have to check if the grader will let me change this without breaking anything.
In the meantime put the options in this order: 'method', 'learning_rate' , 'reg'
As the grader is using python 3.6 this will work.

@orlandocosta76
Copy link
Author

Ok @hcastilho I did that for both issues and it worked, thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants