July 2017
Intermediate to advanced
382 pages
9h 13m
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 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 matrix X and all class labels in the vector y:
In [2]: import numpy as np... X = iris.data.astype(np.float32)... y = iris.target ...
Read now
Unlock full access