Beyond Accuracy: A Leakage-Aware and Explainable Machine-Learning Framework for Binary Red-Wine Quality Prediction
Keywords:
Cross-validation, Data leakage, Explainable AI, Imbalanced classification, Machine learning, Red Wine Quality, SHAP, XGBoostAbstract
Predicting wine quality from physicochemical measurements is a useful benchmark for studying imbalanced classification, model comparison, and interpretable machine learning. This paper audits and extends the public Prediction-of-Wine-Quality project, which converts the ordinal quality score of red wine into a binary label: good quality (score ≥ 7) and not-good quality (score < 7). The supplied red-wine dataset contains 1,599 records and 11 physicochemical predictors. The positive class is uncommon (217 records; 13.57%), making accuracy alone an inadequate model-selection criterion. A source-code audit found that the original notebook uses a single non-stratified 70/30 split and reports a hard-coded summary table; therefore, the table is treated as a reported artifact rather than as independently verified output. Re-execution of the notebook’s model configurations produced a Random Forest and XGBoost accuracy of 89.38%, but their positive-class recall and balanced accuracy reveal limitations hidden by accuracy. Extended experiments used a stratified hold-out set, training-only randomized hyperparameter search with five-fold stratified cross-validation, imbalance-aware metrics, and model-agnostic and SHAP-based explanations. XGBoost achieved the highest cross-validation balanced accuracy (0.8008), while Extra Trees achieved the highest held-out balanced accuracy (0.8291). The selected XGBoost model attained 81.54% recall and 0.9197 ROC-AUC on the held-out test set, at the cost of 41.09% precision. Alcohol and sulphates were the most prominent global predictors in the explainability analyses. A duplicate-group sensitivity split reduced XGBoost balanced accuracy to 0.7518, underscoring the need to account for repeated feature vectors. These results constitute a transparent empirical reassessment, not evidence of causal effects or external clinical/industrial validity.
References
P. Cortez, J. Teixeira, A. Cerdeira, F. Almeida, T. Matos, and J. Reis, “Using Data Mining for Wine Quality Assessment,” Discovery Science, vol. 5808, pp. 66–79, 2009.
S. Kaufman, S. Rosset, C. Perlich, and O. Stitelman, "Leakage in data mining: Formulation, detection, and avoidance," ACM Trans. Knowledge Discovery Data, vol. 6, no. 4, pp. 1–21, Dec. 2012.
S. Varma and R. Simon, "Bias in error estimation when using cross-validation for model selection," BMC Bioinform., vol. 7, no. 1, Feb. 2006.
T. Fawcett, "An introduction to ROC analysis," Pattern Recognition Letters, vol. 27, no. 8, pp. 861–874, Jun. 2006.
T. Saito and M. Rehmsmeier, "The precision-recall plot is more informative than the ROC plot when evaluating binary classifiers on imbalanced datasets," PLoS ONE, vol. 10, no. 3, Mar. 2015.
J. Davis and M. Goadrich, "The relationship between Precision-Recall and ROC curves," In Proceedings of the 23rd International Conference on Machine Learning (ICML), Jun. 2006, pp. 233–240.
M. T. Ribeiro, S. Singh, and C. Guestrin, "“Why should I trust you?”: Explaining the predictions of any classifier," in Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD), Aug. 2016, pp. 1135–1144.
S. M. Lundberg and S.-I. Lee, "A unified approach to interpreting model predictions," NIPS'17: Proceedings of the 31st International Conference on Neural Information Processing Systems, pp. 4768 – 4777, Dec. 2017.
H. Arshad, "Wine quality prediction using machine learning," Journal of Innovative Computing and Emerging Technologies, vol. 4, no. 2, Oct. 2024.
E. Gjeka, "Prediction of wine quality using machine learning techniques," Bánki Közlem., vol. 6, no. 2, pp. 29–34, Oct. 2024.
Y. Huang, "Red wine prediction comparing several machine learning models," in Proceedings of the 1st International Conference on Innovations in Applied Mathematics, Physics, and Astronomy, 2024, pp. 169–173.
A. K, "Regression modeling approaches for red wine quality prediction: Individual and ensemble," International Journal of Research in Applied Sciences and Engineering Technology, vol. 11, no. 6, pp. 3621–3627, Jun. 2023.
S. Kumar, K. Agrawal, and N. Mandan, "Red wine quality prediction using machine learning techniques," in Proceedings of the 2020 International Conference on Computer Communication and Informatics (ICCCI), Jun. 2020, pp. 1–6.
P. Li, "Red wine quality prediction by supervised learning, " Highlights in Science, Engineering and Technology, vol. 72, pp. 1121–1125, Dec. 2023.
Z. Liu, "Comparison of the red wine quality prediction accuracy using 5 machine learning model," Highlights in Science, Engineering and Technology, vol. 60, pp. 114–120, Jul. 2023.
J. Singh and M. Manchanda, "A machine learning based mechanism for wine quality prediction," Elementary Education Online, vol. 20, no. 3, pp. 3246–3250, Jan. 2021.
H. Zhuang, "Red wine quality prediction model based on random forest algorithm," 2026 4th International Conference on Computer Science and Mechatronics (ICCSM 2026), vol. 89, Aug. 2026.
V. Godase, P. Pawar, S. Nagane, and S. Kumbhar, "Automatic railway horn system using Node MCU," Journal of Control and Instrumentation, vol. 15, no. 1, pp. 11–19, Jan. 2024.
V. Godase and J. Godase, "Diet prediction and feature importance of gut microbiome using machine learning," Evolution in Electrical and Electronic Engineering, vol. 5, no. 2, pp. 214–219, Nov. 2024.
V. K. Jamadade, M. G. Ghodke, S. S. Katakdhond, and V. Godase, "A comprehensive review on scalable Arduino radar platform for real-time object detection and mapping," Journal of Microprocessor and Microcontroller Research, vol. 2, no. 2, pp. 1–11, May 2025.
V. Godase, "A comprehensive study of revolutionizing EV charging with solar-powered wireless solutions," Advance Res. Power Electron. Devices, Apr. 2025.
S. K. A, A. Kathiravan, P. Mannam, D. Akila, B. S. Kumar and V. Vilas Godase, "Advanced Neural Network Models for Optimal Energy Management in Microgrids with Integrated Electric Vehicles," 2025 5th International Conference on Trends in Material Science and Inventive Materials (ICTMIM), Kanyakumari, India, Apr. 2025, pp. 1869-1874.
R. Dange, E. Attar, P. Ghodake, and V. Godase, "Smart agriculture automation using ESP8266 NodeMCU," Journal of Electronics, Computer Networks and Applied Mathematics, no. 35, pp. 1–9, Jul. 2023.
V. Godase, "Optimized algorithm for face recognition using DeepFace and multi-task cascaded convolutional network (MTCNN)," Optimum Science Journal, no. 3, pp. 66–74, May 2025.