Instructions to use agenthinkmesh/gcc_government_hr_ai with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use agenthinkmesh/gcc_government_hr_ai with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("agenthinkmesh/gcc_government_hr_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 Government & HR AI: 10-Model Suite
This repository contains ten scikit-learn models for public-sector workforce and government-operations questions in the Gulf Cooperation Council (GCC), with a Kuwait focus. The models cover civil-service attrition, expat visa approval, project delay risk, budget forecasting, Kuwaitization rate, employee performance, public-service demand, procurement-fraud screening, salary benchmarking and succession readiness. One training script (gcc_government_hr_ai.py) builds all ten. For each task it generates a synthetic dataset, runs a small AutoML search over five candidate algorithms, and saves the winning model. The suite is a reference implementation and prototyping baseline for analysts and developers exploring ML in GCC government and HR settings. It is not a production decision system.
Author: AgenThink, Kuwait City
Models
All scores come from automl_results.json. "CV" is the mean 3-fold cross-validation score on the 80% training split, and that score was used to pick the algorithm. "Test" is the score on the 20% hold-out split. All data is synthetic (see Training data).
| # | File | Task | Type | Selected algorithm | CV score | Test score | Test MAE |
|---|---|---|---|---|---|---|---|
| 1 | model_civil_attrition.pkl |
Kuwait Civil Service Attrition | Classification (Stay / Leave) | RandomForest | Acc 0.940 | Acc 0.937 | — |
| 2 | model_visa_approval.pkl |
Expat Visa Approval Prediction | Classification (Rejected / Approved) | GradientBoosting | Acc 0.909 | Acc 0.906 | — |
| 3 | model_project_delay.pkl |
Government Project Delay Risk | Classification (On Time / Delayed) | GradientBoosting | Acc 0.924 | Acc 0.935 | — |
| 4 | model_budget_forecast.pkl |
Public Sector Budget Forecasting | Regression | ExtraTrees (per JSON; see warning) | R² 0.149 | R² −0.096 | 9.63 |
| 5 | model_kuwaitization.pkl |
Kuwaitization / Nationalization Rate | Regression (0–1) | Ridge | R² 0.968 | R² 0.969 | 0.0166 |
| 6 | model_employee_performance.pkl |
Employee Performance Prediction | Regression (score 20–100) | Ridge | R² 0.729 | R² 0.724 | 3.97 |
| 7 | model_public_services.pkl |
Public Services Demand Forecasting | Regression (daily transactions) | GradientBoosting | R² 0.966 | R² 0.973 | 16.95 |
| 8 | model_procurement_fraud.pkl |
Government Procurement Fraud | Classification (Clean / Suspicious) | GradientBoosting | Acc 0.981 | Acc 0.984 | — |
| 9 | model_salary_benchmark.pkl |
Salary Benchmarking & Pay Gap | Regression (base salary, KWD) | Ridge | R² 0.956 | R² 0.955 | 119.37 |
| 10 | model_succession_planning.pkl |
Workforce Succession Planning | Classification (Not Ready / Developing / Ready Now) | GradientBoosting | Acc 0.844 | Acc 0.843 | — |
Candidate algorithms, with fixed hyperparameters from the script:
- Regression: RandomForest, GradientBoosting, ExtraTrees (80 trees; max depth 10 for the forests and 4 for boosting), Ridge (alpha = 10) and DecisionTree (max depth 8).
- Classification: the same set, with LogisticRegression (max_iter = 300) in place of Ridge.
No hyperparameter tuning was done. Per-candidate CV scores are stored under all_scores in automl_results.json.
Warning:
model_budget_forecast.pkldoes not match the script or the reported scores. The committed file is aRidgemodel that expects 18 unnamed input features. The script andautoml_results.jsondescribe anExtraTreesmodel trained on the 20 named features listed below. This repository does not document where the file came from, what its feature order is, or how it scores. Treat it as unusable until it is regenerated. The reported scores are also poor (test R² −0.096): replaying the script's seeded generator shows that about 98.7% of the synthetic budget targets sit at the lower clip bound of 5,000, so the target has almost no variance to learn.
Accuracy vs. class balance
The class labels are defined by quantile or equal-width cut-offs in the script, so the class shares below are fixed by construction. They were computed by replaying the seeded data generator. Compare accuracy against the majority-class share: a model that always predicts the majority class already scores that share.
| Model | Class shares | Majority-class baseline | Test accuracy |
|---|---|---|---|
| Civil attrition | Stay 80% / Leave 20% | 0.80 | 0.937 |
| Visa approval | Rejected 35% / Approved 65% | 0.65 | 0.906 |
| Project delay | On Time 60% / Delayed 40% | 0.60 | 0.935 |
| Procurement fraud | Clean 93% / Suspicious 7% | 0.93 | 0.984 |
| Succession planning | Not Ready 16.8% / Developing 75.6% / Ready Now 7.6% | 0.756 | 0.843 |
Only accuracy was recorded. No precision, recall or F1 scores are available for the minority classes.
Dashboard
The training script generates this dashboard. It shows the model scores, an AutoML algorithm-comparison heatmap and plots of the synthetic data.
Repository files
| File | Description |
|---|---|
gcc_government_hr_ai.py |
Training script: synthetic data generation, AutoML selection, evaluation, dashboard, model export |
automl_results.json |
For each model: task, selected algorithm, CV and test scores, all candidate scores, feature list, feature importances, class names or target description, sample count |
model_*.pkl (10 files) |
Fitted scikit-learn estimators serialized with joblib (pickles record scikit-learn 1.8.0) |
gcc_government_hr_dashboard.png |
Summary dashboard image |
README.md |
This model card |
Training data
All training data is synthetic. The script generates it at run time with NumPy (np.random.seed(42)); no real employee, citizen, applicant, vendor or government records were used. Each dataset has 12,000 rows and 20 input features:
- Inputs are drawn from hand-chosen distributions (normal, lognormal, beta, Poisson, binomial, uniform). Some parameters carry comments about GCC context, such as the share of Kuwaiti nationals in government, election cycles and KIA assets, but no statistical source is cited and nothing was calibrated against official data.
- Targets come from hand-written formulas. For classification, a weighted risk score plus random noise is thresholded at a quantile (for example, the top 20% is labeled "Leave") or split into three equal-width bins (succession readiness). For regression, a linear-style formula plus noise is clipped to a range.
The models therefore learn the rules the script wrote, not real-world behavior. High scores show that a model recovers those rules, not that it predicts well on real data. Several features have no role in their target formula and act as noise.
Each dataset is split 80/20 (random_state=42).
Features / inputs
Each model expects a pandas.DataFrame with exactly these columns, in this order. Nine of the ten pickles store feature_names_in_; model_budget_forecast.pkl does not (see the warning above).
- Civil attrition:
ministry_enc, grade_enc, age, years_of_service, is_kuwaiti, is_female, salary_kwd, allowances_kwd, performance_rating, promotions_last5yr, training_days_yr, absenteeism_days_yr, overtime_hours_mo, commute_km, has_second_job, manager_satisfaction, peer_satisfaction, years_to_retirement, pension_eligibility, remote_work_days - Visa approval:
vtype_enc, nat_enc, sec_enc, age, education_level, salary_offered_kwd, sponsor_category, sponsor_compliance, years_in_gcc_prev, criminal_record, medical_clearance, docs_complete, quota_available, previous_violations, role_in_demand, oil_price_env, nationalization_pct, bilateral_agreement, processing_days, application_month - Project delay:
ptype_enc, budget_mkwd, planned_months, ministry_count, contractor_tier, foreign_contractor, design_complete_pct, land_acquired, env_clearance, funding_secured_pct, political_priority, parliament_approval, scope_changes_exp, labor_availability, summer_overlap_mo, ramadan_overlap, supply_chain_risk, prev_contractor_delays, oil_price_at_approval, election_year - Budget forecast (per script):
oil_price_usd, oil_production_mbpd, non_oil_revenue_pct, prev_year_spending, wages_bill_pct, subsidy_bill_pct, capex_pct, population_growth, inflation_rate, gdp_growth, sovereign_fund_assets, debt_to_gdp, election_year, war_risk_premium, gcc_union_transfers, us_fed_rate, china_demand_idx, diversification_score, subsidy_reform_pct, year. Targetbudget_bkwd, which the JSON describes as "million KWD". The committed pickle does not accept this schema. - Kuwaitization rate:
ind_enc, company_size, quota_required_pct, current_national_pct, avg_national_salary_kwd, avg_expat_salary_kwd, training_budget_pct, career_path_clarity, management_nationality, oil_price_usd, economic_growth, govt_incentive_score, penalty_enforcement, youth_unemployment, university_graduates_k, skills_mismatch_score, remote_work_available, private_vs_govt_wage, wps_compliance, years_since_policy - Employee performance:
dept_enc, age, education_level, years_experience, years_in_role, is_national, is_female, training_hours_yr, certifications, absenteeism_rate, overtime_willingness, kpi_prev_year, peer_review_score, innovation_ideas, projects_completed, manager_quality, team_size, remote_days, salary_satisfaction, career_growth_score - Public services demand:
stype_enc, month, day_of_week, is_ramadan, is_eid, is_summer, population_k, expat_pct, online_pct, staff_count, counter_count, avg_proc_time_min, backlog_prev_week, weather_extreme, policy_change, news_event, visa_expiry_season, academic_year_start, oil_price_env, gdp_growth - Procurement fraud:
contract_value_mkwd, num_bidders, winning_margin_pct, single_source, emergency_waiver, vendor_age_years, vendor_prev_contracts, vendor_complaints, contract_duration_mo, payment_advance_pct, subcontracting_pct, related_party, spec_tailored, late_submission, price_vs_estimate, committee_quorum, audit_trail_score, vendor_nationality, ministry_risk_score, election_proximity - Salary benchmark:
jfam_enc, ind_enc, seniority_level, years_experience, education_level, is_national, is_female, company_size, sector, certifications, bilingual, performance_rating, oil_price_env, market_demand, visa_sponsorship, housing_allowance, transport_allowance, years_in_gcc, negotiation_strength, remote_capable - Succession planning:
age, years_to_retirement, current_grade, leadership_score, technical_score, strategic_score, communication_score, performance_3yr_avg, promotion_velocity, cross_dept_experience, international_exp, advanced_degree, mentoring_others, is_national, is_female, retention_risk, critical_role, deputy_experience, training_completed, 360_feedback_score
Categorical encodings. The *_enc columns were produced with sklearn.preprocessing.LabelEncoder, which assigns integer codes in alphabetical order. The encoders are not saved, so apply these mappings yourself:
ministry_enc: 0=CSB, 1=KIA, 2=KPC, 3=MOCI, 4=MOE, 5=MOF, 6=MOFA, 7=MOH, 8=MOI, 9=MOJ, 10=Other, 11=PACIgrade_enc: 0=Grade1, 1=Grade10, 2=Grade2, 3=Grade3, …, 9=Grade9 (string sort order; not numeric)vtype_enc: 0=Domestic, 1=Family, 2=Investor, 3=Student, 4=Transit, 5=Worknat_enc: 0=Arab-Other, 1=Bangladeshi, 2=Egyptian, 3=Filipino, 4=Indian, 5=Indonesian, 6=Jordanian, 7=Nepalese, 8=Pakistani, 9=Sri Lankan, 10=Syrian, 11=Westernsec_enc: 0=Construction, 1=Domestic, 2=Education, 3=Finance, 4=Healthcare, 5=Hospitality, 6=Oil&Gas, 7=Other, 8=Retail, 9=Technologyptype_enc: 0=Defense, 1=Education, 2=Energy, 3=Healthcare, 4=Housing, 5=IT, 6=Infrastructure, 7=Socialind_enc(models 5 and 9): 0=Banking, 1=Construction, 2=Education, 3=Government, 4=Healthcare, 5=Hospitality, 6=Insurance, 7=Oil&Gas, 8=Retail, 9=Technologydept_enc: 0=Audit, 1=Communications, 2=Finance, 3=HR, 4=IT, 5=Legal, 6=Operations, 7=Procurement, 8=Strategy, 9=Technicalstype_enc: 0=Birth_Certificate, 1=Business_License, 2=Court, 3=Driving_License, 4=ID_Renewal, 5=Marriage, 6=Municipality, 7=Passport, 8=Police, 9=Property_Registrationjfam_enc: 0=Administrative, 1=Education, 2=Engineering, 3=Executive, 4=Finance, 5=HR, 6=IT, 7=Legal, 8=Medical, 9=Operations, 10=Research, 11=Technical
Other ordinal or coded inputs, such as sponsor_category, contractor_tier, vendor_nationality, sector in model 9 (0 = government, 1 = private per a code comment) and the 1–5 ratings, are random integer codes. The script gives them no further definition, so check the ranges in gcc_government_hr_ai.py before building inputs.
How to use
pip install "scikit-learn==1.8.0" joblib pandas huggingface_hub
The pickles record scikit-learn 1.8.0. Other versions may fail to load them or may print warnings.
import joblib
import pandas as pd
from huggingface_hub import hf_hub_download
path = hf_hub_download("agenthinkmesh/gcc_government_hr_ai", "model_procurement_fraud.pkl")
model = joblib.load(path) # GradientBoostingClassifier
features = ["contract_value_mkwd", "num_bidders", "winning_margin_pct", "single_source",
"emergency_waiver", "vendor_age_years", "vendor_prev_contracts", "vendor_complaints",
"contract_duration_mo", "payment_advance_pct", "subcontracting_pct", "related_party",
"spec_tailored", "late_submission", "price_vs_estimate", "committee_quorum",
"audit_trail_score", "vendor_nationality", "ministry_risk_score", "election_proximity"]
X = pd.DataFrame([{
"contract_value_mkwd": 12.5, "num_bidders": 1, "winning_margin_pct": 0.02, "single_source": 1,
"emergency_waiver": 1, "vendor_age_years": 1.5, "vendor_prev_contracts": 2, "vendor_complaints": 1,
"contract_duration_mo": 18, "payment_advance_pct": 0.40, "subcontracting_pct": 0.30, "related_party": 1,
"spec_tailored": 1, "late_submission": 0, "price_vs_estimate": 1.7, "committee_quorum": 1,
"audit_trail_score": 0.25, "vendor_nationality": 2, "ministry_risk_score": 6.0, "election_proximity": 0,
}])[features]
print(model.predict(X)) # 0 = Clean, 1 = Suspicious
print(model.predict_proba(X)) # class probabilities
For the regression models, model.predict(X) returns the target in the units given under Models.
Retraining
Requirements: numpy, pandas, matplotlib, scikit-learn, joblib.
- The output directory is hard-coded as
OUT = "/home/claude/gcc_government_hr_ai". Change it to a local path first. - Run
python gcc_government_hr_ai.py.
The script regenerates the synthetic data, reruns model selection, and writes the ten .pkl files, automl_results.json and the dashboard PNG. It also overwrites README.md in the output directory with a short scores table, so keep a copy of this card. Results may differ slightly across library versions.
Intended use
- Education, demos and prototyping of ML workflows for GCC public-sector and HR analytics.
- A starting template to retrain on properly governed real data, with its own validation.
- Examples of which kinds of features an analyst might consider for each task.
Out-of-scope use
- Any decision about a real individual: hiring, firing, promotion, pay, visa approval or rejection, performance rating, succession, or fraud accusations.
- Budget or policy planning with real fiscal consequences.
- Use as evidence of real-world relationships, for example between nationality, gender and pay.
Limitations and risks
- Synthetic data only. No model has been validated on real data. The reported scores measure how well each model recovers the script's own formulas, and say little about real-world accuracy.
- Broken or mismatched artifact.
model_budget_forecast.pkldoes not match the script or the JSON (see the warning above). Even as trained by the script, that task is degenerate: test R² −0.096, with the target almost constant at the clip floor. - Moderate or weak models: employee performance (R² 0.724) and succession planning (accuracy 0.843, with a 0.756 majority baseline).
- Imbalanced classes. Procurement fraud has 7% positives, so its 0.984 accuracy is only a few points above the 0.93 baseline. Only accuracy was measured; recall on the minority class is unknown.
- Sensitive attributes are inputs: nationality,
is_kuwaiti/is_national,is_female, age and similar. In the salary generator, nationality adds a fixed premium by design. Retraining on real data could learn and reinforce discriminatory patterns. Run fairness and legal reviews before any real use. - Unsaved encoders. Categorical encoders are not saved; wrong integer codes silently produce wrong predictions.
- Pickle security. Loading a pickle can execute arbitrary code, so load only files you trust.
- Expert review required. Outputs must not drive decisions about individuals (employees, applicants, vendors) without review by qualified HR, legal or domain experts and without a proper validation, fairness and governance process.
License
MIT, as stated in the original repository README. The repository contains no separate LICENSE file.
Citation
@misc{agenthink2026gcc_government_hr_ai,
author = {AgenThink},
title = {GCC Government \& HR AI: 10-Model Suite},
year = {2026},
howpublished = {Hugging Face model repository},
url = {https://huggingface.co/agenthinkmesh/gcc_government_hr_ai}
}
- Downloads last month
- -
