Alcohol versus quality

Let's see how the quality of wine varies with respect to alcohol concentration. This can be done using the box plot. Check the code snippet given here:

sns.boxplot(x='quality', y='alcohol', data = df_red)

And the output of the preceding code is as follows:

Figure 12.7 - A box plot showing the variation of the quality of wine with respect to alcohol concentration

Note the box in Figure 12.7 showing some dots outside of the graph. Those are outliers. Most of the outliers as shown in Figure 12.7 are around wine with quality 5 and 6. We can remove the outliers by passing an argument, showoutliers=False, as shown in the following code:

sns.boxplot(x='quality', y='alcohol', data = df_red, showfliers=False)

And the output of the code is much cleaner, as shown here:

Figure 12.8 -A box plot showing the variation of the quality of wine with respect to alcohol concentration without outliers

Note that, from Figure 12.8, it seems that as the quality of wine increases, so does the alcohol concentration. That would make sense, right? The higher the alcohol concentration is, the higher the quality of the wine. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.13.164