Views
No views yet
Built by OCG Dubai — Agentic Commerce APIs for the GCC
demand_index (0-100) for retail products in GCC countries (UAE, KSA, Qatar, Kuwait, Bahrain, Oman) across 12 realistic product categories based on actual e-commerce revenue data. It captures seasonal patterns including Ramadan, Eid, shopping festivals (DSF, Riyadh Season, White Friday), and country-specific events.| Feature | Type | Description |
|---|---|---|
| month | Integer (1-12) | Gregorian month |
| day_of_week | Integer (0-6) | Day of week (Monday=0) |
| is_weekend | Binary (0/1) | Friday/Saturday (GCC weekend) |
| country_encoded | Integer | Label-encoded country |
| category_encoded | Integer | Label-encoded product category |
| temperature | Float | Temperature in Celsius |
| is_ramadan | Binary (0/1) | Whether it is Ramadan |
| ramadan_week | Integer (0-4) | Week of Ramadan (0 if not Ramadan) |
| is_eid_fitr | Binary (0/1) | Eid al-Fitr period |
| is_eid_adha | Binary (0/1) | Eid al-Adha period |
| is_shopping_festival | Binary (0/1) | Dubai Shopping Festival, Riyadh Season, Shop Qatar, etc. |
| is_white_friday | Binary (0/1) | White Friday / Black Friday sales |
| is_national_day | Binary (0/1) | Country national day events |
| is_back_to_school | Binary (0/1) | Back-to-school season |
| year | Integer | Year (2018-2025) |
| Metric | Value |
|---|---|
| R2 Score | 0.992 |
| RMSE | 2.94 |
| MAE | 2.28 |
1import joblib
2import numpy as np
3
4# Load model and encoders
5model = joblib.load("model.joblib")
6encoders = joblib.load("encoders.joblib")
7country_encoder = encoders['country_encoder']
8category_encoder = encoders['category_encoder']
9
10# Prepare features
11country_encoded = country_encoder.transform(["UAE"])[0]
12category_encoded = category_encoder.transform(["fashion_apparel"])[0]
13
14# Feature order: month, day_of_week, is_weekend, country_encoded, category_encoded,
15# temperature, is_ramadan, ramadan_week, is_eid_fitr, is_eid_adha,
16# is_shopping_festival, is_white_friday, is_national_day, is_back_to_school, year
17
18features = np.array([[
19 1, # month (January)
20 4, # day_of_week (Friday)
21 1, # is_weekend
22 country_encoded,
23 category_encoded,
24 22.0, # temperature
25 0, # is_ramadan
26 0, # ramadan_week
27 0, # is_eid_fitr
28 0, # is_eid_adha
29 1, # is_shopping_festival (DSF in January)
30 0, # is_white_friday
31 0, # is_national_day
32 0, # is_back_to_school
33 2025 # year
34]])
35
36prediction = model.predict(features)
37print(f"Predicted demand index: {prediction[0]:.2f}")model.joblib — Trained XGBoost model (sklearn-compatible)model.json — XGBoost model in JSON formatencoders.joblib — Label encoders for country and categoryconfig.json — Model configuration and metadatafeature_importances.json — Feature importance scores