A model can look perfect on the rows it studied and still stumble on new ones. Comparing the two scores tells you whether it memorised or learned.
Task: write train_and_test_scores(name, seed). name is "iris" or "wine".
X and y, and split it with train_test_split(X, y, test_size=0.25, random_state=seed).DecisionTreeClassifier(random_state=0) on the training rows.[training score, test score], each rounded to 3 decimal places. The training score is the score on the rows it learned from.