Instructions to use agenthinkmesh/gcc_energy_realestate_ai with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use agenthinkmesh/gcc_energy_realestate_ai with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("agenthinkmesh/gcc_energy_realestate_ai", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
GCC Energy & Real Estate AI: 10-Model Suite
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:
- Energy: oil revenue, oil-field production decline, building energy use, solar PV output, water demand and household energy poverty.
- Real estate: property prices, commercial rents, investment risk and construction delays.
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
Models
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:
- Regression candidates:
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)
- Classification candidates: the matching classifiers, plus
LogisticRegression(max_iter=300). - Every candidate uses
random_state=42. Each candidate's CV score is stored underall_scoresin 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 electricity bill is more than 10% of income;
- it is an "Expat-Labor" household with income below 300 KWD;
- it receives no subsidy and the bill is more than 8% of income.
The class balance was not recorded.
Dashboard
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.
Repository files
| 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 |
Training data
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.
- Regression targets are hand-written formulas plus Gaussian noise, clipped to a range. For example, the property price is area × a base rate × fixed city and property-type multipliers, plus fixed premiums for bedrooms, pool, sea view, maid room and driver room, minus a building-age discount, plus noise. The model is trained on
log1p(price). - Classification labels come from thresholds or rules applied to hand-written scores, as described above.
- Unused inputs: several inputs do not appear in the generating formulas. Some formulas include an input that is not passed to the model. For example,
sovereign_fund_drawaffects oil revenue but is not a model feature. - Train/test protocol: an 80/20 train/test split (
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.
Features / inputs
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 Revenue (19 features):
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_mbpd - Property Price (20 features):
city_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_enccodes: 0=Apartment, 1=Duplex, 2=Penthouse, 3=Studio, 4=Townhouse, 5=Villa.
- Building Energy (19 features):
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_enccodes: 0=Commercial, 1=Government, 2=Hospital, 3=Hotel, 4=Industrial, 5=Mixed, 6=Residential.
- Solar PV (20 features):
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, dni - RE Investment Risk (20 features):
itype_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_enccodes: 0=Commercial, 1=Hospitality, 2=Industrial, 3=Land, 4=Mixed-Use, 5=Residential.
- Water Demand (20 features):
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_demand - Oil Field Decline (20 features):
formation_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_enccodes: 0=Ahmadi, 1=Burgan, 2=Magwa, 3=Mauddud, 4=Minagish, 5=Ratawi, 6=Wara.
- Commercial Rent (20 features):
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_enccodes: 0=Co-Working, 1=Office A, 2=Office B, 3=Retail High St, 4=Retail Mall, 5=Showroom, 6=Warehouse.
- Construction Delay (20 features):
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_enccodes: 0=Commercial, 1=Hospital, 2=Industrial, 3=Infrastructure, 4=Mixed Use, 5=Residential Tower, 6=School, 7=Villa Complex.cont_enccodes: 0=JV, 1=Tier1-GCC, 2=Tier1-International, 3=Tier2-Local, 4=Tier3-Small.
- Energy Poverty (20 features):
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_enccodes: 0=Bidun, 1=Expat-Labor, 2=Expat-Professional, 3=Kuwaiti-National, 4=Mixed.
How to use
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.
Intended use
- Demonstrating and teaching a tabular AutoML workflow on GCC energy and real-estate themes.
- Prototyping dashboards, APIs or what-if tools before real data is available.
- A template for retraining on real market, utility or field data.
Limitations and risks
- Synthetic data only. Every relationship in the data was written by hand in the script. None of the models has been validated against real oil-market, reservoir, utility, solar, property-transaction or construction data. Do not use them for fiscal forecasting, reservoir management, valuations, lending, investment or policy decisions.
- High scores are not evidence of real-world skill. R² values of 0.95 to 0.999 show that the model recovers a simple formula. Water Demand, for example, is largely driven by
population_kandprev_day_demandby construction. - Unit inconsistency: the Oil Revenue target unit is mislabelled in the metadata (see Training data). The Property Price model outputs log price, so its MAE of 0.0493 is on the log scale.
- Class balance:
- Construction Delay: always predicting "On Time" would already score about 0.60.
- RE Investment Risk: the three classes are unbalanced because of equal-width binning.
- All classifiers: only accuracy is reported. There is no precision, recall or calibration.
- Sensitive attributes: the Energy Poverty model uses household type, which encodes nationality and residency status (for example "Bidun" and "Expat-Labor"). The synthetic label itself depends on the "Expat-Labor" category. Any real-world use would need fairness and legal review.
- Pickle safety:
.pklfiles can execute code when loaded. Only load files you trust.
License
MIT
Citation
@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}}
}
- Downloads last month
- -
