O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting ready

We have already downloaded the Iris flower dataset, which can be found at chp8/10_connecting_process_pipe/iris.data of the code download for this book. 

If you happen to look at the Iris data, you will see there are 150 rows of the following format:

4.7,3.2,1.3,0.2,Iris-setosa

Here, there are multiple attributes separated by a comma (,) and the attributes are as follows:

  • Sepal length in cm
  • Sepal width in cm
  • Petal length in cm
  • Petal width in cm
  • Class:
    • Iris Setosa
    • Iris Versicolour
    • Iris Virginica

In this recipe, we will find the total number of flowers in each class, namely Setosa, Versicolour, and Virginica.

We will make use of a pipeline with the following commands (using a Unix-based operating system):

$ cat iris.data.txt ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required