Machine Learning & MLOps ·
US Visa Approval Prediction
ML-Powered PERM Certification Predictor with SHAP Explainability
Built with Python · Scikit-learn · XGBoost · LightGBM · CatBoost · SHAP · FastAPI · Docker
Machine Learning & MLOps ·
ML-Powered PERM Certification Predictor with SHAP Explainability
Built with Python · Scikit-learn · XGBoost · LightGBM · CatBoost · SHAP · FastAPI · Docker
When a U.S. employer wants to hire a foreign worker permanently, they file a PERM labor certification with the Department of Labor. The process is opaque, takes 6-18 months, and costs $5,000-$15,000 in legal fees. A denial means starting over.
This system predicts whether a PERM application will be certified or denied, and explains why, so applicants and attorneys can judge case strength before they file. It follows CRISP-DM and runs on a modular MLOps pipeline.

A Gradient Boosting classifier predicts certification or denial at 73.2% accuracy. Every prediction comes with a SHAP explanation of which factors help and hurt the application, presented as strengths, weaknesses, and suggestions, plus a calibrated probability with high/moderate/low confidence bands. The decision threshold is 0.37 rather than the default 0.5, which trades 1.5% accuracy for +11% denied recall, the right trade for an advisory tool. Training runs through a 5-stage pipeline: ingestion, validation (KS drift detection), transformation, training (GridSearchCV across 5 models), and evaluation with gated promotion. When SHAP hits an edge case, a rule-based fallback supplies the explanation instead, so no prediction ships without one.
Each pipeline stage produces artifact dataclasses consumed by the next. The training pipeline evaluates Random Forest, Gradient Boosting, XGBoost, LightGBM, and CatBoost via GridSearchCV with 5-fold cross-validation, followed by a stacking ensemble and threshold tuning. The final model is promoted only if it beats the existing model's F1 by a configurable margin.
Preprocessing is a scikit-learn ColumnTransformer with ordinal encoding for ordered features, one-hot encoding for nominal features, and Yeo-Johnson power transforms for skewed numerics. The preprocessor and model are serialized together so inference matches training.
| Metric | Value |
|---|---|
| Overall accuracy | 73.2% (vs 66.8% naive baseline) |
| Denied recall | 61.4% |
| Denied F1 | 60.4% |
| Certified recall | 79.1% |
| Optimal threshold | 0.37 |
The model catches 61.4% of actual denials while keeping overall accuracy reasonable. For cases it flags as at-risk, the SHAP explanation points to the specific factors behind the call.
Every prediction comes with SHAP values mapped back to the original 10 input features. Negative values are factors pushing toward certification (strengths); positive values push toward denial (weaknesses). One-hot encoded SHAP values are aggregated back to their original feature names so the output is actually readable.
Probability calibration with Platt scaling would give better-calibrated confidence scores. Adding SOC codes, NAICS industry codes, and wage ratios as features could improve accuracy. Temporal weighting would help track shifts in DOL decision patterns. Automated SHAP-based fairness auditing across model versions would catch bias drift. And scheduled retraining triggered by quarterly DOL data releases would keep the model current.