Wine classification by machine learning

Wine classification by machine learning

Do you know how experts classify wines? Of course, the first parameter is the taste of the drink. But there are more than a dozen other parameters that determine a wine’s class.

Wine composition can differ significantly depending on several factors, such as grape variety, growing region, climate, soil type and winemaking techniques. Different grape varieties have distinct qualities that affect the taste of wine.

For example, Cabernet Sauvignon is known for its full-bodied flavor with hints of blackcurrant and violet whereas Chardonnay has a light-bodied nature with flavors of green apple and citrus fruits.

The growing conditions in various regions have an impact on the acidity levels present in the grapes. While cooler regions produce acidic wines, warmer climates tend to produce sweeter ones. Winemakers control the fermentation process which also affects the complexity of wine. Whether they choose to age it in oak barrels or stainless-steel tanks will have an impact on its flavor profile as well.

All these different elements contribute to unique variations in wine compositions. And I was curious to look more specifically at these signs. And also to see if machine learning can handle wine classification as well as humans. And I have to admit, it worked out pretty well.

I found a dataset with wine features and used Python to do the following:

  1. EDA analysis of wine quality.
  2. –°lassification of wines by the method of linear discriminant analysis.
  3. ML model construction of wine quality prediction.
  4. Re-classification by LDA on a limited sample and two features in the data – ash and flavanoids.
  5. Visualization of wine division into classes.


Leave a Reply

Your email address will not be published. Required fields are marked *