CoolFace
Apppublic

pranavvyawahare25/AI_Predictive_Model_for_Credit_Underwriting

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
App README

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 years
  • โ€”loan_int_rate: Interest rate on the loan
  • โ€”person_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 applicant
  • โ€”credit_score: Credit score of the applicant
  • โ€”loan_amount: Loan amount requested
  • โ€”current_debt: Existing debt of the applicant
  • โ€”previous_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

bash
pip install -r requirements.txt

2๏ธโƒฃ Train the Model

bash
python train_model.py

3๏ธโƒฃ Run the Streamlit App

bash
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