CircuitNotion/agri-ghg-yield-synthetic
Viewer • Updated • 6k
How to use CircuitNotion/agri-ghg-yield-gb with Scikit-learn:
from huggingface_hub import hf_hub_download
import joblib
model = joblib.load(
hf_hub_download("CircuitNotion/agri-ghg-yield-gb", "sklearn_model.joblib")
)
# only load pickle files from sources you trust
# read more about it here https://skops.readthedocs.io/en/stable/persistence.htmlMulti-output Gradient Boosting regressor that predicts:
| Target | Unit | Test R² |
|---|---|---|
| Crop Yield | kg/ha | 0.946 |
| N₂O Emission | kg N₂O-N/ha | 0.693 |
| CO₂ Emission | kg CO₂-C/ha | 0.922 |
| CH₄ Emission | kg CH₄/ha | 0.604 |
Average R²: 0.791
Soil: pH, N, P, K, Ca, OM, CEC, SM, SS
Weather: T, Rainfall, RH, Rad, WS, WD
Management: Fert
trained_model.pkl — MultiOutputRegressor(GradientBoostingRegressor)feature_scaler.pkl — RobustScaler fitted on training featuresimport pickle
import pandas as pd
with open("trained_model.pkl", "rb") as f:
model = pickle.load(f)
with open("feature_scaler.pkl", "rb") as f:
scaler = pickle.load(f)
features = ["pH","N","P","K","Ca","OM","CEC","SM","SS",
"T","Rainfall","RH","Rad","WS","WD","Fert"]
# example row
X = pd.DataFrame([[6.5,40,20,150,800,3.0,15,25,2.0,
22,100,60,18,2.0,180,100]], columns=features)
pred = model.predict(scaler.transform(X))
# pred columns: Crop_Yield, N2O_Emission, CO2_Emission, CH4_Emission
print(pred)
Or download from the Hub:
from huggingface_hub import hf_hub_download
import pickle
model_path = hf_hub_download("CircuitNotion/agri-ghg-yield-gb", "trained_model.pkl")
scaler_path = hf_hub_download("CircuitNotion/agri-ghg-yield-gb", "feature_scaler.pkl")
Trained on CircuitNotion/agri-ghg-yield-synthetic (6,000 synthetic agronomic samples).
Full pipeline: ntirushwajeanmarc/agriculture-ghg-yield-ml