Loan Approval Prediction Model
Model Details
- Model Architecture: Logistic Regression
- Task: Binary Classification (Loan Approval/Rejection)
- Framework: scikit-learn
- Training Data: Loan dataset with customer financial information
Intended Use
This model predicts whether a loan application should be approved or rejected based on customer financial and personal information.
Input Features
The model expects 13 numerical features:
- Gender, Married, Dependents, Education, Self_Employed (encoded)
- ApplicantIncome, CoapplicantIncome, LoanAmount
- Loan_Amount_Term, Credit_History, Property_Area (encoded)
- Age (standardized)
Output
- 0: Loan Rejected
- 1: Loan Approved
How to Use
In Python
import joblib
import numpy as np
# Load model and scaler
model = joblib.load('loan_model.pkl')
scaler = joblib.load('scaler.pkl')
# Prepare your features (13 features in correct order)
# Features should be in the same order as training data
features = np.array([[1, 0, 0, 1, 0, 5000, 0, 100, 360, 1, 2, 1, 30]])
# Scale features
features_scaled = scaler.transform(features)
# Make prediction
prediction = model.predict(features_scaled)[0]
probability = model.predict_proba(features_scaled)[0]
print(f"Prediction: {'Approved' if prediction == 1 else 'Rejected'}")
print(f"Approval Probability: {probability[1]:.2%}")
Via API (using website)
The model is integrated into a Flask/React web application that:
- Takes user input through an intuitive form
- Preprocesses and scales the features
- Returns prediction with confidence score
- Displays loan decision and key factors
Model Performance
- Accuracy: ~80-82%
- Precision: ~82-85%
- Recall: ~75-78%
- F1-Score: ~78-81%
Technical Details
Preprocessing
- Categorical encoding (Gender, Married, Education, Self_Employed, Property_Area)
- Standard scaling (StandardScaler) for numerical features
- Missing value handling and data cleaning applied
Training
- Algorithm: Logistic Regression with L2 regularization (default)
- Max iterations: 1000
- Random seed: 42 (for reproducibility)
Model Card Author
Data Science Student - Year 3, Term 2
Intended Users
- Loan approval decision automation
- Credit risk assessment
- Educational purposes
Limitations
- Model trained on specific historical loan data
- Performance may vary on different data distributions
- Should not be sole basis for loan decisions
- Consider domain expertise and additional factors
License
MIT License - Free to use and modify
Repository Structure:
loan_model.pkl- Trained logistic regression modelscaler.pkl- Feature scaler for preprocessingREADME.md- This model card