0% found this document useful (0 votes)
32 views11 pages

DL Assignment

Uploaded by

20co08
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views11 pages

DL Assignment

Uploaded by

20co08
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

A CASE STUDY

ON

“Predicting Bank Loan Defaulters Using Perceptron”

In partial fulfillment of the requirements for the degree of


Bachelor of Engineering

BY
Shaikh Janis Isa (20CO08)
Bandarkar Ammara Mohammed Hanif (21CO01)
Ansari Naziya Manzar Hussain (21CO02)
Ansari Tahira Ashfaque (21CO03)
Bhatkar Kahkasha Qasimmiyan (21CO04)

UNDER THE GUIDANCE OF


(Prof. Vishal Gotarane)

Department of Computer Engineering,


Anjuman-I-Islam’s Kalsekar Technical Campus School of
Engineering and Technology
Plot No. 2 & 3, Sector -16, Near Thana Naka, Khanda Gaon,
New Panvel, Navi Mumbai. 410206

Academic Year: 2025

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

• Develop a perceptron-based classification model: Implement a perceptron algorithm to


classify bank customers as defaulters or non-defaulters based on their financial attributes.
• Analyze the effectiveness of the perceptron in financial datasets: Investigate how well the
perceptron model performs when applied to real-world banking data.
• Evaluate model performance using various metrics: Measure accuracy, precision, recall, F1-
score, and ROC-AUC to determine the model's reliability.
• Compare the perceptron model with alternative classification approaches: Assess its
strengths and weaknesses compared to logistic regression, decision trees, and support vector
machines.
• Identify challenges and limitations of the perceptron model: Explore issues such as data
non-linearity, convergence speed, and sensitivity to learning rates.
• Propose potential enhancements using advanced deep learning models: Suggest the use of
multi-layer perceptrons (MLPs), deep neural networks, or hybrid models for improved
accuracy and decision-making.
Case Study On: Predicting Bank Loan Defaulters Using Perceptron

1.2 Dataset Description


The dataset will consist of bank customer details and loan repayment history with the following
attributes:

Customer Attributes

1. Customer_ID: Unique identifier for each customer.

2. Age: Age of the customer (in years).

3. Income: Monthly income of the customer (in USD).

4. Credit_Score: Creditworthiness score (ranges from 300 to 850).

5. Loan_Amount: Amount of loan taken (in USD).

6. Loan_Duration: Duration of the loan (in months).

7. Previous_Defaults: Number of past loan defaults by the customer.

8. Employment_Status: Employment type (e.g., "Employed", "Self-Employed", "Unemployed").

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

1.3.1 Data Collection and Preprocessing

● 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.

1.3.2 McCulloch-Pitts Neuron (Basic Model)


The McCulloch-Pitts Neuron forms the foundation of the perceptron model. It follows a
simple binary classification approach based on a weighted sum of inputs and an activation
function.

● Mathematical Representation:

1. Input Layer: Represents customer attributes x1,x2,...,xnx_1, x_2, ..., x_nx1,x2,...,xn.


2. Weighted Sum Calculation:

3. Activation Function (Step Function):

1. Output Layer: The final classification result, predicting Default (1) or No Default (0).
Case Study On: Predicting Bank Loan Defaulters Using Perceptron

1.3.3 Perceptron Learning Algorithm

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.

Compute Weighted Sum: • ∑wixi+b.

1. Apply Activation Function: Uses the step function to classify the output.
2. Update Weights (if misclassified):
wi=wi+η(ytrue−ypred)xi

where η is the learning rate.


3. Repeat Until Convergence: The process continues until classification errors are
minimized.

1.3.4 Linearly Separable vs. Non-Separable Data

• 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).

1.3.5 Model Evaluation

To assess model performance, the following evaluation metrics are used:


• Accuracy: Measures overall correctness.
• Precision & Recall: Evaluates how well defaulters are identified.
• F1-score: Balances precision and recall.
• ROC-AUC Curve: Measures how well the model distinguishes between defaulters and non-
defaulters.
Case Study On: Predicting Bank Loan Defaulters Using Perceptron

