Curvingo · Made in India

Glossary

Select one of the keywords on the left…

Train, Test and ValidationCode with Python

Reading time: ~5 min

In Python, scikit-learn's train_test_split shuffles the data and cuts it in two. Calling it twice gives all three sets: first training against the rest, then the rest into validation and test. random_state=42 fixes the shuffle, so you get the same split every time you run it. Run the program, then change the number of rows or the test size.

Choosing the Degree in Code

Here is the fertiliser experiment as a loop. np.polyfit learns a curve from the training data only; the validation error decides which degree wins. Run it and compare the output with your own chart.

To reveal more content, you have to complete all the activities and exercises above. 
Are you stuck? or reveal all steps

Next up:
Summary
Sina