pranavvyawahare25/AI_Predictive_Model_for_Credit_Underwriting
AIPredictiveModelforCredit_Underwriting
This repository features an ML-powered predictive model for automating loan eligibility assessments. It analyzes demographic, financial, and credit data to predict loan approvals with high accuracy. Using advanced algorithms, it enhances decision-making, reduces manual effort, and ensures fair, transparent credit evaluation.
๐ Credit Underwriting - Loan Approval Prediction
๐ Overview
This project is a machine learning-based credit underwriting system that predicts whether a loan will be approved or defaulted. It uses an XGBoost model trained on a credit risk dataset containing financial and personal details of applicants.
๐ Features
- Predict loan approval status based on applicant details.
- Handles missing data using median imputation.
- Encodes categorical features for model compatibility.
- Feature scaling using
StandardScaler. - Hyperparameter tuning using
GridSearchCV. - Streamlit web application for easy user interaction.
๐ ๏ธ Technologies Used
- Python ๐
- Pandas, NumPy
- Scikit-learn
- XGBoost
- Matplotlib, Seaborn
- Streamlit (for UI)
๐ File Structure
๐ Credit_Underwriting
โโโ AI_Credit_Status.py # Streamlit web app
โโโ train_model.py # Model training script
โโโ credit_model.pkl # Trained XGBoost model
โโโ label_encoders.pkl # Label encoders for categorical features
โโโ scaler.pkl # StandardScaler for normalization
โโโ requirements.txt # Dependencies list
โโโ README.md # Project documentation๐ Dataset
- Target Variable:
loan_status(Approved/Defaulted) - Features Used:
person_emp_length: Employment length in yearsloan_int_rate: Interest rate on the loanperson_home_ownership: Type of home ownership (encoded)loan_intent: Purpose of the loan (encoded)loan_grade: Loan grade assigned to the applicant (encoded)cb_person_default_on_file: History of default (encoded)annual_income: Annual income of the applicantcredit_score: Credit score of the applicantloan_amount: Loan amount requestedcurrent_debt: Existing debt of the applicantprevious_defaults: Number of past loan defaults
๐ฏ Model Training
- Uses
XGBClassifier(XGBoost) for high accuracy. - Hyperparameter tuning with
GridSearchCV. - Evaluation metrics:
- Accuracy Score
- ROC-AUC Score
- Classification Report (Precision, Recall, F1-score)
- Saves trained model, encoders, and scaler for deployment.
๐ฅ๏ธ Running the Project
1๏ธโฃ Install Dependencies
pip install -r requirements.txt2๏ธโฃ Train the Model
python train_model.py3๏ธโฃ Run the Streamlit App
streamlit run AI_Credit_Status.py๐ License
This project is open-source and available under the MIT License.
๐จโ๐ป Author
Developed by Saloni Waghmare ๐
Feel free to โญ the repository if you find this project useful! ๐ http://localhost:8501 http://192.168.43.220:8501
