Activity
You can probably guess what your homework is. So we know that an 8th order polynomial isn't very useful. Can you do better? So I want you to go back through our example, and use different values for the degree polynomial that you're going to use to fit. Change that 8 to different values and see if you can figure out what degree polynomial actually scores best using train/test as a metric. Where do you get your best r-squared score for your test data? What degree fits here? Go play with that. It should be a pretty easy exercise and a very enlightening one for you as well.
So that's train/test in action, a very important technique to have under your belt, and you're going to use it over and over again to make sure that your results ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access