{"id":23031624,"url":"https://github.com/MNitin-Reddy/Reducing-Review-Overhead-with-ML-based-Application-Screening","last_synced_at":"2025-08-14T15:31:46.303Z","repository":{"id":259037446,"uuid":"871016211","full_name":"MNitin-Reddy/Predicting-US-Visa-Approval-using-ML","owner":"MNitin-Reddy","description":"A machine learning classification project that predicts US visa approvals using historical data. It features an end-to-end implementation with CI/CD on AWS, achieving 93% accuracy with a KNN model optimized through Optuna, alongside integration of MLOps tools like Evidently and MLflow.","archived":false,"fork":false,"pushed_at":"2024-10-21T14:00:59.000Z","size":3011,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-21T22:58:03.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MNitin-Reddy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-11T05:26:10.000Z","updated_at":"2024-10-21T14:01:02.000Z","dependencies_parsed_at":"2024-10-21T23:43:35.565Z","dependency_job_id":null,"html_url":"https://github.com/MNitin-Reddy/Predicting-US-Visa-Approval-using-ML","commit_stats":null,"previous_names":["mnitin-reddy/predicting-us-visa-approval-using-ml"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MNitin-Reddy%2FPredicting-US-Visa-Approval-using-ML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MNitin-Reddy%2FPredicting-US-Visa-Approval-using-ML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MNitin-Reddy%2FPredicting-US-Visa-Approval-using-ML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MNitin-Reddy%2FPredicting-US-Visa-Approval-using-ML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MNitin-Reddy","download_url":"https://codeload.github.com/MNitin-Reddy/Predicting-US-Visa-Approval-using-ML/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229841104,"owners_count":18132559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-15T15:39:46.581Z","updated_at":"2025-08-14T15:31:46.295Z","avatar_url":"https://github.com/MNitin-Reddy.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Reducing Review Overhead with ML based Application Screening\n\n![Python](https://img.shields.io/badge/Python-3.8-FFD43B?style=for-the-badge\u0026logo=python\u0026logoColor=blue) ![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge\u0026logo=mongodb\u0026logoColor=white) ![sklearn](https://img.shields.io/badge/scikit_learn-F7931E?style=for-the-badge\u0026logo=scikit-learn\u0026logoColor=white)\n\n![GitHubActions](https://img.shields.io/badge/CI_CD_-_GitHub_Actions-2088FF?style=for-the-badge\u0026logo=github-actions\u0026logoColor=white) ![AWS](https://img.shields.io/badge/AWS-EC2%20%7C%20ECR%20%7C%20S3Bucket-FFDE21?style=for-the-badge\u0026logoColor=yellow)  ![Docker](https://img.shields.io/badge/Docker-2CA5E0?style=for-the-badge\u0026logo=docker\u0026logoColor=white)\n\n![MLflow](https://img.shields.io/badge/MLflow-experiment%20tracking-0041C2?style=for-the-badge\u0026logoColor=green.svg) ![Optuna](https://img.shields.io/badge/Optuna-hyperparameter--tuning-2B547E?style=for-the-badge\u0026logoColor=orange.svg) ![Evidently](https://img.shields.io/badge/Evidently-data%20validation-DB0F27?style=for-the-badge\u0026logoColor=brightgreen)  \n\n\n\n\n\n\n  The Immigration and Nationality Act (INA) of the United States permits foreign workers to work temporarily or permanently. It also protects US workers from adverse impacts in the workplace and enforces strict hiring requirements when employers seek to fill workforce shortages with foreign employees. These immigration programs are managed by the Office of Foreign Labor Certification (OFLC).\n\n## Problem Statement\nThe OFLC processes job certification applications from organizations looking to bring foreign workers to the United States. With an increasing volume of applications, a machine learning model is needed to efficiently shortlist visa applicants.\n\n* This project creates a classification model that determines whether a visa application should be approved or denied. The model not only forecasts results, but it also recommends profiles that are more likely to be accepted, so streamlining the decision-making process.\n\n\n## Data Collection\nThe dataset used in this project is provided by the Office of Foreign Labor Certification (OFLC).\n\n## Tech Stack\n* **Python:** Core programming language\n* **MongoDB:** Data storage\n* **Evidently:** Data validation and monitoring\n* **Optuna:** Hyperparameter tuning\n* **MLflow:** Experiment tracking\n* **GitHub Actions:** CI/CD pipeline\n* **Docker:** Containerization\n* **AWS (EC2, ECR):** Deployment platform\n\n\n## Exploratory Data Analysis:\n### Initial Analysis Report\n* __no_of_employees__ has many outliers which can be handled in Feature Engineering and no_of_employees is Right Skewed.\n* __yr_of_estab__ is left-skewed and some outliers are below the lower bound of the Box plot.\n* __prevailing_wage__ is right-skewed with outliers above the upper bound of the box plot.\n* There are No missing values in the dataset.\n* The __case_id__ column can be deleted because each row has unique values.\n* The case_status column is the target for predicting.\n* In the Categorical column, features can be made Binary/ numerical in feature Encoding\n\n### Final Analysis\n* __case_id__ column can be dropped as it is an ID.\n* The __requires_job_training__ column can be dropped as it doesn't have much impact on the target variable, as Demonstrated in visualization and the __chi2 test__.\n* __no_of_employees__, __prevailing_wage__ columns have outllier which should be handled.\n* __continent__ columns have few unique values with minimal count, which can be made as others.\n* Target column __case_status__ is imbalanced should be handled with techniques like __SMOTE__ before model building.\n\n## Flow of project\n\n* **Data Ingestion:** Load and store raw data from MongoDB to artifacts.\n\n* **Data Validation:** Validate schema and detect data drift using Evidently.\n\n* **Feature Engineering:** Handle missing values, encode categorical variables, and scale numerical features.\n\n* **Feature Selection:** Apply multicollinearity analysis and chi-squared tests to select key features.\n  \n* **Model Training:** Train on various classification models and find the best base model.\n  \n* **Hyperparameter Tuning:** Use Optuna to optimize model parameters.\n  \n* **Experiment Tracking:** Log results and experiments with MLflow.\n  \n* **CI/CD:** Automate evaluation and deployment using GitHub Actions.\n  \n* **Deployment:** Use Docker to deploy the application on AWS EC2 via ECR.\n\n## Pipeline Workflow\n\n![USVisa flowchart](https://github.com/user-attachments/assets/8b61c924-490a-4c7c-b763-5e785beee63b)\n\n## Installation\n\nClone repository:\n```bash\ngit clone https://github.com/MNitin-Reddy/US-Visa-Approval-Prediction.git\n\n```\nCreate a python virtual environment and install dependencies:\n```bash\nconda create -n venv python=3.8\nconda activate venv\npip install -r requirements.txt\n```\nRun pipeline: (Ensure if MLflow server is running to track experiments)\n```bash\npython demo.py\n```\nRun web app:\n```bash\npython app.py\n```\nChecking experiments using MLflow:\n```bash\nmlflow ui \n```\n\n\n## CI/CD using GitHub Actions and Deployment with AWS\n\n### 1. Login to AWS console.\n\n### 2. Create IAM user for deployment\n\n\t#with specific access to \n\n\t1. Amazon EC2: AmazonEC2FullAccess\n\n\t2. Amazon ECR: AmazonEC2ContainerRegistryFullAccess\n\n    (Copy the Access key and Secret Access Key for the user)\n\n### 3. Create ECR repo to store/save docker image\n    - Save the URI: (315865595366.dkr.ecr.us-east-1.amazonaws.com/visarepo) [This is a sample uri]\n\n### 4. Create EC2 machine (Ubuntu) \n\n### 5. Open EC2 and Install docker in EC2 Machine:\n\t\n\t\n\t#optinal\n\n\tsudo apt-get update -y\n\n\tsudo apt-get upgrade\n\t\n\t#required\n\n\tcurl -fsSL https://get.docker.com -o get-docker.sh\n\n\tsudo sh get-docker.sh\n\n\tsudo usermod -aG docker ubuntu\n\n\tnewgrp docker\n\n##### Description: About the deployment\n\n\t1. Build docker image of the source code\n\n\t2. Push docker image to ECR\n\n\t3. Launch Your EC2 \n\n\t4. Pull Your image from ECR in EC2\n\n\t5. Lauch your docker image in EC2\n\t\n### 6. GitHub Actions\n    1. Configuring EC2 as self-hosted runner\n        In your github repo:\n            setting \u003e actions \u003e runner \u003e new self hosted runner\u003e choose os \u003e then run command one by one\n\n    2. Create a folder on repo .github -\u003e  workflows -\u003e aws.yaml -\u003e copy the CI/CD template for aws deployment\n\n\n\n### 7. Github secrets or environment variables to setup:\n\n   - AWS_ACCESS_KEY_ID\n   - AWS_SECRET_ACCESS_KEY\n   - AWS_DEFAULT_REGION\n   - ECR_REPO_URI\n   - MONGODB_URI\n\nNow everytime we commit to the repo Github Actions automatically deploys the new code to the AWS cloud.\n\n\n## Conclusion\n\nWith an accuracy of 93%, the best-performing model in this project is K-Nearest Neighbors (KNN). After hyperparameter tuning using Optuna and handling target column imbalance using SMOTE, the optimal parameters were:\n\n* algorithm: \"brute\"\n* weights: \"distance\"\n* no_of_neighbors: 5\nThis model effectively predicted visa approvals by leveraging the most relevant features identified through multicollinearity checks and chi-squared tests.\n\nMLflow ensured comprehensive tracking of experiments, while the integration of CI/CD pipelines with GitHub Actions automated testing and deployment.\nThe final solution is containerized using Docker and deployed seamlessly on AWS. MongoDB supports persistent data storage, ensuring reliability across deployments.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMNitin-Reddy%2FReducing-Review-Overhead-with-ML-based-Application-Screening","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMNitin-Reddy%2FReducing-Review-Overhead-with-ML-based-Application-Screening","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMNitin-Reddy%2FReducing-Review-Overhead-with-ML-based-Application-Screening/lists"}