1.4 Model Selection

Model Strengths Weaknesses

Perceptron Simple, fast, interpretable for linearly Fails with non-linearly


separable data. separable data.
Logistic Regression Well-suited for probability-based Assumes linear decision
classification. boundary.
Decision Trees Captures non-linear relationships. Prone to overfitting.
Support Vector Machines Handles non-linear data well with Computationally expensive.
(SVMs) kernel tricks.
Multi-Layer Perceptrons Can model complex, non-linear Requires more training time
(MLPs) patterns. and data.
Case Study On: Predicting Bank Loan Defaulters Using Perceptron

Final Model Selection


• Perceptron: Used as the initial model for linearly separable datasets.
• Multi-Layer Perceptron (MLP): Recommended for real-world data, which is often non-
linearly separable.

1.4.1 Future Enhancements


• Use Multi-Layer Perceptrons (MLPs) for handling complex decision boundaries.
• Employ Deep Learning Models (DNNs, CNNs, LSTMs) for improved accuracy.
• Hybrid Models: Combine perceptrons with traditional machine learning techniques for
better decision-making.
Case Study On: Predicting Bank Loan Defaulters Using Perceptron

Chapter 2

Results, Discussion & Conclusion

2.1 Implementation

Step 1: Import Required Libraries & Generate Dataset


We'll use the provided dataset generation code and preprocess it.

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

# Set random seed for reproducibility


np.random.seed(42)

# Number of records
num_records = 1000

# Generate synthetic data


customer_id = np.arange(1, num_records + 1)
age = np.random.randint(20, 70, num_records)
income = np.random.randint(2000, 15000, num_records)
credit_score = np.random.randint(300, 850, num_records)
loan_amount = np.random.randint(1000, 50000, num_records)
loan_duration = np.random.choice([12, 24, 36, 48, 60], num_records)
previous_defaults = np.random.randint(0, 5, num_records)
employment_status = np.random.choice(["Employed", "Self-Employed", "Unemployed"],
num_records)
dti_ratio = np.round(np.random.uniform(0.1, 0.8, num_records), 2)
default_status = np.random.choice([0, 1], num_records, p=[0.7, 0.3]) # 30% default rate

# 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
})

# Display first few rows


print(loan_dataset.head())

Step 2: Data Preprocessing


• Encode categorical features.
• Scale numerical features.
• Split dataset into train (80%) and test (20%).

# Encode categorical data (Employment Status)


label_encoder = LabelEncoder()
loan_dataset["Employment_Status"] =
label_encoder.fit_transform(loan_dataset["Employment_Status"])

# Select features and target variable


X = loan_dataset.drop(columns=["Customer_ID", "Default_Status"])
y = loan_dataset["Default_Status"]

# Scale numerical data


scaler = StandardScaler()
X_scaled = scaler.fit_transform(X)

# 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)

Step 3: Train Perceptron Model


• Initialize the Perceptron Model.
• Train using Perceptron Learning Algorithm.
• Make predictions.

# Initialize Perceptron model


perceptron_model = Perceptron(max_iter=1000, eta0=0.01, random_state=42)

# Train the model


perceptron_model.fit(X_train, y_train)

# Predict on test set


y_pred = perceptron_model.predict(X_test)
Case Study On: Predicting Bank Loan Defaulters Using Perceptron

Step 4: Evaluate Model Performance


• Calculate Accuracy, Precision, Recall, F1-score.

# Compute accuracy
accuracy = accuracy_score(y_test, y_pred)

# Print classification report


print("Classification Report:\n", classification_report(y_test, y_pred))
print("Model Accuracy:", accuracy)

2.2 Result

1.Accuracy = 57%: The perceptron performs decently but is not perfect.

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.

To improve performance, Multi-Layer Perceptrons (MLPs) or deep learning models should be


explored, as they handle non-linearity better. Techniques like oversampling defaulters,
incorporating loan-to-income ratios, and using models like SVMs or decision trees can enhance
accuracy. Overall, while the Perceptron is a good starting point, advanced models are
necessary for better loan risk assessment and financial decision-making.

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).

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy