Downloads · 30 days
30
34% of all-time downloads
neck392/p3-wine-quality-keras-mlp32-16-huber-tuned
p3-wine-quality-keras-mlp32-16-huber-tuned is a tabular regression model from neck392. Use it for the tabular regression task on the model card, and read the license before you ship it in a product. It is set up for keras. The card lists the license as mit.
This repository contains a Keras-based MLP model developed for wine quality prediction.
Downloads · 30 days
30
34% of all-time downloads
All-time downloads
87
Public
Repo size
1.2 KB
Likes
0
Public
Click a slice to open those files.
.keras36.8 KB · 69%
From the Hugging Face model README
This repository contains a Keras-based MLP model developed for wine quality prediction.
The model predicts wine quality from 11 physicochemical input features. It first produces a continuous regression output and then applies threshold-based post-processing to convert the output into an integer wine quality label.
qualityThe preprocessing pipeline follows the same experimental setting used during model development.
log1p transformation for selected skewed features['fixed acidity', 'volatile acidity', 'citric acid', 'residual sugar', 'chlorides', 'free sulfur dioxide', 'total sulfur dioxide', 'density', 'pH', 'sulphates']
['chlorides', 'volatile acidity', 'free sulfur dioxide', 'citric acid', 'residual sugar']
The threshold values selected on the validation set are:
[3.5, 4.5, 5.65, 6.6, 7.5, 8.5]
| Split | RMSE | MAE | R2 |
|---|---|---|---|
| Validation | 0.705870 | 0.545559 | 0.363006 |
| Test | 0.715966 | 0.555012 | 0.347002 |
| Split | Accuracy | Kappa | MAE_int | Macro F1 | Weighted F1 |
|---|---|---|---|---|---|
| Validation | 0.570408 | 0.325482 | 0.474490 | 0.286725 | 0.543393 |
| Test | 0.560204 | 0.310787 | 0.492857 | 0.272481 | 0.536417 |
Although MLP_16_8 achieved the lowest validation RMSE among raw regression models, this MLP32-16 Huber model was selected as the final single model because it achieved better threshold-tuned integer quality prediction performance on the validation set.
| File | Description |
|---|---|
model.keras | Trained Keras model |
scaler.pkl | Fitted StandardScaler object |
clip_bounds.json | Clipping bounds computed from the training data |
log_config.json | Log transformation configuration |
feature_columns.json | Input feature order |
thresholds.json | Threshold values for integer quality conversion |
preprocess_config.json | Preprocessing and model configuration |
metrics.json | Evaluation metrics |
inference.py | Example inference script |
requirements.txt | Required Python packages |
from inference import predict_quality
sample = {
"fixed acidity": 7.0,
"volatile acidity": 0.27,
"citric acid": 0.36,
"residual sugar": 20.7,
"chlorides": 0.045,
"free sulfur dioxide": 45.0,
"total sulfur dioxide": 170.0,
"density": 1.001,
"pH": 3.00,
"sulphates": 0.45,
"alcohol": 8.8
}
result = predict_quality(sample)
print(result)
The dataset is concentrated around middle quality scores, especially 5 and 6. As a result, predictions for rare extreme quality scores may be less reliable.