The RandomForest Regressor achieved the best performance.
1pip install scikit-learn joblib
2import joblib
3import numpy as np
4
5# Load preprocess and model
6preprocess = joblib.load("preprocess.joblib")
7model = joblib.load("model.joblib")
8
9# Example input: replace with real sample (shape must match training features)
10X_new = np.array([[5.1, 3.5, 1.4, 0.2]]) # dummy
11X_new_p = preprocess.transform(X_new)
12
13# Predict firmness
14y_pred = model.predict(X_new_p)
15print("Predicted firmness:", y_pred)
16
17## Dependencies
18
19numpy==1.26.4
20
21scikit-learn==1.4.2
22
23pandas==2.2.2
24
25joblib
26
27@dataset{rlogh_grape_firmness_2024,
28 title={Grape Firmness Dataset},
29 author={rlogh},
30 year={2024},
31 url={https://huggingface.co/datasets/rlogh/grape-firmness-dataset}
32}