Split Train and Test

Why we haven’t done the split of the data into train and test sets?
Is it because in case of Linear Regression problems it is useless to do the split, as the Mean Squared Error on the whole data set can define the accuracy of the model as well as if doing the train-test split and then predicting only on the test data set?

Or it is always better to do the split in order to get more accurate predictions on unseen data?

Please help me in understanding it.

It is only omitted for pedagogical purposes. We wanted to focus on the understanding of the parametrization of the linear model and transition from a manual linear model to a scikit-learn linear model.

When it comes to evaluating a model, it is always necessary to make cross-validation.