Downloads · 30 days
0
cannj/2026-24679-coffee-autogluon-classifier
2026-24679-coffee-autogluon-classifier is a tabular classification model from cannj. Use it for the tabular classification task on the model card, and read the license before you ship it in a product. It is set up for autogluon. The card lists the license as mit.
This repository contains an AutoGluon binary classifier that predicts whether a retail coffee bag is premium-priced using package attributes.
Downloads · 30 days
0
Access
Public
Updated Sep 23, 2026
Repo size
1.9 MB
Likes
0
Public
Click a slice to open those files.
.zip933 KB · 98%
From the Hugging Face model README
This repository contains an AutoGluon binary classifier that predicts whether a retail coffee bag is premium-priced using package attributes.
The model was developed for Homework 2 in Carnegie Mellon University's 24-679 course.
WeightedEnsemble_L2cannj/2026-24679-coffee-autogluon-classifierThis model demonstrates how AutoML can compare classical machine-learning models on a small tabular product dataset.
Intended uses include:
The model is not intended for:
The target column is is_premium.
| Label | Meaning |
|---|---|
| 0 | Standard-priced coffee |
| 1 | Premium-priced coffee |
The positive class used for precision, recall, and F1 is label 1.
The source dataset defines premium-priced coffee relative to its median price per ounce. The label therefore represents relative pricing within this dataset, not a universal definition of premium coffee.
The source dataset was created by Hugging Face user ssg1 for Homework 1.
Dataset URL:
https://huggingface.co/datasets/ssg1/coffee-bags-tabular
The original dataset contains 34 independently collected retail coffee products:
The data describe retail products and do not contain personal or sensitive human information.
The published splits were used without reshuffling.
| Split | Original rows | Augmented rows | Total rows | Purpose |
|---|---|---|---|---|
| Train | 23 | 322 | 345 | Model fitting |
| Validation | 5 | 0 | 5 | Model selection |
| Test | 6 | 0 | 6 | Final evaluation |
The original products were divided into training, validation, and test groups before augmentation.
Only training originals were used as parents for augmented records. Validation and test records are original and unaugmented.
The notebook verified that parent identifiers do not cross between splits.
The model uses seven package attributes.
| Feature | Type | Unit or categories | Description |
|---|---|---|---|
origin | Categorical | Country or Blend | Stated coffee origin |
altitude_masl | Numerical | Meters above sea level | Stated growing altitude |
altitude_stated | Binary | 0 or 1 | Whether altitude is stated |
processing | Categorical | Multiple categories | Processing method |
roast_level | Categorical | Multiple categories | Stated roast level |
weight_g | Numerical | Grams | Package net weight |
grind | Categorical | Whole or ground | Product grind form |
The following columns were excluded from model inputs:
| Column | Reason |
|---|---|
source_id | Row identifier |
parent_id | Augmentation provenance |
augmentation | Augmentation metadata |
is_augmented | Augmentation metadata |
brand | Could allow memorization of brand-specific prices |
price_usd | Contains direct price information |
price_per_oz | Directly defines the target |
is_premium | Prediction target |
Because is_premium is derived from price per ounce, including price_usd or price_per_oz would create direct target leakage.
The published training split contains augmented children produced by the dataset author.
The source dataset documents two augmentation approaches:
Categorical values and the binary target were inherited from the corresponding parent record.
Validation and test products were not used as augmentation parents. This model-training notebook did not generate additional synthetic records.
The notebook performed the following steps:
train, validation, and test splits.AutoGluon performed its own internal categorical encoding, feature transformation, and model-specific preprocessing.
No scaler or encoder was manually fitted using validation or test data.
| Setting | Value |
|---|---|
| Library | AutoGluon Tabular 1.6.1 |
| Problem type | Binary classification |
| Positive class | 1 |
| Selection metric | Balanced accuracy |
| Preset | medium_quality |
| Maximum training budget | 300 seconds |
| Bagging folds | 0 |
| Stacking levels | 0 |
| Notebook seed | 24679 |
| Validation data | Published validation originals |
| Test data | Published test originals |
Bagging and stacking were disabled because the training data contain related augmented children. Randomly distributing related records across internal folds could produce optimistic performance estimates.
This experiment used the candidate model configurations supplied by AutoGluon's medium_quality preset.
This was a budgeted AutoML model-family and configuration search rather than a manually defined exhaustive grid search.
The models fitted in this run were:
LightGBMXTLightGBMXGBoostLightGBMLargeWeightedEnsemble_L2NeuralNetTorchNeuralNetFastAIRandomForestEntrRandomForestGiniExtraTreesGiniExtraTreesEntrThe complete stored configuration for every fitted model is included in:
all_model_hyperparameters.json
The selected-model configuration is also included separately in:
best_hyperparameters.json
Models were ranked using validation balanced accuracy. Balanced accuracy is a unitless proportion between 0 and 1.
| model | score_val | fit_time | pred_time_val |
|---|---|---|---|
| LightGBMXT | 1 | 3.91 | 0.0037 |
| LightGBM | 1 | 0.53 | 0.005 |
| XGBoost | 1 | 0.85 | 0.0052 |
| LightGBMLarge | 1 | 0.93 | 0.0064 |
| WeightedEnsemble_L2 | 1 | 0.99 | 0.0072 |
| NeuralNetTorch | 1 | 6.09 | 0.0101 |
| NeuralNetFastAI | 1 | 1.98 | 0.0207 |
| RandomForestEntr | 1 | 0.85 | 0.047 |
| RandomForestGini | 1 | 0.89 | 0.0573 |
| ExtraTreesGini | 1 | 0.86 | 0.0787 |
| Item | Result |
|---|---|
| Selected model | WeightedEnsemble_L2 |
| Validation balanced accuracy | 1.0000 |
| Selection rule | Highest validation balanced accuracy |
The selected model's stored hyperparameters are available in best_hyperparameters.json.
Selected-model configuration:
{
"ag_args_ensemble": {
"save_bag_folds": true
}
}
If the selected model is a weighted ensemble, the model archive contains the fitted component models and learned ensemble configuration.
The selected model was evaluated once on 6 held-out original products.
Classification metrics are unitless proportions between 0 and 1.
| Metric | AutoGluon model | Majority baseline |
|---|---|---|
| Accuracy | 0.6667 | 0.5000 |
| Balanced accuracy | 0.6667 | 0.5000 |
| Precision | 0.6667 | 0.0000 |
| Recall | 0.6667 | 0.0000 |
| F1 score | 0.6667 | 0.0000 |
Accuracy difference from the majority baseline:
+0.1667
Rows represent actual classes and columns represent predicted classes.
| Actual / Predicted | Standard-priced | Premium-priced |
|---|---|---|
| Standard-priced | 2 | 1 |
| Premium-priced | 1 | 2 |
Detailed row-level predictions are available in test_predictions.csv.
The test set contains only 6 independent products.
The 95% Wilson confidence interval for test accuracy is:
[0.3000, 0.9032]
One test prediction changes accuracy by approximately 16.7 percentage points.
The confidence interval is wide because the independent test set is small. These point estimates should be interpreted as preliminary coursework results rather than precise estimates of real-world performance.
The complete native AutoGluon predictor is stored in:
coffee_autogluon_predictor.zip
The archive contains the fitted predictor, preprocessing metadata, candidate models, selected model, and ensemble information.
Install the required AutoGluon version:
%pip install "autogluon.tabular==1.6.1"
Download and extract coffee_autogluon_predictor.zip. Then load the extracted directory:
from autogluon.tabular import TabularPredictor
predictor = TabularPredictor.load(
"path/to/extracted_predictor"
)
predictions = predictor.predict(
new_data
)
The input DataFrame must contain:
originaltitude_maslaltitude_statedprocessingroast_levelweight_ggrind| File | Contents |
|---|---|
coffee_autogluon_predictor.zip | Native trained AutoGluon predictor |
leaderboard.csv | Candidate validation results |
test_metrics.csv | Final test metrics |
baseline_comparison.csv | Model and baseline comparison |
test_predictions.csv | Row-level test predictions |
best_hyperparameters.json | Selected-model configuration |
all_model_hyperparameters.json | All stored model configurations |
requirements.txt | Package requirements |
README.md | Model Card |
The model may perform poorly on:
The dataset describes retail products and contains no personal or sensitive human information.
Predictions must not be interpreted as objective measures of:
The model should not be used to make unsupported claims about brands, products, producers, or origins.
The source dataset is released under the MIT License.
This model repository is also released under the MIT License for educational and coursework use.
medium_qualityPackage installation, data download, evaluation, compression, and upload time were not included in the 300-second training budget.
Reproducibility information includes:
Some underlying model implementations may still produce small numerical differences across hardware or library builds.
Generative AI tools were used to assist with drafting, organizing, and debugging portions of the notebook code and documentation.
The reported metrics were produced by executing the notebook and were not generated or estimated by the AI tool.