The dataset analyzes the quality of wines based on a variety of attributes, assigning wine quality scores ranging from 0 to 10. The dataset consists of the following attributes:
- Fixed Acidity: Measurement of the non-volatile acids present in the wine (Range: 3.8 to 14.2, Mean: 6.85).
- Volatile Acidity: Measurement of the volatile acids present in the wine (Range: 0.08 to 1.1, Mean: 0.28).
- Citric Acid: Measurement of the citric acid content in the wine (Range: 0 to 1.66, Mean: 0.33).
- Residual Sugar: Measurement of the residual sugar content in the wine (Range: 0.6 to 65.8, Mean: 6.39).
- Chlorides: Measurement of the chloride content in the wine (Range: 0.009 to 0.346, Mean: 0.045).
- Free Sulfur Dioxide: Measurement of the free sulfur dioxide content in the wine (Range: 2 to 289, Mean: 35.31).
- Total Sulfur Dioxide: Measurement of the total sulfur dioxide content in the wine (Range: 9 to 440, Mean: 138.36).
- Density: Measurement of the wine's density (Range: 0.9871 to 1.03898, Mean: 0.994).
- pH: Measurement of the wine's pH level (Range: 2.72 to 3.82, Mean: 3.19).
- Sulphates: Measurement of the sulphate content in the wine (Range: 0.22 to 1.08, Mean: 0.49).
- Alcohol: Measurement of the alcohol content in the wine (Range: 8 to 14.2, Mean: 10.51).
- Quality: The quality score of the wine (Range: 3 to 9, Mean: 5.88).
The quality score (target variable) is given based on sensory data.
This project utilizes four machine learning methods to classify wine quality:
- Naïve Bayes: A probabilistic classifier, ideal for datasets with multiple classes.
- Support Vector Machines (SVM): Effective in high-dimensional spaces, primarily suited for binary classification tasks. Different kernel functions like linear and rbf were experimented with to optimize the classification accuracy.
- Random Forest: An ensemble method aggregating multiple decision trees for improved accuracy. The optimal number of trees and other parameters were fine-tuned to enhance the model's performance.
- Neural Network: Noted for its robustness, fault tolerance, parallel distributed processing, and self-learning ability. However, the performance might be improved with further tuning and time investment.
The models were evaluated based on several metrics derived from the confusion matrix:
- Accuracy
- Recall
- Precision
The performance of the models varied, with the Random Forest model outperforming others. The accuracy rates achieved were:
- Naïve Bayes: Approximately 49.6%
- SVM: Up to 65% (depending on the kernel function used)
- Random Forest: About 70%
- Neural Network: Around 63.8%
The performance hierarchy (Random Forest > SVM ≈ Neural Network > Naïve Bayes) indicates that the Random Forest's ensemble approach and ability to capture complex feature interactions might give it an edge in this task.
The model performance can be attributed to the inherent complexities and assumptions of each model. Due to time constraints, the Neural Network model has room for improvement. Further research and experimentation might yield better results.