July 2017
Intermediate to advanced
382 pages
9h 13m
English
The Iris dataset is included with scikit-learn. We first load all the necessary modules, as we did in our earlier examples:
In [1]: import numpy as np... import cv2... from sklearn import datasets... from sklearn import model_selection... from sklearn import metrics... import matplotlib.pyplot as plt... %matplotlib inlineIn [2]: plt.style.use('ggplot')
Then, loading the dataset is a one-liner:
In [3]: iris = datasets.load_iris()
This function returns a dictionary we call iris, which contains a bunch of different fields:
In [4]: dir(iris)Out[4]: ['DESCR', 'data', 'feature_names', 'target', 'target_names']
Here, all the data points are contained in 'data'. There are 150 data points, each of which have four feature ...
Read now
Unlock full access