In this instructional video, the presenter walks through an exploratory data analysis (EDA) of the classic Iris dataset using Python's scientific stack. After briefly describing the dataset’s four numeric features (sepal length, sepal width, petal length, petal width) and three species (Setosa, Versicolor, Virginica), the speaker imports the data from scikit‑learn, examines its Bunch container, and notes the shape (150 samples × 4 features) and target encoding (0‑Setosa, 1‑Versicolor, 2‑Virginica). The feature and target arrays are assigned to variables X and y, and a pandas DataFrame is built with appropriate column names. The core of the EDA is a pandas.scatter_matrix plot, where points are colored by species via the `c` parameter, and figure size and marker style are customized. The resulting matrix shows histograms on the diagonal and pairwise scatter plots off‑diagonal, revealing a strong correlation between petal length and width and clear clustering of the three species. The tutorial concludes by prompting viewers to complete related exercises before moving on to machine‑learning modeling.
Chapters
Let's now jump into our first dataset. It contains data pertaining to iris flowers in which the features consist of four petal length, petal width, sepal length and sepal width. The target variable includes the species of flower and there are three possibilities Versicolor, Virginica and Setosa. As this is one of the datasets included in Scikit Learn, we'll import it from there with from Sklearn Import datasets In the exercises, you'll get practice at importing files from your local file system. For supervised learning, we'll also import Pandas, numpy and Pyplot under their standard aliases. In addition, we'll set the plotting style to ggplot using PLT style use. Firstly because it looks great and secondly in order to help all you r aficionados feel at home, we then load the dataset with datasets loadiris and assign the data to a variable iris. Checking out the type of iris, we see that it's a bunch which is similar to a dictionary in that it contains key value pairs. Printing the keys, we see that they are the feature names desc, which provides a description of the data set, the target names, the data which contains the values features, and the target which is the target data. As you see here, both the feature and target data are provided as numpy arrays. The shape attribute of the array feature tells us that there are 150 rows and four columns. Remember, samples are in rows, features are in columns. Thus we have 150 samples and the four features that Petal length and width and sepal length and width. Moreover, note that the target variable is encoded as 0 for Setosa, 1 for Versicolor, and 2 for Virginica. We can see this by printing iris targetnames in which setosa corresponds to index 0, versicolor to index 1, and virginica to index 2. In order to perform some initial exploratory data analysis, or EDA for short, will assign the feature and target data to x and Y respectively. We'll then build a dataframe of the feature data using PD DataFrame and also passing column names. Viewing the head of the data frame shows us the first five rows. Now we'll do a bit of visual eda. We use the Pandas function scattermatrix to visualize our data set. We pass it our data frame along with our target variable as argument to the parameter C which stands for color, ensuring that our data points in our figure will be colored by their species. We also pass a list to fig size which specifies the size of our figure as well as a marker size and shape. The result is a matrix of figures, which on the diagonal are histograms of the features corresponding to the row and column. The the off diagonal figures are scatter plots of the column feature versus row feature colored by the target variable. There is a great deal of information in this scatter Matrix See here, e.g. that petal width and length are highly correlated, as you may expect, and that flowers are clustered according to species. Now it's your turn to dive into a few exercises and to do some eda. Then we'll be back to do some machine learning. Enjoy.