K-means clustering with the iris data example

The famous iris data has been used from the UCI machine learning repository for illustration purposes using k-means clustering. The link for downloading the data is here: http://archive.ics.uci.edu/ml/datasets/Iris. The iris data has three types of flowers: setosa, versicolor, and virginica and their respective measurements of sepal length, sepal width, petal length, and petal width. Our task is to group the flowers based on their measurements. The code is as follows:

>>> import os """ First change the following directory link to where all input files do exist """ >>> os.chdir("D:\\Book writing\\Codes\\Chapter 8") K-means algorithm from scikit-learn has been utilized in the following example # ...

Get Numerical Computing with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.