0% found this document useful (0 votes)
3 views

Week2 R Results

Week2 R Results

Uploaded by

pz253
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)
3 views

Week2 R Results

Week2 R Results

Uploaded by

pz253
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/ 5

Results:

> source("C:\\Users\\zhaop\\OneDrive\\Documents\\week2v1.R")
'data.frame': 5960 obs. of 14 variables:
$ TARGET_BAD_FLAG: int 1 1 1 1 0 1 1 1 1 1 ...
$ TARGET_LOSS_AMT: int 641 1109 767 1425 NA 335 1841 373 1217 1523 ...
$ LOAN : int 1100 1300 1500 1500 1700 1700 1800 1800 2000 2000 ...
$ MORTDUE : num 25860 70053 13500 NA 97800 ...
$ VALUE : num 39025 68400 16700 NA 112000 ...
$ REASON : chr "HomeImp" "HomeImp" "HomeImp" NA ...
$ JOB : chr "Other" "Other" "Other" NA ...
$ YOJ : num 10.5 7 4 NA 3 9 5 11 3 16 ...
$ DEROG : int 0 0 0 NA 0 0 3 0 0 0 ...
$ DELINQ : int 0 2 0 NA 0 0 2 0 2 0 ...
$ CLAGE : num 94.4 121.8 149.5 NA 93.3 ...
$ NINQ : int 1 0 1 NA 0 1 1 0 1 0 ...
$ CLNO : int 9 14 10 NA 14 8 17 8 12 13 ...
$ DEBTINC : num NA NA NA NA NA ...
Reading data...

Data Structure:
'data.frame': 5960 obs. of 14 variables:
$ TARGET_BAD_FLAG: int 1 1 1 1 0 1 1 1 1 1 ...
$ TARGET_LOSS_AMT: int 641 1109 767 1425 NA 335 1841 373 1217 1523 ...
$ LOAN : int 1100 1300 1500 1500 1700 1700 1800 1800 2000 2000 ...
$ MORTDUE : num 25860 70053 13500 NA 97800 ...
$ VALUE : num 39025 68400 16700 NA 112000 ...
$ REASON : chr "HomeImp" "HomeImp" "HomeImp" NA ...
$ JOB : chr "Other" "Other" "Other" NA ...
$ YOJ : num 10.5 7 4 NA 3 9 5 11 3 16 ...
$ DEROG : int 0 0 0 NA 0 0 3 0 0 0 ...
$ DELINQ : int 0 2 0 NA 0 0 2 0 2 0 ...
$ CLAGE : num 94.4 121.8 149.5 NA 93.3 ...
$ NINQ : int 1 0 1 NA 0 1 1 0 1 0 ...
$ CLNO : int 9 14 10 NA 14 8 17 8 12 13 ...
$ DEBTINC : num NA NA NA NA NA ...

Data Summary:
TARGET_BAD_FLAG TARGET_LOSS_AMT LOAN MORTDUE
Min. :0.0000 Min. : 224 Min. : 1100 Min. : 2063
1st Qu.:0.0000 1st Qu.: 5639 1st Qu.:11100 1st Qu.: 46276
Median :0.0000 Median :11003 Median :16300 Median : 65019
Mean :0.1995 Mean :13415 Mean :18608 Mean : 73761
3rd Qu.:0.0000 3rd Qu.:17634 3rd Qu.:23300 3rd Qu.: 91488
Max. :1.0000 Max. :78987 Max. :89900 Max. :399550
NA's :4771 NA's :518
VALUE REASON JOB YOJ
Min. : 8000 Length:5960 Length:5960 Min. : 0.000
1st Qu.: 66076 Class :character Class :character 1st Qu.: 3.000
Median : 89236 Mode :character Mode :character Median : 7.000
Mean :101776 Mean : 8.922
3rd Qu.:119824 3rd Qu.:13.000
Max. :855909 Max. :41.000
NA's :112 NA's :515
DEROG DELINQ CLAGE NINQ
Min. : 0.0000 Min. : 0.0000 Min. : 0.0 Min. : 0.000
1st Qu.: 0.0000 1st Qu.: 0.0000 1st Qu.: 115.1 1st Qu.: 0.000
Median : 0.0000 Median : 0.0000 Median : 173.5 Median : 1.000
Mean : 0.2546 Mean : 0.4494 Mean : 179.8 Mean : 1.186
3rd Qu.: 0.0000 3rd Qu.: 0.0000 3rd Qu.: 231.6 3rd Qu.: 2.000
Max. :10.0000 Max. :15.0000 Max. :1168.2 Max. :17.000
NA's :708 NA's :580 NA's :308 NA's :510
CLNO DEBTINC
Min. : 0.0 Min. : 0.5245
1st Qu.:15.0 1st Qu.: 29.1400
Median :20.0 Median : 34.8183
Mean :21.3 Mean : 33.7799
3rd Qu.:26.0 3rd Qu.: 39.0031
Max. :71.0 Max. :203.3121
NA's :222 NA's :1267

