This repository contains ten small scikit-learn models for energy and real-estate questions in the Gulf Cooperation Council (GCC) region, with a Kuwait focus. They cover:
A simple AutoML loop picked each model by comparing 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 energy and property analysts, students and developers. It is not a validated forecasting or valuation tool.
Author: AgenThink, Kuwait City
The selected algorithm for each task 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 (target) | Type | Selected algorithm | CV score | Test score | Test MAE |
|---|---|---|---|---|---|---|---|
| 1 | model_oil_revenue.pkl |
Kuwait Oil Revenue (revenue_bkwd) |
Regression | GradientBoosting | R² 0.9902 | R² 0.9913 | 1130.4315 |
| 2 | model_property_price.pkl |
GCC Property Price (log1p(price_kwd)) |
Regression | GradientBoosting | R² 0.9830 | R² 0.9828 | 0.0493 (log scale) |
| 3 | model_building_energy.pkl |
Building Energy (kwh_per_sqm_month) |
Regression | GradientBoosting | R² 0.9581 | R² 0.9607 | 1.2083 |
| 4 | model_solar_pv.pkl |
Solar PV Output (pv_output_kwh_day) |
Regression | GradientBoosting | R² 0.9624 | R² 0.9562 | 1.2797 |
| 5 | model_re_investment_risk.pkl |
Real Estate Investment Risk | Classification (3 classes) | GradientBoosting | Acc 0.9453 | Acc 0.9567 | – |
| 6 | model_water_demand.pkl |
Water Demand (demand_migd) |
Regression | GradientBoosting | R² 0.9988 | R² 0.9990 | 9.8806 |
| 7 | model_oilfield_decline.pkl |
Oil Field Production Decline (decline_rate_pct) |
Regression | Ridge | R² 0.9623 | R² 0.9660 | 0.4009 |
| 8 | model_commercial_rent.pkl |
Commercial Rent (rent_kwd_sqm_yr) |
Regression | GradientBoosting | R² 0.9244 | R² 0.9290 | 2.7874 |
| 9 | model_construction_delay.pkl |
Construction Delay Risk | Classification (2 classes) | GradientBoosting | Acc 0.9311 | Acc 0.9267 | – |
| 10 | model_energy_poverty.pkl |
Energy Poverty Risk | Classification (2 classes) | GradientBoosting | Acc 0.9846 | Acc 0.9862 | – |
The script fixes each candidate's hyperparameters:
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. Each candidate's CV score is stored under all_scores in the JSON file.All ten pickles were saved with scikit-learn 1.8.0. Their estimator classes, hyperparameters and named input columns match the script and the JSON file.
Class labels:
RE Investment Risk: 0 = Low, 1 = Medium, 2 = High Risk. The label comes from cutting a synthetic risk score into three equal-width bins, so the classes are not balanced.
Construction Delay: 0 = On Time, 1 = Delayed. About 40% of samples are delayed, because the label marks the top 40% of the delay score.
Energy Poverty: 0 = Not Poor, 1 = Energy Poor. The label is rule-based: a household is energy-poor if any of these is true:
The class balance was not recorded.
The training script generates this dashboard. It shows the score for each model, the chosen algorithms, views of the synthetic data and a comparison of the candidate algorithms.
| File | Size | Description |
|---|---|---|
gcc_energy_realestate_ai.py |
53 KB | Full pipeline: synthetic data generation, AutoML selection, evaluation, dashboard and model export |
automl_results.json |
16 KB | For each model: task type, selected algorithm, CV and test metrics, all candidate scores, feature list, feature importances, target name, sample count and a short domain note |
gcc_energy_realestate_dashboard.png |
1.0 MB | Results dashboard |
model_oil_revenue.pkl |
205 KB | GradientBoostingRegressor |
model_property_price.pkl |
205 KB | GradientBoostingRegressor (predicts log price) |
model_building_energy.pkl |
204 KB | GradientBoostingRegressor |
model_solar_pv.pkl |
202 KB | GradientBoostingRegressor |
model_re_investment_risk.pkl |
572 KB | GradientBoostingClassifier (3 classes) |
model_water_demand.pkl |
204 KB | GradientBoostingRegressor |
model_oilfield_decline.pkl |
1 KB | Ridge regressor |
model_commercial_rent.pkl |
205 KB | GradientBoostingRegressor |
model_construction_delay.pkl |
205 KB | GradientBoostingClassifier |
model_energy_poverty.pkl |
204 KB | GradientBoostingClassifier |
README.md |
– | This model card |
No real-world data was used. For each task, gcc_energy_realestate_ai.py generates 12,000 synthetic rows (n_samples in the JSON) from NumPy random distributions with seed 42. The distribution ranges were chosen to look plausible for the GCC. For example, Kuwait oil production is drawn around 2.7 million barrels per day, the USD/KWD rate around 0.307, and summer temperatures up to 46 °C.
log1p(price).sovereign_fund_draw affects oil revenue but is not a model feature.random_state=42), 3-fold CV on the training portion to select a model, a refit on that 80%, and scoring on the 20% hold-out.Unit caveat for Oil Revenue: the JSON labels the target "billion KWD", but the generating formula produces values clipped to 5,000–80,000. Treat the target, and its MAE of about 1,130, as an arbitrary synthetic revenue unit, not billions of KWD.
The gcc_note strings in the JSON, such as "Kuwait earns ~90% of government revenue from oil", are the author's contextual remarks. The code does not derive them, and this card does not verify them.
The input columns must use the names and order below. Every pickle stores feature_names_in_. Categorical codes come from LabelEncoder, so they follow alphabetical order. The city code used by models 2, 5 and 8 is: 0=Abu Dhabi, 1=Doha, 2=Dubai, 3=Fintas, 4=Hawalli, 5=Jabriya, 6=Kuwait City, 7=Manama, 8=Riyadh, 9=Salmiya.
oil_price_usd, production_mbpd, opec_quota_mbpd, usd_kwd_rate, global_demand_mmbpd, us_shale_output, global_inventories, geopolitical_risk, gcc_fiscal_break_even, natural_gas_revenue, refinery_utilization, petrochemical_output, inflation_global, quarter, year, ramadan_month, summer_low_demand, china_growth_pct, uae_production_mbpdcity_enc, ptype_enc, area_sqm, bedrooms, bathrooms, floor_number, building_age_years, has_pool, has_gym, has_maid_room, has_driver_room, parking_spaces, sea_view, near_mosque, near_mall, school_district, oil_price_usd, expat_demand_idx, mortgage_rate, new_supply_unitsptype_enc codes: 0=Apartment, 1=Duplex, 2=Penthouse, 3=Studio, 4=Townhouse, 5=Villa.btype_enc, floor_area_sqm, num_floors, occupancy_rate, temperature_c, humidity_pct, solar_radiation, cooling_setpoint, insulation_grade, glazing_ratio, ac_cop, building_age_years, has_solar_panels, smart_controls, district_cooling, num_occupants, is_ramadan, sandstorm_day, electricity_tariffbtype_enc codes: 0=Commercial, 1=Government, 2=Hospital, 3=Hotel, 4=Industrial, 5=Mixed, 6=Residential.month, hour, latitude, longitude, temperature_c, humidity_pct, cloud_cover_pct, dust_aod, wind_speed_ms, panel_tilt_deg, panel_azimuth, panel_age_years, panel_efficiency, inverter_efficiency, soiling_loss, system_size_kwp, tracking_system, sandstorm_event, ghi_clear_sky, dniitype_enc, city_enc, investment_kwd, expected_yield_pct, vacancy_rate, lease_term_years, tenant_quality, oil_price_usd, expat_pop_growth, new_supply_ratio, infra_score, regulatory_risk, financing_rate, leverage_ratio, cap_rate, price_to_rent, gdp_growth, foreign_ownership, years_to_exit, developer_track_recitype_enc codes: 0=Commercial, 1=Hospitality, 2=Industrial, 3=Land, 4=Mixed-Use, 5=Residential.month, day_of_week, temperature_c, humidity_pct, population_k, residential_pct, industrial_pct, agricultural_pct, desalination_capacity, groundwater_draw, water_tariff, is_ramadan, is_eid, is_weekend, expat_pct, irrigation_season, water_loss_pct, hotel_occupancy, gdp_per_capita, prev_day_demandformation_enc, field_age_years, initial_production, current_production, reservoir_pressure, water_cut_pct, gas_oil_ratio, well_count, injection_wells, water_injection_rate, eor_applied, api_gravity, porosity, permeability_md, depth_ft, temperature_res_f, opec_quota_compliance, maintenance_downtime, years_since_workover, secondary_recoveryformation_enc codes: 0=Ahmadi, 1=Burgan, 2=Magwa, 3=Mauddud, 4=Minagish, 5=Ratawi, 6=Wara.stype_enc, city_enc, area_sqm, floor_level, building_grade, fit_out_quality, parking_ratio, occupancy_nearby, foot_traffic_score, oil_price_usd, lease_duration_yrs, anchor_tenant, free_zone, distance_cbd_km, has_backup_power, broadband_speed, vacancy_building, new_supply_6m, gdp_growth, expat_business_idxstype_enc codes: 0=Co-Working, 1=Office A, 2=Office B, 3=Retail High St, 4=Retail Mall, 5=Showroom, 6=Warehouse.ptype_enc, cont_enc, project_value_mkwd, planned_months, floors, num_subcontractors, labor_nationality_diversity, summer_months_overlap, ramadan_months_overlap, material_local_pct, design_changes_exp, permit_complexity, client_type, financing_secured, bim_used, past_delays_contractor, geotechnical_risk, supply_chain_risk, labor_availability, weather_risk_scoreptype_enc codes: 0=Commercial, 1=Hospital, 2=Industrial, 3=Infrastructure, 4=Mixed Use, 5=Residential Tower, 6=School, 7=Villa Complex.cont_enc codes: 0=JV, 1=Tier1-GCC, 2=Tier1-International, 3=Tier2-Local, 4=Tier3-Small.htype_enc, monthly_income_kwd, household_size, dwelling_type, area_sqm, ac_units, monthly_elec_bill, monthly_water_bill, subsidy_recipient, energy_literacy, has_solar, building_efficiency, temperature_avg, debt_burden, employment_status, num_dependents, overcrowding_idx, subsidy_reform_exp, remittance_burden, years_in_gcchtype_enc codes: 0=Bidun, 1=Expat-Labor, 2=Expat-Professional, 3=Kuwaiti-National, 4=Mixed.The script saves the models with joblib.dump, so load them with joblib. Use scikit-learn 1.8.0 to match the version that saved them.
import joblib
import numpy as np
import pandas as pd
from huggingface_hub import hf_hub_download
path = hf_hub_download("agenthinkmesh/gcc_energy_realestate_ai", "model_property_price.pkl")
model = joblib.load(path)
X = pd.DataFrame([{
"city_enc": 9, # Salmiya
"ptype_enc": 0, # Apartment
"area_sqm": 150.0,
"bedrooms": 3,
"bathrooms": 2,
"floor_number": 8,
"building_age_years": 10.0,
"has_pool": 1,
"has_gym": 1,
"has_maid_room": 1,
"has_driver_room": 0,
"parking_spaces": 2,
"sea_view": 0,
"near_mosque": 1,
"near_mall": 1,
"school_district": 3,
"oil_price_usd": 80.0,
"expat_demand_idx": 0.6,
"mortgage_rate": 5.5,
"new_supply_units": 1500.0,
}])[list(model.feature_names_in_)]
log_price = model.predict(X)
print(np.expm1(log_price)) # the model predicts log1p(price_kwd); invert with expm1
automl_results.json lists the expected columns for every model under <model_key>.features. The classifiers also support predict_proba.
Rerunning the training pipeline
pip install numpy pandas matplotlib scikit-learn==1.8.0 joblib
# The script writes to OUT = "/home/claude/gcc_energy_realestate_ai" (line 39); edit this path first.
python gcc_energy_realestate_ai.py
The script writes all ten .pkl files, automl_results.json, the dashboard PNG and a short README.md to OUT. That README.md would replace this card if OUT points at a clone of this repository. Exact numbers can vary slightly across NumPy and scikit-learn versions.
population_k and prev_day_demand by construction..pkl files can execute code when loaded. Only load files you trust.MIT
@misc{agenthink2026gccenergyrealestate,
author = {AgenThink},
title = {GCC Energy \& Real Estate AI: 10-Model Suite},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/agenthinkmesh/gcc_energy_realestate_ai}}
}