cs109 / a-2017

Public Repository for cs109a, 2017 edition
http://cs109.github.io/a-2017
324 stars 461 forks source link

PolynomialFeatures constructor is called with the wrong degree #8

Open covuworie opened 6 years ago

covuworie commented 6 years ago

I have seen a bug in the section Cross Validation: For Selecting Polynomial Model Degree of Lecture_6_Notebook.ipynb. The degree d is incorrectly used in the PolynomialFeatures constructor. This has a value of 19 which is the last index of the previous loop. The intention is to use the degree with the best cross-validation score so the code should read:

gen_poly_terms = PolynomialFeatures(degree=best_degree, interaction_only=False)

PS: Likewise, I have not submitted a pull request for this as you may not want the output produced from my notebook.