September 2019
Intermediate to advanced
420 pages
10h 29m
English
The reason we never evaluate a model on the training set is that, in principle, any dataset can be learned if we throw a strong enough model at it.
A quick demonstration of this can be given with the help of the Iris dataset, which we talked about extensively in Chapter 3, First Steps in Supervised Learning. There, the goal was to classify species of iris flowers based on their physical dimensions. We can load the Iris dataset using scikit-learn:
In [1]: from sklearn.datasets import load_iris... iris = load_iris()
An innocent approach to this problem would be to store all data points in the matrix, X, and all class labels in the vector, y:
In [2]: import numpy as np... X = iris.data.astype(np.float32)... y ...
Read now
Unlock full access