Here, we will see another example of a scatter plot, where we can clearly see distinct segments.
The Iris flower dataset is the oldest dataset, introduced in 1936 by Ronald Fisher. The dataset has 50 examples each of three species of Iris, named Setosa, Virginica, and Versicolor. Each example has four attributes, and the length and width in centimeters of both sepals and petals. This dataset is widely used in machine learning (ML) for classification and clustering. We will use this dataset to demonstrate how a scatter plot can show different clusters within a dataset.
The following code block plots a scatter plot of the length and width of a petal:
- Load the Iris dataset from a .csv file using pandas:
iris = pd.read_csv('iris_dataset.csv', ...