Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small bug in notebook 06_learning_curves.ipynb #5

Open
NobleKennamer opened this issue Jul 22, 2015 · 2 comments
Open

Small bug in notebook 06_learning_curves.ipynb #5

NobleKennamer opened this issue Jul 22, 2015 · 2 comments

Comments

@NobleKennamer
Copy link

In the file doc/notebooks/06_learning_curves.ipynb, I believe there is a small mistake in the code box directly under the section "Cross-validation and Testing". The data that is supposed to be used for testing is defined by:

xtest = x[Ntrain:-Ntest]
ytest = y[Ntrain:-Ntest]

Making it the same data that is used for the Cross-Validation set. I think the above code should be replaced with:

xtest = x[-Ntest:]
ytest = y[-Ntest:]

I hope this helps and thanks for putting up this great tutorial. Your book has also been really helpful

@mycarta
Copy link

mycarta commented Jan 1, 2016

I noticed that too, and fixed it in a similar way:

xtest = x[(Ntrain + Ncrossval):]
ytest = y[(Ntrain + Ncrossval):]

Also, is the test set defined only for illustrative purposes in this notebook?
In the second box in the same "Cross-validation and Testing" section a test error is initialized as:
test_err = np.zeros(len(degrees))
but never used.

@mycarta
Copy link

mycarta commented Jan 1, 2016

Unless I'm mistaken, there's also a small bug in the third code box in the "Learning Curves: Exploring the Bias-Variance Tradeoff" section. When calculating the 1st order polynomial error for the three (x_new, y_new) points, shouldn't
print abs(np.sin(x_new) - y_new)
be instead
print abs(np.sin(2 * x_new) - y_new)

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

No branches or pull requests

2 participants