Loading scikit-learn's Iris Dataset


# Load libraries
from sklearn import datasets
import matplotlib.pyplot as plt 

Load Iris Dataset

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.

# 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
array([ 5.1,  3.5,  1.4,  0.2])