--- license: mit --- # 🍇 Grape Firmness AutoML Model ## Model Details - **Model type**: RandomForest Regressor (selected by AutoML search) - **Framework**: scikit-learn - **Preprocessing**: Custom feature engineering and scaling (`preprocess.joblib`) - **Files**: - `model.joblib` — trained RandomForest model - `preprocess.joblib` — preprocessing pipeline (feature transforms) --- ## Task **Regression**: Predict grape firmness (continuous value) from structured features. This task is designed to explore *Classical AutoML* approaches for tabular datasets. --- ## Dataset - **Source**: [rlogh/grape-firmness-dataset](https://huggingface.co/datasets/rlogh/grape-firmness-dataset) - **Samples**: ~X rows, Y features (replace with actual numbers if needed) - **Split**: 70% train, 15% validation, 15% test - **Target**: `firmness` (numerical label) --- ## Training Procedure - **AutoML approach**: grid search across models (RandomForest, SVR, etc.) - **Search space**: - `RandomForestRegressor` — tuned `n_estimators`, `max_depth` - `SVR` — tuned `C`, `kernel` - **Evaluation metric**: R² score (maximize) - **Validation**: stratified split for regression --- ## Results On the **held-out test set**: - **RMSE**: 0.177 - **R²**: 0.943 The RandomForest Regressor achieved the best performance. --- ## Limitations - **Small dataset size** → may not generalize to unseen grape varieties or measurement settings. - **Not production-ready** → purely academic demonstration. - **Feature engineering is minimal** → no domain knowledge incorporated. --- ## How to Use ### Install requirements ```bash pip install scikit-learn joblib import joblib import numpy as np # Load preprocess and model preprocess = joblib.load("preprocess.joblib") model = joblib.load("model.joblib") # Example input: replace with real sample (shape must match training features) X_new = np.array([[5.1, 3.5, 1.4, 0.2]]) # dummy X_new_p = preprocess.transform(X_new) # Predict firmness y_pred = model.predict(X_new_p) print("Predicted firmness:", y_pred) ## Dependencies numpy==1.26.4 scikit-learn==1.4.2 pandas==2.2.2 joblib @dataset{rlogh_grape_firmness_2024, title={Grape Firmness Dataset}, author={rlogh}, year={2024}, url={https://huggingface.co/datasets/rlogh/grape-firmness-dataset} }