First Six Records:


TARGET_BAD_FLAG TARGET_LOSS_AMT LOAN MORTDUE VALUE REASON JOB
YOJ DEROG
1 1 641 1100 25860 39025 HomeImp Other 10.5 0
2 1 1109 1300 70053 68400 HomeImp Other 7.0 0
3 1 767 1500 13500 16700 HomeImp Other 4.0 0
4 1 1425 1500 NA NA <NA> <NA> NA NA
5 0 NA 1700 97800 112000 HomeImp Office 3.0 0
6 1 335 1700 30548 40320 HomeImp Other 9.0 0
DELINQ CLAGE NINQ CLNO DEBTINC
1 0 94.36667 1 9 NA
2 2 121.83333 0 14 NA
3 0 149.46667 1 10 NA
4 NA NA NA NA NA
5 0 93.33333 0 14 NA
6 0 101.46600 1 8 37.11361
Creating box plots...

Creating histogram for LOAN amount...

Handling missing values...

Summary after imputation:


TARGET_BAD_FLAG TARGET_LOSS_AMT REASON JOB
Min. :0.0000 Min. : 0 Length:5960 Length:5960
1st Qu.:0.0000 1st Qu.: 0 Class :character Class :character
Median :0.0000 Median : 0 Mode :character Mode :character
Mean :0.1995 Mean : 2676
3rd Qu.:0.0000 3rd Qu.: 0
Max. :1.0000 Max. :78987
M_LOAN IMP_LOAN M_MORTDUE IMP_MORTDUE
Min. :0 Min. : 1100 Min. :0.00000 Min. : 2063
1st Qu.:0 1st Qu.:11100 1st Qu.:0.00000 1st Qu.: 48139
Median :0 Median :16300 Median :0.00000 Median : 66839
Mean :0 Mean :18608 Mean :0.08691 Mean : 73043
3rd Qu.:0 3rd Qu.:23300 3rd Qu.:0.00000 3rd Qu.: 88200
Max. :0 Max. :89900 Max. :1.00000 Max. :399550
M_VALUE IMP_VALUE M_YOJ IMP_YOJ
Min. :0.00000 Min. : 8000 Min. :0.00000 Min. : 0.000
1st Qu.:0.00000 1st Qu.: 66490 1st Qu.:0.00000 1st Qu.: 3.000
Median :0.00000 Median : 88472 Median :0.00000 Median : 7.000
Mean :0.01879 Mean :101415 Mean :0.08641 Mean : 8.745
3rd Qu.:0.00000 3rd Qu.:119005 3rd Qu.:0.00000 3rd Qu.:12.000
Max. :1.00000 Max. :855909 Max. :1.00000 Max. :41.000
M_DEROG IMP_DEROG M_DELINQ IMP_DELINQ
Min. :0.0000 Min. : 0.0000 Min. :0.00000 Min. : 0.0000
1st Qu.:0.0000 1st Qu.: 0.0000 1st Qu.:0.00000 1st Qu.: 0.0000
Median :0.0000 Median : 0.0000 Median :0.00000 Median : 0.0000
Mean :0.1188 Mean : 0.2243 Mean :0.09732 Mean : 0.4057
3rd Qu.:0.0000 3rd Qu.: 0.0000 3rd Qu.:0.00000 3rd Qu.: 0.0000
Max. :1.0000 Max. :10.0000 Max. :1.00000 Max. :15.0000
M_CLAGE IMP_CLAGE M_NINQ IMP_NINQ
Min. :0.00000 Min. : 0.0 Min. :0.00000 Min. : 0.00
1st Qu.:0.00000 1st Qu.: 117.4 1st Qu.:0.00000 1st Qu.: 0.00
Median :0.00000 Median : 175.6 Median :0.00000 Median : 1.00
Mean :0.05168 Mean : 179.2 Mean :0.08557 Mean : 1.17
3rd Qu.:0.00000 3rd Qu.: 227.1 3rd Qu.:0.00000 3rd Qu.: 2.00
Max. :1.00000 Max. :1168.2 Max. :1.00000 Max. :17.00
M_CLNO IMP_CLNO M_DEBTINC IMP_DEBTINC
Min. :0.00000 Min. : 0.00 Min. :0.0000 Min. : 0.5245
1st Qu.:0.00000 1st Qu.:15.00 1st Qu.:0.0000 1st Qu.: 30.7632
Median :0.00000 Median :20.00 Median :0.0000 Median : 35.4557
Mean :0.03725 Mean :21.25 Mean :0.2126 Mean : 34.4085
3rd Qu.:0.00000 3rd Qu.:26.00 3rd Qu.:0.0000 3rd Qu.: 38.0798
Max. :1.00000 Max. :71.00 Max. :1.0000 Max. :203.3122

