A deep learning–based system to predict loan approval decisions using applicant financial and demographic data.
Developed and maintained by Surajit.
This project uses a PyTorch feed-forward neural network to predict whether a loan application will be Approved or Rejected, based on various financial and credit-related features.
The workflow:
- Load a trained model and preprocessing objects (scaler and label encoders).
- Read applicant data from an Excel file (
loan_applications.xlsx). - Preprocess the data (encode categorical columns and scale numerical features).
- Generate predictions and save the results in
loan_applications_result.xlsx.
The neural network (LoanNN) consists of:
- Input Layer →
input_dim = 11 - Hidden Layer 1 → 64 neurons + ReLU + Dropout(0.3)
- Hidden Layer 2 → 32 neurons + ReLU
- Output Layer → 1 neuron + Sigmoid activation
This structure outputs a probability score representing the likelihood of loan approval.
LOAN_APPROVAL/
├── .dist/ # Distribution or build artifacts
├── data/ # Raw or processed data files
├── Loan/ # Core loan-related modules
├── models/ # Trained models and architectures
├── output_data/ # Generated results or outputs
│
├── .gitignore # Git ignore file
├── loan_approval.ipynb # Main notebook for model training/evaluation
├── nn_model.ipynb # Neural network model development notebook
├── nn_run_model.py # Script to run the trained neural network model
├── run_model.py # Prediction or model execution script
├── xcel_file_test.py # Excel file testing and validation script
│
├── requirements.txt # List of dependencies
└── README.md # Project documentation
# Project documentation
git clone https://github.com/Surajit09636/loan-approval-predictor.git
cd loan-approval-predictorpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtIf you don't have
requirements.txtyet, generate it using:pip freeze > requirements.txt
The model expects an Excel file (loan_applications.xlsx) with the following columns:
| Column | Description |
|---|---|
| dependents | Number of dependents |
| education | Graduate / Not Graduate |
| self_employed | Yes / No |
| imcome_annum | Annual income |
| loan_amount | Loan amount requested |
| loan_term | Term in months |
| cibil_score | Credit score |
| residential_assets_value | Value of residential assets |
| commercial_assets_value | Value of commercial assets |
| luxury_assets_value | Value of luxury assets |
| bank_asset_value | Value of bank assets |
Example:
| dependents | education | self_employed | imcome_annum | loan_amount | loan_term | cibil_score | residential_assets_value | commercial_assets_value | luxury_assets_value | bank_asset_value |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Graduate | No | 600000 | 150000 | 24 | 720 | 250000 | 50000 | 20000 | 70000 |
Run the main script:
python xcel_file_test.pyIt will:
- Load your model (
./data/loan_nn_model_gpu.pth) - Process
loan_applications.xlsx - Generate approval predictions
- Save results to
loan_applications_result.xlsx
Sample output:
✅ Predictions saved to 'loan_applications_result.xlsx'
The output Excel file will include:
Prediction_Probability→ Model confidence scorePredicted_Status→ “Approved” or “Rejected”
Main Python libraries:
torchpandasscikit-learnopenpyxlnumpy
You can install them with:
pip install torch pandas scikit-learn openpyxl numpySurajit
📧 Email: surajitsutradhar010@gmail.com
💼 GitHub: https://github.com/Surajit09636
"Empowering smarter financial decisions through machine learning."
This project is released under the MIT License.
You’re free to use, modify, and distribute with proper credit to Surajit.