Credit Risk Modeling in R
Lore Dirick
Manager of Data Science Curriculum at Flatiron School
test_set$loan_status model_prediction
... ...
[8066,] 1 1
[8067,] 0 0
[8068,] 0 0
[8069,] 0 0
[8070,] 0 0
[8071,] 0 1
[8072,] 1 0
[8073,] 1 1
[8074,] 0 0
[8075,] 0 0
[8076,] 0 0
[8077,] 1 1
[8078,] 0 0
... ...
test_set$loan_status model_prediction
... ...
[8066,] 1 1
[8067,] 0 0
[8068,] 0 0
[8069,] 0 0
[8070,] 0 0
[8071,] 0 1
[8072,] 1 0
[8073,] 1 1
[8074,] 0 0
[8075,] 0 0
[8076,] 0 0
[8077,] 1 1
[8078,] 0 0
[8079,] 0 1
... ...
No default (0) | Default (1) | |
---|---|---|
No default (0) | 8 | 2 |
Default (1) | 1 | 3 |
test_set$loan_status model_prediction
... ...
[8066,] 1 1
[8067,] 0 0
[8068,] 0 0
[8069,] 0 0
[8070,] 0 0
[8071,] 0 1
[8072,] 1 0
[8073,] 1 1
[8074,] 0 0
[8075,] 0 0
[8076,] 0 0
[8077,] 1 1
[8078,] 0 0
[8079,] 0 1
... ...
No default (0) | Default (1) | |
---|---|---|
No default (0) | TN | FP |
Default (1) | FN | TP |
Accuracy $$\frac{(8+3)}{14} = 78.57\%$$
Sensitivity $$\frac{3}{(1+3)} = 75\%$$
Specificity $$\frac{8}{(8+2)} = 80\%$$
No default (0) | Default (1) | |
---|---|---|
No default (0) | 8 | 2 |
Default (1) | 1 | 3 |
Credit Risk Modeling in R