Splitting data
For the process of designing machine learning-based software, another important property is to understand the distribution of data, and, subsequently, ensure that the data used for training and testing is of a similar distribution.
The distribution of the data used for training and validation is important as the machine learning models identify patterns and re-create them. This means that if the data in the training is not distributed in the same way as the data in the test set, our model misclassifies data points. The misclassifications (or mispredictions) are caused by the fact that the model learns patterns in the training data that are different from the test data.
Let us understand how splitting algorithms work in theory, and how they work in practice. Figure 5.5 shows how the splitting works on a theoretical and conceptual level:
Figure 5.5 – Splitting data into train and test sets
Icons represent review comments (and...