This repository contains ten small scikit-learn models for agriculture and food-security questions in the Gulf Cooperation Council (GCC) region, with a Kuwait focus. They cover greenhouse crop yield, food-import risk, greenhouse energy use, irrigation water efficiency, food price inflation, livestock disease risk, desert soil quality, food waste, aquaculture output, and vertical-farm ROI. Each model was picked by a simple AutoML loop that compares five scikit-learn algorithms. All training data was generated synthetically by the training script (see Training data). The suite is a prototype and teaching reference for analysts, students and developers who work on GCC agri-food topics. It is not a validated decision tool.
Author: AgenThink, Kuwait City
"Selected algorithm" is the candidate with the best 3-fold cross-validation score on the training split. Test metrics come from a 20% hold-out split. All numbers are copied from automl_results.json.
| # | Model file | Task | Type | Selected algorithm | CV score | Test score | Test MAE |
|---|---|---|---|---|---|---|---|
| 1 | model_crop_yield.pkl |
Crop Yield Prediction (kg/m²) | Regression | Ridge | R² 0.9292 | R² 0.9282 | 0.4036 |
| 2 | model_food_import_risk.pkl |
Food Import Dependency Risk | Classification (2 classes) | GradientBoosting | Acc 0.9486 | Acc 0.9525 | – |
| 3 | model_greenhouse_energy.pkl |
Greenhouse Energy Use (kWh/m²/month) | Regression | GradientBoosting | R² 0.9843 | R² 0.9841 | 0.8461 |
| 4 | model_water_efficiency.pkl |
Water Use Efficiency (0–1) | Regression | Ridge | R² 0.9216 | R² 0.9215 | 0.0241 |
| 5 | model_food_inflation.pkl |
Food Price Inflation (%) | Regression | Ridge | R² 0.8939 | R² 0.9000 | 0.4041 |
| 6 | model_livestock_health.pkl |
Livestock Disease Outbreak Risk | Classification (2 classes) | GradientBoosting | Acc 0.9584 | Acc 0.9571 | – |
| 7 | model_soil_quality.pkl |
Desert Soil Quality Index (5–95) | Regression | Ridge | R² 0.7026 | R² 0.7041 | 4.1578 |
| 8 | model_food_waste.pkl |
Food Waste (kg/person/day) | Regression | Ridge | R² 0.8517 | R² 0.8475 | 0.1198 |
| 9 | model_aquaculture.pkl |
Aquaculture Output (tonnes/ha) | Regression | Ridge | R² 0.8873 | R² 0.8886 | 0.8112 |
| 10 | model_vertical_farm_roi.pkl |
Vertical Farm ROI (%) | Regression | RandomForest | R² 0.7979 | R² 0.8011 | 21.7183 |
Candidate algorithms and hyperparameters, as fixed in the script:
RandomForestRegressor(n_estimators=80, max_depth=10), GradientBoostingRegressor(n_estimators=80, max_depth=4, learning_rate=0.1), ExtraTreesRegressor(n_estimators=80, max_depth=10), Ridge(alpha=10.0), DecisionTreeRegressor(max_depth=8).LogisticRegression(max_iter=300).random_state=42. The CV scores of every candidate are stored under all_scores in automl_results.json.The pickled estimators were saved with scikit-learn 1.8.0. Their classes and hyperparameters match the table above.
Class labels for the classifiers:
The training script generates this dashboard. It shows the score of each model, the feature importances of the two classifiers, several views of the synthetic data, and a heatmap comparing the five candidate algorithms on every task.
| File | Size | Description |
|---|---|---|
gcc_agriculture_ai.py |
36 KB | Full pipeline: synthetic data generation, AutoML selection, evaluation, dashboard, model export |
automl_results.json |
16 KB | Per-model task type, selected algorithm, CV and test metrics, all candidate scores, feature list, feature importances, short domain note |
gcc_agriculture_ai_dashboard.png |
643 KB | Results dashboard (see above) |
model_crop_yield.pkl |
1 KB | Ridge regressor |
model_food_import_risk.pkl |
202 KB | GradientBoostingClassifier |
model_greenhouse_energy.pkl |
205 KB | GradientBoostingRegressor |
model_water_efficiency.pkl |
1 KB | Ridge regressor |
model_food_inflation.pkl |
1 KB | Ridge regressor |
model_livestock_health.pkl |
204 KB | GradientBoostingClassifier |
model_soil_quality.pkl |
1 KB | Ridge regressor |
model_food_waste.pkl |
1 KB | Ridge regressor |
model_aquaculture.pkl |
1 KB | Ridge regressor |
model_vertical_farm_roi.pkl |
6.1 MB | RandomForestRegressor |
README.md |
– | This model card |
No real-world data was used. For each model, gcc_agriculture_ai.py generates 12,000 synthetic rows with NumPy random distributions (seed 42). These include uniform, normal, lognormal, beta, Poisson and binomial distributions, with ranges chosen to look plausible for the GCC.
random_state=42). Model selection uses 3-fold CV on the 80% part. The chosen model is refit on the 80% part and scored on the 20% hold-out.The gcc_note strings in automl_results.json are contextual remarks written by the author, for example "95% of GCC food is imported". The code does not derive them from data, and this card does not independently verify them.
Each model expects a pandas DataFrame whose columns have exactly the names and order below. The pickles store feature_names_in_. Categorical codes come from LabelEncoder, so they follow alphabetical order.
crop_enc, greenhouse, area_sqm, temperature_c, humidity_pct, co2_ppm, light_hours, water_liters_sqm, fertilizer_kg_sqm, soil_ec, soil_ph, pest_pressure, seed_quality, sandstorm_days, worker_skill, irrigation_type, season, subsidy_received, automation_levelcrop_enc: 0=Barley, 1=Cucumber, 2=Dates, 3=Herbs, 4=Lettuce, 5=Pepper, 6=Tomato, 7=Wheat.oil_price_usd, food_import_pct, strategic_reserve_months, local_production_pct, shipping_disruption, geopolitical_risk, gcc_gdp_growth, currency_reserve_busd, supplier_diversity, water_availability, arable_land_pct, population_growth, food_waste_pct, climate_shock, wheat_price_usd, rice_price_usd, meat_price_usd, inflation_global, port_capacity_util, halal_cert_availarea_sqm, crop_type_enc, target_temp_c, outside_temp_c, solar_radiation, humidity_target, co2_injection, lighting_type, insulation_grade, cooling_system, ventilation_auto, has_solar_panels, smart_controls, water_recycle, season, sandstorm_freq, electricity_tariff, automation_level, age_yearscrop_type_enc is a random integer from 0 to 7 with no defined mapping.crop_enc, irrigation_type, area_sqm, soil_type, temperature_c, humidity_pct, wind_speed, solar_rad, water_salinity, treated_wastewater, desalinated_pct, mulching, greenhouse_cover, sensor_monitoring, water_tariff, season, farmer_experience, govt_subsidy, aquifer_depth, recycling_ratemonth, year, oil_price_usd, usd_kwd, global_food_idx, wheat_price, shipping_cost_idx, is_ramadan, is_eid, import_disruption, local_supply_pct, gcc_inflation, population_growth, subsidy_level, forex_reserves, consumer_confidence, prev_month_inflation, climate_shock, halal_premium, cold_chain_costanimal_enc, herd_size, age_months, temperature_c, humidity_pct, water_quality, feed_quality, vaccination_current, vet_visits_yr, crowding_idx, sandstorm_exposure, import_origin, quarantine_days, housing_quality, prev_disease_hx, antibiotic_use, stress_score, nutrition_score, is_imported, ramadan_seasonanimal_enc: 0=Camel, 1=Cattle, 2=Fish, 3=Goat, 4=Poultry, 5=Sheep.region, depth_cm, sand_pct, silt_pct, clay_pct, organic_matter_pct, ph, ec_ds_m, nitrogen_ppm, phosphorus_ppm, potassium_ppm, calcium_ppm, gypsum_pct, heavy_metals_idx, water_holding, microbial_activity, amendments_applied, years_cultivated, rainfall_mm_yr, irrigation_historysector_enc, month, is_ramadan, is_eid, household_size, income_tier, expat_pct, buffet_style, portion_control, cold_chain_quality, food_literacy, temperature_c, storage_quality, purchase_planning, delivery_spoilage, menu_diversity, overbuying_idx, awareness_campaign, penalty_regime, composting_availsector_enc: 0=Catering, 1=Hospital, 2=Hotel, 3=Household, 4=Restaurant, 5=School, 6=Supermarket.species_enc, farm_area_ha, stocking_density, water_temp_c, salinity_ppt, dissolved_oxygen, ph, feed_conversion_ratio, disease_incidence, water_exchange_rate, aeration_quality, feed_quality, monitoring_freq, harvest_cycle_days, survival_rate_prev, summer_mortality_risk, desalination_proximity, govt_support, export_market, technology_levelspecies_enc: 0=Hamour, 1=Kingfish, 2=Oyster, 3=Seabass, 4=Seabream, 5=Shrimp, 6=Tilapia.farm_size_sqm, crop_enc, growing_layers, led_efficiency, automation_pct, yield_kg_sqm_yr, electricity_cost_kwd, water_cost_kwd, labor_cost_kwd_mo, selling_price_kwd_kg, local_market_share, supermarket_contract, hotel_contract, govt_subsidy, capex_mkwd, loan_rate, tech_partner, years_operation, halal_certified, organic_certifiedOrdinal scores such as pest_pressure, seed_quality and automation_level are integers from 1 to 5. Binary flags are 0 or 1. See the script for the exact range of each column.
The models were saved with joblib.dump. Load them with joblib and use the same scikit-learn version (1.8.0) to avoid unpickling warnings or incompatibilities.
import joblib
import pandas as pd
from huggingface_hub import hf_hub_download
path = hf_hub_download("agenthinkmesh/gcc_agriculture_ai", "model_crop_yield.pkl")
model = joblib.load(path)
X = pd.DataFrame([{
"crop_enc": 6, # Tomato
"greenhouse": 1,
"area_sqm": 500.0,
"temperature_c": 30,
"humidity_pct": 60.0,
"co2_ppm": 900.0,
"light_hours": 12.0,
"water_liters_sqm": 20.0,
"fertilizer_kg_sqm": 1.5,
"soil_ec": 2.5,
"soil_ph": 6.8,
"pest_pressure": 2,
"seed_quality": 4,
"sandstorm_days": 2,
"worker_skill": 3,
"irrigation_type": 2,
"season": 1,
"subsidy_received": 1,
"automation_level": 3,
}])[list(model.feature_names_in_)]
print(model.predict(X)) # predicted yield, kg per m²
For the classifiers (model_food_import_risk.pkl, model_livestock_health.pkl), predict returns 0 or 1 and predict_proba returns class probabilities. The expected column list for any model is also in automl_results.json under <model_key>.features.
Rerunning the training pipeline
pip install numpy pandas matplotlib scikit-learn==1.8.0 joblib
# The script writes to OUT="/home/claude/gcc_agriculture_ai" (line 29); edit that path first.
python gcc_agriculture_ai.py
The script regenerates all ten .pkl files, automl_results.json, the dashboard PNG, and a short README.md in the output directory. If OUT points at a clone of this repository, that README.md overwrites this model card. The random seed is fixed, but exact numbers can still differ slightly across NumPy and scikit-learn versions.
crop_type_enc in Greenhouse Energy, crop_enc in Water Efficiency and Vertical Farm ROI) are random integers with no defined category mapping..pkl files can execute code when loaded. Only load them from a source you trust.MIT
@misc{agenthink2026gccagriculture,
author = {AgenThink},
title = {GCC Agriculture \& Food Security AI: 10-Model Suite},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/agenthinkmesh/gcc_agriculture_ai}}
}