Skip to main content

Building a US Visa Prediction System: From EDA to Deployment

A deep technical dive into building an ML system that predicts PERM labor certification outcomes, covering EDA on 25K records, model selection across 5 boosting algorithms, threshold tuning for class imbalance, SHAP explainability, and deployment on Hugging Face Spaces.

15 min read
Machine LearningClassificationSHAPXGBoostFastAPIMLOpsExplainable AI
Building a US Visa Prediction System: From EDA to Deployment

Frequently Asked Questions

How accurate is the US visa (PERM) prediction model?

The production model is threshold-tuned Gradient Boosting: 73.2% test accuracy with 61.4% recall on denials across a 5,096-case hold-out set. Accuracy was traded down slightly to catch more at-risk cases.

Why not use SMOTEENN to fix the class imbalance?

SMOTEENN inflated cross-validation scores but didn't generalize. The models overfit synthetic samples near the decision boundary. Training on the natural 2:1 distribution and tuning the threshold to 0.37 worked better.

Is the visa predictor legal advice?

No. It's an informational risk indicator built on historical DOL patterns, hosted free, with a SHAP explanation for every prediction. It is not a decision tool or a substitute for an immigration attorney.

How does the model explain its predictions?

SHAP's TreeExplainer computes each feature's contribution, aggregated from ~20 encoded features back to the 10 original ones, with a rule-based fallback so every prediction gets a human-readable explanation even when SHAP fails.