Skip to content

Building classification and regression models to predict quality and type of the wine.

Notifications You must be signed in to change notification settings

doguilmak/Wine-Type-and-Quality-Prediction

Repository files navigation

Wine Type and Quality Prediction

wine

Picture Source: Wine Cooler Direct


Data Set Information:

The two datasets are related to red and white variants of the Portuguese "Vinho Verde" wine. For more details, consult: Web Link or the reference [Cortez et al., 2009]. Due to privacy and logistic issues, only physicochemical (inputs) and sensory (the output) variables are available (e.g. there is no data about grape types, wine brand, wine selling price, etc.).

These datasets can be viewed as classification or regression tasks. The classes are ordered and not balanced (e.g. there are many more normal wines than excellent or poor ones). Outlier detection algorithms could be used to detect the few excellent or poor wines. Also, we are not sure if all input variables are relevant. So it could be interesting to test feature selection methods.


Keywords

  • Wine
  • Regression
  • Machine Learning
  • Quality Test
  • Artifical Neural Networks
  • Multi-output Model
  • K-Nearest Neighbors (K-NN)
  • Decision Tree
  • Grid Search

Attribute Information

For more information, read [Cortez et al., 2009]. Input variables (based on physicochemical tests):

  1. fixed acidity
  2. volatile acidity
  3. citric acid
  4. residual sugar
  5. chlorides
  6. free sulfur dioxide
  7. total sulfur dioxide
  8. density
  9. pH
  10. sulphates
  11. alcohol
  12. Output variable (based on sensory data): quality (score between 0 and 10)

This dataset has been referred from archive.ics.uci.edu.


Relevant Papers

P. Cortez, A. Cerdeira, F. Almeida, T. Matos and J. Reis. Modeling wine preferences by data mining from physicochemical properties.

In Decision Support Systems, Elsevier, 47(4):547-553, 2009.

Available at: sciencedirect.com


Objectives

  • Understand the data set & cleanup (data pre-processing).
  • Build multi-class regression model to predict quality of the wine (as 0, 1 and 2 classes). Afterwards, evaluate the model.
  • Build artificial neural network model to predict type of wine. Afterwards, evaluate the artificial neural network model.
  • Build classification models to predict wine type with k-nearest neighbors (K-NN) and decision tree. Afterwards, evaluate the models.

Notebooks

  1. Wine type and quality prediction with artificial neural networks (red and white wines): wine_ann.ipynb. You can use the model with loading model.h5 or you can use the whole model here.

  2. Wine quality prediction with multiple regression (only red wine): red_wine_multiple_reg.ipynb. You can use regr.save.

  3. Wine type prediction models made with K-Nearest Neighbors (K-NN) and Decision Tree: wine_quality_knn_dt.ipynb. In addition, you find K-NN trained model as knn_model.sav and trained Decision Tree model as dt_model.sav.

Contact Me

If you have something to say to me please contact me:

  • Twitter: Doguilmak
  • Mail address: doguilmak@gmail.com

Releases

No releases published

Packages

No packages published

Languages