liveBook · Manning

Iris dataset

As explained in Classic Computer Science Problems in Swift: Essential techniques for practicing programmers

The iris dataset is a labeled collection of 150 iris-plant samples from three species, each represented by four measured attributes.

The iris dataset contains 150 iris plants divided equally among three species. Each sample records sepal length, sepal width, petal length, and petal width, making it a compact classification problem. section 7.6

Its CSV representation separates four numeric parameters from a species label. Swift code shuffles the rows, converts labels into classification vectors, and prepares the data for a neural network. section 7.6

Classifying held-out flowers

A network with layer structure [4, 6, 3] trains on 140 samples for 20 passes, then validates the remaining 10. The demonstrated run identifies 9 of 10 correctly, or 90%. section 7.6

5.1,3.5,1.4,0.2,Iris-setosa
4.9,3.0,1.4,0.2,Iris-setosa
4.7,3.2,1.3,0.2,Iris-setosa
4.6,3.1,1.5,0.2,Iris-setosa
5.0,3.6,1.4,0.2,Iris-setosa

Shows the dataset's four measurements followed by its labeled species, making the tabular classification format concrete. section 7.6

How Classic Computer Science Problems in Swift: Essential techniques for practicing programmers covers it

How deep it goes
Explains the dataset structure and demonstrates parsing, training, and validation, but does not develop its historical collection or statistical properties.
Examples
Uses CSV rows, one-hot species classifications, a four-six-three network, and a 140/10 training-validation split.
What it assumes
Assumes two-dimensional arrays of Doubles and basic CSV handling while demonstrating the dataset's classification workflow.
What you can do after
Apply it via Swift neural-network code to parse, train on, and validate a three-class classifier.
How it connects
Connects classification, feature scaling, CSV data, and neural networks.

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 Classic Computer Science Problems in Swift: Essential techniques for practicing programmers. The section links point to the parts of the book it draws on.