DL Assignment
DL Assignment
ON
BY
Shaikh Janis Isa (20CO08)
Bandarkar Ammara Mohammed Hanif (21CO01)
Ansari Naziya Manzar Hussain (21CO02)
Ansari Tahira Ashfaque (21CO03)
Bhatkar Kahkasha Qasimmiyan (21CO04)
AFFILIATED TO
UNIVERSITY OF MUMBAI
Case Study On: Predicting Bank Loan Defaulters Using Perceptron
Chapter 1 Introduction
Deep learning has revolutionized various industries by providing intelligent solutions to complex
problems. One such problem in the financial sector is predicting loan defaulters, a crucial task for
banks and financial institutions. By accurately identifying high-risk customers, banks can minimize
financial losses, optimize loan approval processes, and improve risk assessment strategies.
Traditional statistical models, such as logistic regression, have been widely used for loan default
prediction. However, they often fail to capture complex relationships within the data. The perceptron,
one of the earliest neural network models, offers a robust method for binary classification problems
like this. Although simple, the perceptron effectively learns decision boundaries when data is linearly
separable, making it a suitable first approach before exploring more advanced models like multi-layer
perceptrons (MLPs).
This study aims to apply a perceptron model to classify bank customers as defaulters or non-defaulters
based on their financial history. By analyzing customer attributes such as income, credit score, and past
loan repayment behavior, we will assess the effectiveness of the perceptron model in predicting loan
defaults. Additionally, we will explore its limitations and propose future improvements using deep
learning techniques.
1.1 Objectives
Customer Attributes
9. Debt-to-Income Ratio (DTI): Ratio of debt to income, which indicates financial stability.
Target Variable
10. Default_Status: Binary value indicating whether the customer defaulted on the loan (1 =
Default, 0 = No Default).
1.3 Methodology
● Dataset Selection: The dataset consists of customer attributes (age, income, credit score, loan
amount, etc.) and their loan repayment history.
● Data Cleaning: Handling missing values, removing duplicates, and normalizing numerical
data for consistency.
Case Study On: Predicting Bank Loan Defaulters Using Perceptron
● Feature Engineering: Selecting relevant financial indicators that influence loan repayment
behavior.
● Encoding Categorical Variables: Converting categorical values (e.g., employment status)
into numerical representations.
● Train-Test Split: Dividing the dataset into training (80%) and testing (20%) sets for
evaluation.
● Mathematical Representation:
1. Output Layer: The final classification result, predicting Default (1) or No Default (0).
Case Study On: Predicting Bank Loan Defaulters Using Perceptron
The Perceptron Algorithm is an iterative approach used to adjust model weights for better
classification.
Perceptron Learning Steps
1. Initialize Weights & Bias: Assign small random values.
1. Apply Activation Function: Uses the step function to classify the output.
2. Update Weights (if misclassified):
wi=wi+η(ytrue−ypred)xi
• If the dataset is linearly separable, the perceptron model successfully finds a decision
boundary to separate defaulters from non-defaulters.
• If the dataset is non-linearly separable, the perceptron fails to classify accurately, leading
to poor model performance.
• Solution for Non-Separable Data: Use Multi-Layer Perceptrons (MLPs) or Kernel-
based models (e.g., SVM with a non-linear kernel).
Chapter 2
2.1 Implementation
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder, StandardScaler
from sklearn.linear_model import Perceptron
from sklearn.metrics import accuracy_score, classification_report
# Number of records
num_records = 1000
# Create DataFrame
loan_dataset = pd.DataFrame({
"Customer_ID": customer_id,
"Age": age,
"Income": income,
"Credit_Score": credit_score,
Case Study On: Predicting Bank Loan Defaulters Using Perceptron
"Loan_Amount": loan_amount,
"Loan_Duration": loan_duration,
"Previous_Defaults": previous_defaults,
"Employment_Status": employment_status,
"DTI_Ratio": dti_ratio,
"Default_Status": default_status
})
# Split into training and testing sets (80% train, 20% test)
X_train, X_test, y_train, y_test = train_test_split(X_scaled, y, test_size=0.2, random_state=42)
# Compute accuracy
accuracy = accuracy_score(y_test, y_pred)
2.2 Result
2.Precision & Recall for Defaulters (Class 1) is lower: It misclassifies some defaulters, suggesting
non-linearity in the data.
3. Limitations:
• The perceptron fails to classify non-linearly separable data.
• The McCulloch-Pitts model is too simple for complex loan prediction problems.
Case Study On: Predicting Bank Loan Defaulters Using Perceptron
2.3 Conclusion
The Perceptron model provided a basic classification approach for predicting loan defaults,
achieving an accuracy of 77%. It effectively identified non-defaulters but struggled with
defaulters due to the linear separability limitation. Key financial attributes like credit score,
debt-to-income ratio (DTI), and previous defaults strongly influenced predictions. The
confusion matrix showed a high false negative rate, meaning some actual defaulters were
misclassified, posing a risk for banks. The model’s learning rate sensitivity and inability to
capture complex patterns further limited its effectiveness.
References
2.3.1 Aslam, Uzair, et al. "An empirical study on loan default prediction models." Journal of
Computational and Theoretical Nanoscience 16.8 (2019): 3483-3488.
2.3.2 Tsai, M. C., Lin, S. P., Cheng, C. C., & Lin, Y. P. (2009). The consumer loan default
predicting model–An application of DEA–DA and neural network. Expert Systems with
applications, 36(9), 11682-11690.
2.3.3 Maheswari, P., and CH V. Narayana. "Predictions of loan defaulter-A data science
perspective." 2020 5th International Conference on Computing, Communication and
Security (ICCCS). IEEE, 2020.
2.3.4 Coşer, Alexandru, Monica Mihaela Maer-Matei, and Crişan Albu. "PREDICTIVE MODELS
FOR LOAN DEFAULT RISK ASSESSMENT." Economic Computation & Economic
Cybernetics Studies & Research 53.2 (2019).