The "Iris" dataset is probably familiar to most people here - it's one of the canonical test data sets and a go-to example dataset for everything from data visualization to machine learning. For example, everyone in this question ended up using it for a discussion of scatterplots separated by treatment.

What makes the Iris data set so useful? Just that it was there first? If someone was trying to create a useful example/testing data set, what lessons could they take away from it?


2 Answers 2


The Iris dataset is deservedly widely used throughout statistical science, especially for illustrating various problems in statistical graphics, multivariate statistics and machine learning.

  • Containing 150 observations, it is small but not trivial.

  • The task it poses of discriminating between three species of Iris from measurements of their petals and sepals is simple but challenging.

  • The data are real data, but apparently of good quality. In principle and in practice, test datasets could be synthetic and that might be necessary or useful to make a point. Nevertheless, few people object to real data.

  • The data were used by the celebrated British statistician Ronald Fisher in 1936. (Later he was knighted and became Sir Ronald.) At least some teachers like the idea of a dataset with a link to someone so well known within the field. The data were originally published by the statistically-minded botanist Edgar Anderson, but that earlier origin does not diminish the association.

  • Using a few famous datasets is one of the traditions we hand down, such as telling each new generation that Student worked for Guinness or that many famous statisticians fell out with each other. That may sound like inertia, but in comparing methods old and new, and in evaluating any method, it is often considered helpful to try them out on known datasets, thus maintaining some continuity in how we assess methods.

  • Last, but not least, the Iris dataset can be enjoyably coupled with pictures of the flowers concerned, as from e.g. the useful Wikipedia entry on the dataset.

Note. Do your bit for biological correctness in citing the plants concerned carefully. Iris setosa, Iris versicolor and Iris virginica are three species (not varieties, as in some statistical accounts); their binominals should be presented in italic, as here; and Iris as genus name and the other names indicating particular species should begin with upper and lower case respectively.

(EDIT 4 May 2022 In a generally excellent book to hand on machine learning, the Iris data are described in terms of classes, types, kinds and subspecies, but never once correctly from a biological viewpoint. Naturally that sloppiness makes not a jot of difference to the machine learning exposition.)

Stebbins (1978) gave an appreciation of Anderson, a distinguished and idiosyncratic botanist, and comments on the scientific background to distinguishing three species of the genus Iris. Kleinman (2002) surveys Anderson's graphical contributions with statistical flavor. See also Unwin and Kleinman (2021).

Kleinman, K. 2002. How graphical innovations assisted Edgar Anderson's discoveries in evolutionary biology. Chance 15(3): 17-21.

Stebbins, G. L. 1978. Edgar Anderson 1897--1969.
Biographical Memoir. Washington, DC: National Academy of Sciences. accessible here

Unwin, A. and Kleinman, K. 2021. The iris data set: In search of the source of virginica. Significance 18: 26-29. https://doi.org/10.1111/1740-9713.01589

  • 8
    $\begingroup$ I'd give an extra +1 if I could for a principled stand for biological correctness. $\endgroup$
    – Fomite
    Commented Nov 8, 2013 at 1:11
  • $\begingroup$ I like that it is well known, so the student has a rich library of reference/certified results, and that there is a mislabeling which makes for useful imperfect labeling. I also like that the measured variables each have different but nonzero contribution to classification. $\endgroup$ Commented Apr 13, 2021 at 23:21

The dataset is big and interesting enough to be non-trivial, but small enough to "fit in your pocket", and not slow down experimentation with it.

I think a key aspect is that it also teaches about over-fitting. There are not enough columns to give a perfect score: we see this immediately when we look at the scatterplots, and they overlap and run into each other. So any machine-learning approach that gets a perfect score can be regarded as suspicious.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.