Wine Quality

Author

Ozge Gundogan

Published

September 6, 2026

Introduction

For this assignment, I chose the Wine Quality dataset from the UCI Machine Learning Repository and the article “Modeling wine preferences by data mining from physicochemical properties”. The dataset contains physicochemical measurements and sensory quality scores for red and white Vinho Verde wines from Portugal. I will focus on the white wine subset to explore how physicochemical properties are related to wine quality. I selected this dataset because of my background in Chemical Engineering, which gives me familiarity with many of the physicochemical variables and allows me to connect my previous knowledge with data science.

Article: “Modeling wine preferences by data mining from physicochemical properties” Cortez, P., Cerdeira, A., Almeida, F., Matos, T., Reis, J. (2009)

Link: https://www.sciencedirect.com/science/article/abs/pii/S0167923609001377

Planned Approach

I will focus on the white wine subset of the Wine Quality dataset. First, I will load the dataset into R and examine its structure, variables, and data types. I will use quality as the target variable and select relevant physicochemical variables to create a data frame for further analysis. I will then examine how these variables may be related to wine quality and prepare the data for later analysis.

Anticipated Data Challenges

The large size of the dataset and the large number of variables may be challenging for me at this stage. In addition, some variables may be related to each other, which could make the analysis more challenging.

Business Question

Can physicochemical properties help explain the quality of a wine?

Data Question

Which physicochemical variables are most strongly related to a wine’s quality score?

Loading The Data

I loaded the white wine dataset directly from GitHub using its URL so that the analysis can be reproduced on another computer.

url <- "https://raw.githubusercontent.com/OzgeG01/DATA607-Assignment/refs/heads/main/winequality-white.csv"

white_wine_data <- read.csv(url,sep=";")

head(white_wine_data)
  fixed.acidity volatile.acidity citric.acid residual.sugar chlorides
1           7.0             0.27        0.36           20.7     0.045
2           6.3             0.30        0.34            1.6     0.049
3           8.1             0.28        0.40            6.9     0.050
4           7.2             0.23        0.32            8.5     0.058
5           7.2             0.23        0.32            8.5     0.058
6           8.1             0.28        0.40            6.9     0.050
  free.sulfur.dioxide total.sulfur.dioxide density   pH sulphates alcohol
1                  45                  170  1.0010 3.00      0.45     8.8
2                  14                  132  0.9940 3.30      0.49     9.5
3                  30                   97  0.9951 3.26      0.44    10.1
4                  47                  186  0.9956 3.19      0.40     9.9
5                  47                  186  0.9956 3.19      0.40     9.9
6                  30                   97  0.9951 3.26      0.44    10.1
  quality
1       6
2       6
3       6
4       6
5       6
6       6

Exploring The Data

I examined the dimensions, column names, and structure of the dataset to better understand its size, variables, and data types before creating the final subset.

dim(white_wine_data)
[1] 4898   12
names(white_wine_data)
 [1] "fixed.acidity"        "volatile.acidity"     "citric.acid"         
 [4] "residual.sugar"       "chlorides"            "free.sulfur.dioxide" 
 [7] "total.sulfur.dioxide" "density"              "pH"                  
[10] "sulphates"            "alcohol"              "quality"             
str(white_wine_data)
'data.frame':   4898 obs. of  12 variables:
 $ fixed.acidity       : num  7 6.3 8.1 7.2 7.2 8.1 6.2 7 6.3 8.1 ...
 $ volatile.acidity    : num  0.27 0.3 0.28 0.23 0.23 0.28 0.32 0.27 0.3 0.22 ...
 $ citric.acid         : num  0.36 0.34 0.4 0.32 0.32 0.4 0.16 0.36 0.34 0.43 ...
 $ residual.sugar      : num  20.7 1.6 6.9 8.5 8.5 6.9 7 20.7 1.6 1.5 ...
 $ chlorides           : num  0.045 0.049 0.05 0.058 0.058 0.05 0.045 0.045 0.049 0.044 ...
 $ free.sulfur.dioxide : num  45 14 30 47 47 30 30 45 14 28 ...
 $ total.sulfur.dioxide: num  170 132 97 186 186 97 136 170 132 129 ...
 $ density             : num  1.001 0.994 0.995 0.996 0.996 ...
 $ pH                  : num  3 3.3 3.26 3.19 3.19 3.26 3.18 3 3.3 3.22 ...
 $ sulphates           : num  0.45 0.49 0.44 0.4 0.4 0.44 0.47 0.45 0.49 0.45 ...
 $ alcohol             : num  8.8 9.5 10.1 9.9 9.9 10.1 9.6 8.8 9.5 11 ...
 $ quality             : int  6 6 6 6 6 6 6 6 6 6 ...

Selecting Variables

I selected seven variables for further analysis: alcohol, volatile acidity, citric acid, residual sugar, density, pH, and quality. These variables represent different physicochemical properties of the wine, while quality is the target variable.

white_wine_subset <- white_wine_data[,c("alcohol", "volatile.acidity", "citric.acid", "residual.sugar", "density", "pH", "quality")]

head(white_wine_subset)
  alcohol volatile.acidity citric.acid residual.sugar density   pH quality
1     8.8             0.27        0.36           20.7  1.0010 3.00       6
2     9.5             0.30        0.34            1.6  0.9940 3.30       6
3    10.1             0.28        0.40            6.9  0.9951 3.26       6
4     9.9             0.23        0.32            8.5  0.9956 3.19       6
5     9.9             0.23        0.32            8.5  0.9956 3.19       6
6    10.1             0.28        0.40            6.9  0.9951 3.26       6

Conclusions

In this assignment, I loaded the white wine dataset into R and created a subset containing physicochemical variables and sensory wine quality scores.

To extend the work of Cortez and colleagues, I could investigate which variables are most important for predicting wine quality.

To verify the findings of the original study, I could apply the same statistical methods to the white wine subset and compare the results with the original study.

To update the study, I could use newer wine quality data, if available, and compare the results with the original dataset. This could help determine whether the relationships between physicochemical properties and wine quality have remained consistent over time.

Citation

I used ChatGPT (GPT-5.6 Luna), developed by OpenAI, to help me understand some of the functions I used in this assignment and to check my work.

OpenAI. (2026). ChatGPT (GPT-5.6 Luna) [Large language model]. [https://chatgpt.com/ Accessed September 7, 2026].

Video Explainer

Link: https://youtu.be/x9LJ3pzY0rA