liveBook · Manning

Iris dataset

As explained in Data Without Labels

The Iris dataset is a labeled collection of flower measurements covering three iris species, with 50 samples per species.

The Iris dataset is a labeled collection of 150 flower records covering three iris species, with 50 samples per species. Each record contains flower properties such as petal length and sepal length; the species label is the prediction target. section 3.5.2

A practical workflow inspects and transforms the data before modeling:

  • Load the CSV with pandas and check sample rows, shape, descriptive statistics, and variable spread. section 3.5.2
  • Separate the four flower-property columns from the species target, then standardize the independent variables. section 3.5.2
  • Use covariance analysis, eigenvalue decomposition, or scikit-learn PCA to identify principal components and their explained variance. section 3.5.2

Two-dimensional PCA view

Fit PCA to the standardized flower properties, retain two components, transform the observations, and plot the points using encoded species labels. The result keeps all 150 rows while reducing four variables to two. section 3.5.2

import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler

Use the supplied Python setup and notebook snippets to load, inspect, standardize, decompose, and visualize the dataset with pandas, NumPy, and scikit-learn. section 3.5.2

How Data Without Labels covers it

How deep it goes
Walks through loading, checking, separating, standardizing, decomposing, measuring variance, and plotting, but does not detail classifier evaluation.
Examples
Uses a 150-row CSV, four measurement variables, three species labels, covariance output, explained-variance plots, and a two-component scatter plot.
What it assumes
Assumes basic Python data handling and introduces the dataset workflow, PCA implementation, covariance analysis, and eigenvalue-based interpretation.
What you can do after
Apply PCA via scikit-learn to standardize measurements, reduce dimensions, inspect explained variance, and visualize species-labeled observations.
How it connects
Connects flower measurements with PCA, standardization, covariance matrices, eigenvalue decomposition, k-means clustering, and DBSCAN.

Also explained in

Compare how 2 books explain iris dataset →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Without Labels. The section links point to the parts of the book it draws on.