Title: Loading scikit-learn's Iris Dataset
Slug: loading_scikit-learns_iris-dataset
Summary: Loading the built-in Iris datasets of scikit-learn.
Date: 2016-08-31 12:00
Category: Machine Learning
Tags: Basics
Authors: Chris Albon
In [1]:
# Load libraries
from sklearn import datasets
import matplotlib.pyplot as plt
The Iris flower dataset is one of the most famous databases for classification. It contains three classes (i.e. three species of flowers) with 50 observations per class.
In [2]:
# Load digits dataset
iris = datasets.load_iris()
# Create feature matrix
X = iris.data
# Create target vector
y = iris.target
# View the first observation's feature values
X[0]
Out[2]: