Machine learning with football · Chapter 7 · Datasets and overfitting

Transforming data

Every value becomes a float, and every transform runs the same way everywhere.

Estimated time: 5 minutes · page 6 of 12

Floats, the same way everywhere

Chapters 5 and 6 did the work: every value becomes a float, numbers are usually normalized, and categories are encoded. This page adds two rules to it.

Whatever you do to the training set, you do in exactly the same way to the validation set, the test set and the data the model meets later. Means and standard deviations for z-scores come from the training set only. Otherwise the test set leaks into training, the same peeking chapter 3 warned about.

Not all data belongs in training. With too much you pick a relevant subset, and personal information that isn't needed should go. Player names are fine on a football site, but a model about supporters has no business keeping their addresses.

Leagues