• Free preview
  • Text
  • 10m

Features, labels and splits

The vocabulary of a dataset, and why we always hold some data back.

Each example in a dataset has features, the inputs the model looks at, and a label, the answer we want it to predict.

python · editable

Enroll in the course to run this code.

Train and test

A model that has seen an example can simply remember it. To know how it does on new data, we hide part of the dataset while training and only use it at the end. That hidden part is the test set.

python · editable

Enroll in the course to run this code.

We shuffle first so the split is not biased by the order the data was collected in, and fix the seed so the result is repeatable.

This was a free lesson from Machine Learning Foundations

See the full course outline and enroll to keep going.

View the course