🧠 ANN Example: Loan Approval Prediction
Learn how an Artificial Neural Network can use Age, Monthly Income and Repayment History to predict whether a loan should be approved.
1. What is an Artificial Neural Network?
An Artificial Neural Network (ANN) is a machine-learning model made up of interconnected processing units called neurons.
The neurons receive input data, multiply the inputs by their corresponding weights, add a bias, and pass the result through an activation function.
In this example, the ANN will predict:
Loan Approved Loan RejectedThe example is designed for learning ANN mathematics. A real lending system would require many more variables, properly trained parameters, validation, and appropriate regulatory controls.
2. Example Applicant Data
| Feature | Original Value | Normalized Value |
|---|---|---|
| Age | 35 years | 0.35 |
| Monthly Income | ₹70,000 | 0.70 |
| Repayment History | 90% | 0.90 |
ANN calculations work better when input values are placed on a comparable numerical scale.
For this simple example we will use:
Income = 0.70
Repayment History = 0.90
3. ANN Structure
X₁ = 0.35
X₂ = 0.70
X₃ = 0.90
Probability
The information moves from the input layer to the hidden layer and finally to the output layer.
4. Step-by-Step ANN Mathematics
Click each button to understand the calculation one step at a time.
1 Identify the Inputs
Our ANN receives three inputs.
X₂ = Monthly Income = 0.70
X₃ = Repayment History = 0.90
These values are sent to the neurons in the hidden layer.
2 Assign Weights and Bias
Suppose the trained ANN has learned the following simplified parameters for hidden neuron H₁:
W₂ = 0.50
W₃ = 0.30
Bias = 0.10
The weights determine how strongly each input contributes to the neuron.
Here, income has a larger weight than age, meaning income has a greater influence on this particular simplified neuron.
3 Calculate the Weighted Sum
The basic neuron equation is:
Substitute the values:
Calculate each multiplication:
0.70 × 0.50 = 0.350
0.90 × 0.30 = 0.270
Now add all the values:
Z = 0.790
Therefore, the weighted sum received by H₁ is: 0.790.
4 Apply the Sigmoid Activation Function
The sigmoid function converts the weighted sum into a value between 0 and 1.
We obtained:
Substitute the value:
Approximately:
H₁ ≈ 1 / (1 + 0.454)
H₁ ≈ 0.688
Therefore: H₁ ≈ 0.688
5 Calculate the Output
Suppose the output neuron uses:
Output Bias = -0.40
The output weighted sum is:
Substitute:
Calculate:
Zout = 0.8944 - 0.40
Zout = 0.4944
Now apply sigmoid to the output.
P(Loan Approval) ≈ 0.621
6 Make the Final Decision
Suppose the decision threshold is 50%.
Threshold = 50%
62.1% ≥ 50%
Since the predicted probability is greater than the threshold, the simplified ANN classification is:
5. Complete ANN Mathematical Flow
↓
Age = 0.35
Income = 0.70
Repayment History = 0.90
↓
WEIGHTED SUM
Z = (0.35 × 0.20) + (0.70 × 0.50) + (0.90 × 0.30) + 0.10
Z = 0.790
↓
SIGMOID
H₁ ≈ 0.688
↓
OUTPUT WEIGHTED SUM
Zout = (0.688 × 1.30) - 0.40
Zout = 0.4944
↓
FINAL SIGMOID
P ≈ 0.621
↓
62.1% → LOAN APPROVED
6. Important ANN Terms Used
Input Neuron Weight Bias Weighted Sum Hidden Layer Output Layer Activation Function Sigmoid Probability ThresholdRemember: The ANN does not simply compare one value with a fixed rule. It combines multiple inputs using learned weights and biases and then uses an activation function to produce the prediction.
No comments:
Post a Comment