Views
No views yet
| Category | Features |
|---|---|
| Sentinel-2 (Optical) | S2_B2, S2_B3, S2_B4, S2_B8, S2_B11, S2_NDVI |
| Sentinel-1 (Radar) | S1_VV, S1_VH |
| Terrain | elevation, slope, aspect |
| Climate | precip_annual, temp_mean |
| Soil/Location | soil_texture, latitude, longitude |
1import xgboost as xgb
2from huggingface_hub import hf_hub_download
3import pandas as pd
4
5# 1. Download Model
6model_path = hf_hub_download(
7 repo_id="mona0125/soc-estimation-ne-india",
8 filename="soc_estimation_model_ne_india.json"
9)
10
11# 2. Load Model
12model = xgb.XGBRegressor()
13model.load_model(model_path)
14
15# 3. Predict (Example Data)
16# Ensure columns match the Feature Inputs list above!
17data = pd.DataFrame({
18 'S2_B2': [0.03], 'S2_B3': [0.05], 'S2_B4': [0.04], 'S2_B8': [0.25], 'S2_B11': [0.15], 'S2_NDVI': [0.72],
19 'S1_VV': [-8.5], 'S1_VH': [-14.2],
20 'elevation': [150], 'slope': [5.5], 'aspect': [120],
21 'precip_annual': [1800], 'temp_mean': [24.5],
22 'soil_texture': [2], 'latitude': [26.1], 'longitude': [91.7]
23})
24
25prediction = model.predict(data)
26print(f"Predicted SOC: {prediction[0]:.2f} g/kg")