Bank Loan Case Study�
Final project 2.
Summary:
Continue…
Continue..
Task1: Present the overall approach of the analysis. Mention the problem statement and the analysis approach briefly�
Task2: Identify the missing data and use appropriate method to deal with it. (Remove columns/or replace it with an appropriate value)
Finding and removing columns:-
Remaining columns:
No | Column | Count | Data_type |
0 | SK_ID_CURR | Not_null | int64 |
1 | SK_ID_CURR | Not_null | int64 |
2 | NAME_CONTRACT_TYPE | Not_null | object |
3 | AMT_ANNUITY | Not_null | float64 |
4 | AMT_APPLICATION | Not_null | float64 |
5 | AMT_CREDIT | Not_null | float64 |
6 | AMT_GOODS_PRICE | Not_null | float64 |
7 | NAME_CASH_LOAN_PURPOSE | Not_null | object |
8 | NAME_CONTRACT_STATUS | Not_null | object |
9 | DAYS_DECISION | Not_null | Int64 |
10 | NAME_PAYMENT_TYPE | Not_null | object |
11 | CODE_REJECT_REASON | Not_null | object |
12 | NAME_CLIENT_TYPE | Not_null | object |
13 | NAME_GOODS_CATEGORY | Not_null | object |
Continue
No | Column | Count | Data_type |
14 | NAME_FAMILY_STATUS | not_null | Float64 |
15 | NAME_HOUSING_TYPE | not_null | float64 |
16 | REGION_POPULATION_RELATIVE | not_null | Int |
17 | DAYS_BIRTH | not_null | object |
18 | DAYS_EMPLOYED | not_null | object |
19 | DAYS_REGISTRATION | not_null | float64 |
20 | DAYS_ID_PUBLISH | not_null | int64 |
21 | OCCUPATION_TYPE | not_null | float64 |
22 | CNT_FAM_MEMBERS | not_null | object |
23 | REGION_RATING_CLIENT | not_null | int64 |
24 | REGION_RATING_CLIENT_W_CITY | not_null | int64 |
25 | WEEKDAY_APPR_PROCESS_START | not_null | int64 |
26 | HOUR_APPR_PROCESS_START | not_null | object |
27 | REG_REGION_NOT_LIVE_REGION | not_null | float |
Null columns:
Column percentage %:-
Column_name | Null values % |
AMT_DOWN_PAYMENT | 53.636480 |
RATE_DOWN_PAYMENT | 53.636480 |
RATE_INTEREST_PRIMARY | 99.643698 |
RATE_INTEREST_PRIVILEGED | 99.643698 |
NAME_TYPE_SUITE | 49.119754 |
DAYS_FIRST_DRAWING | 40.298129 |
DAYS_FIRST_DUE | �40.298129 |
DAYS_LAST_DUE_1ST_VERSION | 40.298129 |
DAYS_LAST_DUE | 40.298129 |
NFLAG_INSURED_ON_APPROVAL | 40.298129 |
| |
Task:-Identify if there is data imbalance in the data. Find the ratio of data imbalance.�Hint: Since there are a lot of columns, you can run your analysis in loops for the appropriate columns and find the insights.��
Converting negative values into positive:-
Amt_credited | Range |
200k-300k | 17.82 |
300k-400k | 8.56 |
400k-500k | 10.41 |
500k-600k | 11.13 |
600k-700k | 7.82 |
700k-800k | 6.24 |
800k-900k | 7.08 |
900k-1M | 2.90 |
1M Above | 16.25 |
Continue…
Age_group | Percentage |
0-20 | 0 |
20-30 | 17 |
40-50 | 24 |
30-40 | 27 |
50 above | 50 |
| |
Continue:
Column | no | Datatype |
SK_ID_CURR | 1 | int64 |
TARGET | 2 | int64 |
NAME_CONTRACT_TYPE | 3 | category |
CODE_GENDER | 4 | category |
FLAG_OWN_CAR | 5 | category |
.. | .. | |
.. | .. | |
.. | .. | |
.. | . | |
YEARS_EMPLOYED | 51 | float64 |
EMPLOYMENT_YEAR | 52 | int64 |
Converting negative days into positive days
Days_decision_group | Percentage |
0-400 | 37 |
400-800 | 22 |
800-1200 | 12 |
1200-1600 | 7 |
1600-2000 | 5 |
2000-2400 | 5 |
2400-2800 | 6 |
2800-3200 | 1 |
| |
TASK:Explain the results of univariate, segmented univariate, bivariate analysis, etc. in business terms.�
1. Univariate:
Continue:
Continue.
b) Measures of central tendency: These numbers describe the location of a dataset’s center or the middle value of the data set.
Bar chart:-�
Pie Chart:-
2.Segmented univariate.
3. Bivariate analysis
Scatter Plots:-�
TASK:Find the top 10 correlation for the Client with payment difficulties and all other cases (Target variable). Note that you have to find the top correlation by segmenting the data frame w.r.t to the target variable and then find the top correlation for each of the segmented data and find if any insight is there. Say, there are 5+1(target) variables in a dataset: Var1, Var2, Var3, Var4, Var5, Target. And if you have to find top 3 correlation, it can be: Var1 & Var2, Var2 & Var3, Var1 & Var3. Target variable will not feature in this correlation as it is a categorical variable and not a continuous variable which is increasing or decreasing.�
Imbalance analysis
Categorical analysis
Contract type: Revolving loans are just a small fraction (10%) from the total number of loans; in the same time, a larger amount of Revolving loans, comparing with their frequency, are not repaid.
Numerical data analysis:
Multivariate Analysis:-
NAME_INCOME_TYPE | count | mean | std | min | 25% | 50% | 75% | max |
Businessman | 10.0 | 6.52 | 6.27 | 1.80 | 2.25 | 4.95 | 8.43 | 22 |
Commercial associate | 71617 | 2.02 | 1.49 | 0.26 | 1.35 | 1.80 | 2.25 | 180 |
Maternity leave | 5.0 | 1.40 | 1.26 | 0.49 | 0.67 | 0.90 | 1.35 | 3.60 |
Pensioner | 55362 | 1.36 | 0.76 | 0.25 | 0.90 | 1.17 | 1.66 | 22.5 |
State servant | 21703 | 1.79 | 1.00 | 0.27 | 1.12 | 1.57 | 2.25 | 31.5 |
Student | 18.0 | 1.70 | 1.06 | 0.81 | 1.12 | 1.57 | 1.78 | 5.56 |
Unemployed | 22.0 | 1.10 | 0.88 | 0.26 | 0.54 | 0.78 | 1.35 | 3.37 |
Working | 158774 | 1.63 | 3.07 | 0.25 | 1.12 | 1.35 | 2.02 | 1170.0 |
We can see that business man is the highest and the range with default 95% confidence level close to 4 lakh and above 10 lakh.
Correlation between numeric variable:-�
Var1 | Var2 | Correlation |
AMT_GOODS_PRICE | AMT_CREDIT | 0.98 |
CNT_FAM_MEMBERS | CNT_CHILDREN | 0.88 |
AMT_GOODS_PRICE | AMT_ANNUITY | 0.75 |
AMT_ANNUITY | AMT_CREDIT | 0.75 |
DAYS_EMPLOYED | DAYS_BIRTH | 0.58 |
DAYS_REGISTRATION | DAYS_BIRTH | 0.28 |
FLAG_DOCUMENT_3 | DAYS_EMPLOYED | 0.27 |
DEF_60_CNT_SOCIAL_CIRCLE | OBS_60_CNT_SOCIAL_CIRCLE | 0.26 |
DAYS_BIRTH | CNT_CHILDREN | 0.25 |
DAYS_ID_PUBLISH | DAYS_BIRTH | 0.25 |
Continue…
Conclusion:
Insights:
������ Thank you.