Wine Quality Grading from Physicochemical Features: Comparing SVM and Random Forest with PCA/t-SNE Visualization
Main Article Content
Keywords
wine quality grading, SVM, random forest, PCA, t-SNE
Abstract
This study investigates multi-class prediction of wine quality scores (3–8) using physicochemical measurements from a Kaggle dataset. After removing the identifier field and standardizing features, we examine the data structure with correlation analysis and low-dimensional embeddings. PCA and t-SNE visualizations reveal substantial overlap among adjacent quality levels, implying gradual transitions rather than sharply separable classes. We then benchmark an RBF-kernel Support Vector Machine (SVM) and a Random Forest (RF) using an 80/20 stratified train/test split and 5-fold stratified cross-validation, tuning hyperparameters using Macro-F1 to account for class imbalance. Cross-validation slightly favors RF (Macro-F1 0.3271) over SVM (0.3078). On the held-out test set, RF achieves higher overall performance (Accuracy 0.7118, Macro-F1 0.3442, Weighted-F1 0.6897) than SVM (Accuracy 0.6332, Macro-F1 0.3072, Weighted-F1 0.6157). However, the relatively low Macro-F1 indicates uneven per-class performance, with limited effectiveness at rare quality levels, as reflected in confusion patterns that concentrate between neighboring grades (e.g., 5↔6 and 6↔7). RF feature importance highlights alcohol, sulphates, and volatile acidity as key predictors, offering interpretable evidence for the dominant decision cues.
References
- [1] Jain, K., Kaushik, K., Gupta, S. K., Mahajan, S., & Kadry, S. (2023). Machine learning-based predictive modelling for the enhancement of wine quality. Scientific Reports, 13, 17042.
- [2] Xiao, X.-Y., Yang, M., Huang, Y., Zhang, L., & Wang, Q. (2023). Research on Red Wine Quality Prediction Model Based on Deep Learning Architecture. In Proceedings of the 2023 6th International Conference on Big Data Technologies (ICBDT ’23) (pp. 80–85). Association for Computing Machinery.
- [3] Li, X. (2024). Machine Learning-Based Wine Quality Predictive Modelling. In Proceedings of the 1st International Conference on Innovations in Applied Mathematics, Physics and Astronomy (IAMPA 2024) (pp. 86–91). SciTePress.
- [4] Chen, Z. (2025). Wine Quality Prediction with Ensemble Trees: A Unified, Leak-Free Comparative Study. In Proceedings of the 2nd International Conference on Image Processing, Machine Learning, and Pattern Recognition (IPMLP ’25) (pp. 162–170). Association for Computing Machinery.