Number of imputed values per variable:


M_LOAN M_MORTDUE M_VALUE M_YOJ M_DEROG M_DELINQ M_CLAGE
M_NINQ
0 518 112 515 708 580 308 510
M_CLNO M_DEBTINC
222 1267

Performing one-hot encoding...

Final Data Structure:


'data.frame': 5960 obs. of 30 variables:
$ TARGET_BAD_FLAG: num 1 1 1 1 0 1 1 1 1 1 ...
$ TARGET_LOSS_AMT: num 641 1109 767 1425 0 ...
$ M_LOAN : num 0 0 0 0 0 0 0 0 0 0 ...
$ IMP_LOAN : int 1100 1300 1500 1500 1700 1700 1800 1800 2000 2000 ...
$ M_MORTDUE : num 0 0 0 1 0 0 0 0 0 1 ...
$ IMP_MORTDUE : num 25860 70053 13500 60279 97800 ...
$ M_VALUE : num 0 0 0 1 0 0 0 0 0 0 ...
$ IMP_VALUE : num 39025 68400 16700 82000 112000 ...
$ M_YOJ : num 0 0 0 1 0 0 0 0 0 0 ...
$ IMP_YOJ : num 10.5 7 4 6 3 9 5 11 3 16 ...
$ M_DEROG : num 0 0 0 1 0 0 0 0 0 0 ...
$ IMP_DEROG : num 0 0 0 0 0 0 3 0 0 0 ...
$ M_DELINQ : num 0 0 0 1 0 0 0 0 0 0 ...
$ IMP_DELINQ : int 0 2 0 0 0 0 2 0 2 0 ...
$ M_CLAGE : num 0 0 0 1 0 0 0 0 0 0 ...
$ IMP_CLAGE : num 94.4 121.8 149.5 132.9 93.3 ...
$ M_NINQ : num 0 0 0 1 0 0 0 0 0 0 ...
$ IMP_NINQ : num 1 0 1 1 0 1 1 0 1 0 ...
$ M_CLNO : num 0 0 0 1 0 0 0 0 0 0 ...
$ IMP_CLNO : num 9 14 10 20 14 8 17 8 12 13 ...
$ M_DEBTINC : num 1 1 1 1 1 0 1 0 1 1 ...
$ IMP_DEBTINC : num 38.1 38.1 38.1 38.1 34.5 ...
$ REASON_HomeImp : num 1 1 1 NA 1 1 1 1 1 1 ...
$ REASON_DebtCon : num 0 0 0 NA 0 0 0 0 0 0 ...
$ JOB_Other : num 1 1 1 NA 0 1 1 1 1 0 ...
$ JOB_Office : num 0 0 0 NA 1 0 0 0 0 0 ...
$ JOB_Sales : num 0 0 0 NA 0 0 0 0 0 1 ...
$ JOB_Mgr : num 0 0 0 NA 0 0 0 0 0 0 ...
$ JOB_ProfExe : num 0 0 0 NA 0 0 0 0 0 0 ...
$ JOB_Self : num 0 0 0 NA 0 0 0 0 0 0 ...
NULL
>

Results Histogram:

You might also like