In [1]:
import sqlite3
conn = sqlite3.connect('lending-club-loan-data/database.sqlite')
c = conn.cursor()
In [2]:
import pandas as pd
import numpy as np
pd.set_option('display.max_columns', 80)
pd.set_option('display.max_rows', 80)
## only select rows that are fully funded and are individual loans (no joint loans)
data=pd.read_sql('''
SELECT *
FROM loan
WHERE funded_amnt==loan_amnt AND (application_type LIKE '%INDIVIDUAL%') AND term LIKE '%36 months%'
''',conn)
In [3]:
data.drop(['index'],axis=1)
Out[3]:
id
member_id
loan_amnt
funded_amnt
funded_amnt_inv
term
int_rate
installment
grade
sub_grade
emp_title
emp_length
home_ownership
annual_inc
verification_status
issue_d
loan_status
pymnt_plan
url
desc
purpose
title
zip_code
addr_state
dti
delinq_2yrs
earliest_cr_line
inq_last_6mths
mths_since_last_delinq
mths_since_last_record
open_acc
pub_rec
revol_bal
revol_util
total_acc
initial_list_status
out_prncp
out_prncp_inv
total_pymnt
total_pymnt_inv
total_rec_prncp
total_rec_int
total_rec_late_fee
recoveries
collection_recovery_fee
last_pymnt_d
last_pymnt_amnt
next_pymnt_d
last_credit_pull_d
collections_12_mths_ex_med
mths_since_last_major_derog
policy_code
application_type
annual_inc_joint
dti_joint
verification_status_joint
acc_now_delinq
tot_coll_amt
tot_cur_bal
open_acc_6m
open_il_6m
open_il_12m
open_il_24m
mths_since_rcnt_il
total_bal_il
il_util
open_rv_12m
open_rv_24m
max_bal_bc
all_util
total_rev_hi_lim
inq_fi
total_cu_tl
inq_last_12m
0
1077501
1296599.0
5000.0
5000.0
4975.0
36 months
10.65%
162.87
B
B2
None
10+ years
RENT
24000.00
Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/22/11 > I need to upgra...
credit_card
Computer
860xx
AZ
27.65
0.0
Jan-1985
1.0
NaN
NaN
3.0
0.0
13648.0
83.7%
9.0
f
0.00
0.00
5861.071414
5831.78
5000.00
861.07
0.00
0.00
0.0000
Jan-2015
171.62
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
1
1077175
1313524.0
2400.0
2400.0
2400.0
36 months
15.96%
84.33
C
C5
None
10+ years
RENT
12252.00
Not Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
small_business
real estate business
606xx
IL
8.72
0.0
Nov-2001
2.0
NaN
NaN
2.0
0.0
2956.0
98.5%
10.0
f
0.00
0.00
3003.653644
3003.65
2400.00
603.65
0.00
0.00
0.0000
Jun-2014
649.91
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
2
1076863
1277178.0
10000.0
10000.0
10000.0
36 months
13.49%
339.31
C
C1
AIR RESOURCES BOARD
10+ years
RENT
49200.00
Source Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/21/11 > to pay for prop...
other
personel
917xx
CA
20.00
0.0
Feb-1996
1.0
35.0
NaN
10.0
0.0
5598.0
21%
37.0
f
0.00
0.00
12226.302212
12226.30
10000.00
2209.33
16.97
0.00
0.0000
Jan-2015
357.48
None
Jan-2015
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
3
1075269
1311441.0
5000.0
5000.0
5000.0
36 months
7.90%
156.46
A
A4
Veolia Transportaton
3 years
RENT
36000.00
Source Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
wedding
My wedding loan I promise to pay back
852xx
AZ
11.20
0.0
Nov-2004
3.0
NaN
NaN
9.0
0.0
7963.0
28.3%
12.0
f
0.00
0.00
5631.377753
5631.38
5000.00
631.38
0.00
0.00
0.0000
Jan-2015
161.03
None
Sep-2015
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
4
1072053
1288686.0
3000.0
3000.0
3000.0
36 months
18.64%
109.43
E
E1
MKC Accounting
9 years
RENT
48000.00
Source Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/16/11 > Downpayment for...
car
Car Downpayment
900xx
CA
5.35
0.0
Jan-2007
2.0
NaN
NaN
4.0
0.0
8221.0
87.5%
4.0
f
0.00
0.00
3938.144334
3938.14
3000.00
938.14
0.00
0.00
0.0000
Jan-2015
111.34
None
Dec-2014
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
5
1069908
1305008.0
12000.0
12000.0
12000.0
36 months
12.69%
402.54
B
B5
UCLA
10+ years
OWN
75000.00
Source Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Consolidation
913xx
CA
10.78
0.0
Oct-1989
0.0
NaN
NaN
12.0
0.0
23336.0
67.1%
34.0
f
0.00
0.00
13943.080000
13943.08
12000.00
1943.08
0.00
0.00
0.0000
Sep-2013
6315.30
None
Aug-2013
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
6
1064687
1298717.0
9000.0
9000.0
9000.0
36 months
13.49%
305.38
C
C1
Va. Dept of Conservation/Recreation
< 1 year
RENT
30000.00
Source Verified
Dec-2011
Charged Off
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/15/11 > Plan to pay off...
debt_consolidation
freedom
245xx
VA
10.08
0.0
Apr-2004
1.0
NaN
NaN
4.0
0.0
10452.0
91.7%
9.0
f
0.00
0.00
2270.700000
2270.70
1256.14
570.26
0.00
444.30
4.1600
Jul-2012
305.38
None
Nov-2012
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
7
1069866
1304956.0
3000.0
3000.0
3000.0
36 months
9.91%
96.68
B
B1
Target
3 years
RENT
15000.00
Source Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/19/11 > I intend to pay...
credit_card
citicard fund
606xx
IL
12.56
0.0
Jul-2003
2.0
NaN
NaN
11.0
0.0
7323.0
43.1%
11.0
f
0.00
0.00
3478.981915
3478.98
3000.00
478.98
0.00
0.00
0.0000
Jan-2015
102.43
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
8
1069057
1303503.0
10000.0
10000.0
10000.0
36 months
10.65%
325.74
B
B2
SFMTA
3 years
RENT
100000.00
Source Verified
Dec-2011
Charged Off
n
https://www.lendingclub.com/browse/loanDetail....
None
other
Other Loan
951xx
CA
7.06
0.0
May-1991
2.0
NaN
NaN
14.0
0.0
11997.0
55.5%
29.0
f
0.00
0.00
7471.990000
7471.99
5433.47
1393.42
0.00
645.10
6.3145
Oct-2013
325.74
None
Mar-2014
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
9
1069759
1304871.0
1000.0
1000.0
1000.0
36 months
16.29%
35.31
D
D1
Internal revenue Service
< 1 year
RENT
28000.00
Not Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt Consolidation Loan
641xx
MO
20.31
0.0
Sep-2007
1.0
NaN
NaN
11.0
0.0
6524.0
81.5%
23.0
f
0.00
0.00
1270.171106
1270.17
1000.00
270.17
0.00
0.00
0.0000
Jan-2015
36.32
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
10
1065775
1299699.0
10000.0
10000.0
10000.0
36 months
15.27%
347.98
C
C4
Chin's Restaurant
4 years
RENT
42000.00
Not Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
home_improvement
Home
921xx
CA
18.60
0.0
Oct-1998
2.0
61.0
NaN
14.0
0.0
24043.0
70.2%
28.0
f
0.00
0.00
12519.260450
12519.26
10000.00
2519.26
0.00
0.00
0.0000
Jan-2015
370.46
None
Apr-2015
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
11
1069971
1304884.0
3600.0
3600.0
3600.0
36 months
6.03%
109.57
A
A1
Duracell
10+ years
MORTGAGE
110000.00
Not Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/15/11 > Payoff other le...
major_purchase
Holiday
067xx
CT
10.52
0.0
Aug-1993
0.0
NaN
NaN
20.0
0.0
22836.0
16%
42.0
f
0.00
0.00
3785.020000
3785.02
3600.00
185.02
0.00
0.00
0.0000
May-2013
583.45
None
May-2014
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
12
1062474
1294539.0
6000.0
6000.0
6000.0
36 months
11.71%
198.46
B
B3
Connection Inspection
1 year
MORTGAGE
84000.00
Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/16/11 > This is a loan ...
medical
Medical
890xx
UT
18.44
2.0
Oct-2003
0.0
8.0
NaN
4.0
0.0
0.0
37.73%
14.0
f
0.00
0.00
7164.499852
7164.50
6000.00
1149.50
15.00
0.00
0.0000
Feb-2015
16.98
None
Jul-2015
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
13
1069742
1304855.0
9200.0
9200.0
9200.0
36 months
6.03%
280.01
A
A1
Network Interpreting Service
6 years
RENT
77385.19
Not Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
lowerratemeanseasiertogetoutofdebt!
921xx
CA
9.86
0.0
Jan-2001
0.0
NaN
NaN
8.0
0.0
7314.0
23.1%
28.0
f
0.00
0.00
9459.960000
9459.96
9200.00
259.96
0.00
0.00
0.0000
Jul-2012
8061.10
None
Jul-2012
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
14
1039153
1269083.0
21000.0
21000.0
21000.0
36 months
12.42%
701.73
B
B4
Osram Sylvania
10+ years
RENT
105000.00
Verified
Dec-2011
Charged Off
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/16/11 > Decided to clea...
debt_consolidation
Debt Cleanup
335xx
FL
13.22
0.0
Feb-1983
0.0
NaN
NaN
7.0
0.0
32135.0
90.3%
38.0
f
0.00
0.00
14025.400000
14025.40
10694.96
3330.44
0.00
0.00
0.0000
Sep-2013
701.73
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
15
1069710
1304821.0
10000.0
10000.0
10000.0
36 months
11.71%
330.76
B
B3
Value Air
10+ years
OWN
50000.00
Source Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/17/11 > Have a stable j...
credit_card
Credit Card Loan
799xx
TX
11.18
0.0
Jul-1985
0.0
NaN
NaN
8.0
0.0
10056.0
82.4%
21.0
f
0.00
0.00
11902.561575
11902.56
10000.00
1902.56
0.00
0.00
0.0000
Jan-2015
349.21
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
16
1069700
1304810.0
10000.0
10000.0
10000.0
36 months
11.71%
330.76
B
B3
Wells Fargo Bank
5 years
RENT
50000.00
Not Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt Consolidation
917xx
CA
16.01
0.0
Apr-2003
0.0
NaN
NaN
6.0
0.0
17800.0
91.8%
17.0
f
0.00
0.00
11536.310000
11536.31
10000.00
1536.31
0.00
0.00
0.0000
Oct-2013
4942.63
None
Mar-2014
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
17
1069559
1304634.0
6000.0
6000.0
6000.0
36 months
11.71%
198.46
B
B3
bmg-educational
1 year
RENT
76000.00
Not Verified
Dec-2011
Charged Off
n
https://www.lendingclub.com/browse/loanDetail....
None
major_purchase
cash
900xx
CA
2.40
0.0
Jun-2001
1.0
NaN
NaN
7.0
0.0
5963.0
29.7%
7.0
f
0.00
0.00
2050.140000
2050.14
1305.58
475.25
0.00
269.31
2.5700
Oct-2012
198.46
None
Mar-2013
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
18
1069697
1273773.0
15000.0
15000.0
15000.0
36 months
9.91%
483.38
B
B1
Winfield Pathology Consultants
2 years
MORTGAGE
92000.00
Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
credit_card
No more credit card debt!
605xx
IL
29.44
0.0
Feb-2002
0.0
NaN
NaN
8.0
0.0
13707.0
93.9%
31.0
f
0.00
0.00
15823.480000
15823.48
15000.00
823.48
0.00
0.00
0.0000
Sep-2012
2447.05
None
Sep-2012
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
19
1069800
1304679.0
15000.0
15000.0
8725.0
36 months
14.27%
514.64
C
C2
nyc transit
9 years
RENT
60000.00
Not Verified
Dec-2011
Charged Off
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/15/11 > looking to cons...
debt_consolidation
consolidation
103xx
NY
15.22
0.0
Oct-2003
1.0
NaN
NaN
7.0
0.0
5872.0
57.6%
11.0
f
0.00
0.00
0.000000
0.00
0.00
0.00
0.00
0.00
0.0000
None
0.00
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
20
1069799
1304678.0
4000.0
4000.0
4000.0
36 months
11.71%
132.31
B
B3
Shands Hospital at the University of Fl
10+ years
MORTGAGE
106000.00
Not Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt Consolidation
326xx
FL
5.63
1.0
Aug-1984
0.0
18.0
NaN
12.0
0.0
6110.0
37.7%
44.0
f
0.00
0.00
4484.790000
4484.79
4000.00
484.79
0.00
0.00
0.0000
Apr-2013
2638.77
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
21
1047704
1278806.0
8500.0
8500.0
8500.0
36 months
11.71%
281.15
B
B3
Oakridge homes
< 1 year
RENT
25000.00
Source Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/15/11 > My loan is for ...
credit_card
Credit card repayment loan
564xx
MN
12.19
0.0
Nov-2006
0.0
NaN
NaN
8.0
0.0
6441.0
59.1%
12.0
f
0.00
0.00
10122.208614
10122.21
8500.00
1622.21
0.00
0.00
0.0000
Dec-2014
581.59
None
Jan-2015
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
22
1032111
1261745.0
4375.0
4375.0
4375.0
36 months
7.51%
136.11
A
A3
None
7 years
MORTGAGE
17108.00
Source Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/17/11 > This loan is a ...
debt_consolidation
Debt Consolidation
141xx
NY
20.34
0.0
Dec-1987
0.0
NaN
NaN
6.0
0.0
11210.0
86.9%
12.0
f
0.00
0.00
4898.543558
4898.54
4375.00
523.54
0.00
0.00
0.0000
Jan-2015
144.94
None
Dec-2014
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
23
1069539
1304608.0
31825.0
31825.0
31825.0
36 months
7.90%
995.82
A
A4
Audubon Mutual Housing Corporation
5 years
MORTGAGE
75000.00
Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/15/11 > Hello<br>I plan...
debt_consolidation
Debt Consolidation Loan
080xx
NJ
14.03
0.0
Nov-1981
0.0
NaN
NaN
12.0
0.0
23151.0
27.4%
26.0
f
0.00
0.00
34886.080000
34886.08
31825.00
3061.08
0.00
0.00
0.0000
Aug-2013
16966.70
None
Oct-2015
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
24
1069591
1304289.0
5000.0
5000.0
5000.0
36 months
8.90%
158.77
A
A5
Good Samaritan Society
2 years
RENT
24044.00
Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/16/11 > The purpose of ...
debt_consolidation
Consolidation
974xx
OR
11.93
0.0
Apr-2005
0.0
45.0
NaN
8.0
0.0
2224.0
29.3%
16.0
f
0.00
0.00
5714.592129
5714.59
5000.00
714.59
0.00
0.00
0.0000
Jan-2015
163.64
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
25
1069530
1291365.0
7000.0
7000.0
7000.0
36 months
15.96%
245.97
C
C5
GREG BARRETT DRYWALL
7 years
RENT
34000.00
Source Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
credit_card
Credit Card Loan
934xx
CA
6.35
0.0
Oct-2007
1.0
NaN
NaN
6.0
0.0
6113.0
60.5%
6.0
f
0.00
0.00
8848.940430
8848.94
7000.00
1848.94
0.00
0.00
0.0000
Jan-2015
260.74
None
Dec-2014
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
26
1069522
1304589.0
12400.0
12400.0
12400.0
36 months
10.65%
403.91
B
B2
Sharp Lawn Inc.
10+ years
RENT
41000.00
Not Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/16/11 > I plan to use t...
credit_card
December 2011 Credit Card Loan
405xx
KY
11.80
0.0
Jul-2005
2.0
NaN
NaN
9.0
0.0
11095.0
57.2%
12.0
f
0.00
0.00
14537.459527
14537.46
12400.00
2137.46
0.00
0.00
0.0000
Jan-2015
417.61
None
Dec-2014
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
27
1069361
1304255.0
10800.0
10800.0
10800.0
36 months
9.91%
348.03
B
B1
Department of Justice
2 years
RENT
55596.00
Source Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/19/11 > I have a very s...
moving
Moving to better job; help a veteran!
946xx
CA
5.50
0.0
Dec-2000
0.0
NaN
NaN
7.0
0.0
2535.0
13.3%
18.0
f
0.00
0.00
12157.200000
12157.20
10800.00
1357.20
0.00
0.00
0.0000
Nov-2013
3483.79
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
28
1069357
1304251.0
15000.0
15000.0
15000.0
36 months
7.90%
469.36
A
A4
Gateway Hospice
1 year
RENT
45000.00
Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/15/11 > I am looking to...
debt_consolidation
Debt Consolidation Loan
445xx
OH
8.48
0.0
Nov-2004
0.0
NaN
NaN
7.0
0.0
6704.0
50.4%
27.0
f
0.00
0.00
16662.600000
16662.60
15000.00
1662.60
0.00
0.00
0.0000
Jan-2014
5872.80
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
29
1069356
1304250.0
6000.0
6000.0
6000.0
36 months
12.42%
200.50
B
B4
Cox Communications
1 year
RENT
36852.00
Source Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/15/11 > This loan will ...
debt_consolidation
Credit Card Consolidation
850xx
AZ
10.62
0.0
Apr-2007
1.0
NaN
NaN
7.0
0.0
7310.0
66.5%
12.0
f
0.00
0.00
7125.283165
7125.28
6000.00
1125.28
0.00
0.00
0.0000
Apr-2014
1923.53
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
30
1067573
1301955.0
9600.0
9600.0
9600.0
36 months
7.51%
298.67
A
A3
Nucor Building Systems
4 years
RENT
68004.00
Source Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/15/11 > Funds will be u...
other
Other Loan
292xx
SC
6.63
0.0
Jan-2003
0.0
NaN
NaN
6.0
0.0
2896.0
18.1%
11.0
f
0.00
0.00
10749.762645
10749.76
9600.00
1149.76
0.00
0.00
0.0000
Jan-2015
311.56
None
Dec-2014
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
31
1069506
1304567.0
12000.0
12000.0
12000.0
36 months
7.90%
375.49
A
A4
John Wiley Jr.
10+ years
RENT
62300.00
Not Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/15/11 > To be used to p...
debt_consolidation
Debt Consolidation
088xx
NJ
16.70
0.0
Mar-1994
0.0
38.0
NaN
15.0
0.0
8601.0
21%
25.0
f
0.00
0.00
13516.382957
13516.38
12000.00
1516.38
0.00
0.00
0.0000
Jan-2015
380.98
None
Sep-2015
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
32
1069314
1304202.0
3000.0
3000.0
3000.0
36 months
18.25%
108.84
D
D5
None
9 years
MORTGAGE
65000.00
Not Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/15/11 > Combination of ...
other
Year End Cleanup
180xx
PA
17.39
0.0
Sep-1998
0.0
NaN
NaN
8.0
0.0
43936.0
98.1%
22.0
f
0.00
0.00
3915.027595
3915.03
3000.00
915.03
0.00
0.00
0.0000
Jan-2015
115.38
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
33
1060578
1292332.0
4400.0
4400.0
4400.0
36 months
16.77%
156.37
D
D2
citizens bank
10+ years
RENT
55000.00
Not Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
debt
029xx
RI
20.01
0.0
Jun-2004
0.0
NaN
NaN
7.0
0.0
25237.0
99%
11.0
f
0.00
0.00
5626.892655
5626.89
4400.00
1226.89
0.00
0.00
0.0000
Jan-2015
162.44
None
Dec-2015
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
34
1069469
1304526.0
6000.0
6000.0
6000.0
36 months
6.03%
182.62
A
A1
Stewart Enterprises, Inc.
10+ years
MORTGAGE
45600.00
Not Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/16/11 > Debt Consolidat...
debt_consolidation
Debt-Consolidation
700xx
LA
5.34
0.0
Nov-1995
1.0
NaN
NaN
6.0
0.0
3378.0
32.5%
28.0
f
0.00
0.00
6065.860000
6065.86
6000.00
65.86
0.00
0.00
0.0000
Jul-2012
15.01
None
Jun-2012
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
35
1051117
1282787.0
14000.0
14000.0
14000.0
36 months
9.91%
451.15
B
B1
golfers warehouse
6 years
RENT
80000.00
Not Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
Borrower added on 12/15/11 > i am opening a ...
small_business
Small Business Loan
010xx
MA
10.00
0.0
Jul-1999
1.0
45.0
NaN
7.0
0.0
2219.0
13.4%
40.0
f
0.00
0.00
16239.914128
16239.91
14000.00
2239.91
0.00
0.00
0.0000
Jan-2015
457.91
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
36
1069465
1304521.0
5000.0
5000.0
5000.0
36 months
8.90%
158.77
A
A5
STERIS Corporation
10+ years
MORTGAGE
100000.00
Source Verified
Dec-2011
Charged Off
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt Consolidation for a better life
441xx
OH
16.33
0.0
Jun-1995
0.0
NaN
NaN
17.0
0.0
74351.0
62.1%
35.0
f
0.00
0.00
5021.370000
5021.37
4217.38
696.99
0.00
107.00
1.0700
Aug-2014
158.77
None
Dec-2014
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
37
1069283
1304166.0
10000.0
10000.0
10000.0
36 months
10.65%
325.74
B
B2
Costco Wholesale Corp.
6 years
RENT
27000.00
Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
other
Other Loan
104xx
NY
11.47
0.0
Nov-2006
0.0
NaN
NaN
7.0
0.0
7814.0
52.3%
10.0
f
0.00
0.00
11724.567737
11724.57
10000.00
1724.57
0.00
0.00
0.0000
Jan-2015
332.92
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
38
1069287
1304171.0
10000.0
10000.0
10000.0
36 months
6.03%
304.36
A
A1
Helicoil
10+ years
RENT
60000.00
Not Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
credit_card
Credit Card Loan
067xx
CT
12.74
0.0
Sep-1992
1.0
NaN
NaN
11.0
0.0
14019.0
19.5%
18.0
f
0.00
0.00
10282.670000
10282.67
10000.00
282.67
0.00
0.00
0.0000
Jul-2012
8762.05
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
39
1069453
1303701.0
11000.0
11000.0
11000.0
36 months
6.62%
337.75
A
A2
cognizant technology solutions
5 years
RENT
70000.00
Not Verified
Dec-2011
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt Consolitation
061xx
CT
10.85
0.0
Jan-2002
0.0
NaN
NaN
5.0
0.0
11638.0
36.4%
7.0
f
0.00
0.00
12157.380047
12157.38
11000.00
1157.38
0.00
0.00
0.0000
Jan-2015
346.13
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
619975
37277377
40070127.0
20000.0
20000.0
20000.0
36 months
14.99%
693.21
C
C5
mfg/tech
10+ years
MORTGAGE
78000.00
Source Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
credit_card
Credit card refinancing
451xx
OH
24.23
0.0
Nov-1997
0.0
57.0
NaN
19.0
0.0
24075.0
68.2%
40.0
f
14298.28
14298.28
8285.210000
8285.21
5701.72
2583.49
0.00
0.00
0.0000
Jan-2016
693.21
Feb-2016
Jan-2016
0.0
57.0
1.0
INDIVIDUAL
None
None
None
0.0
0.0
132273.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
35300.0
NaN
NaN
NaN
619976
37307275
39880015.0
15000.0
15000.0
15000.0
36 months
14.99%
519.91
C
C5
None
n/a
RENT
46759.00
Source Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
219xx
MD
14.45
1.0
Nov-1995
0.0
19.0
NaN
6.0
0.0
9307.0
88.6%
19.0
f
10723.68
10723.68
6213.940000
6213.94
4276.32
1937.62
0.00
0.00
0.0000
Jan-2016
519.91
Feb-2016
Jan-2016
0.0
19.0
1.0
INDIVIDUAL
None
None
None
0.0
0.0
39472.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
10500.0
NaN
NaN
NaN
619977
36799576
39552288.0
10000.0
10000.0
10000.0
36 months
13.66%
340.13
C
C3
shipping & receiving
10+ years
RENT
25000.00
Source Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
credit_card
Credit card refinancing
917xx
CA
10.27
0.0
Feb-2006
0.0
NaN
NaN
8.0
0.0
6504.0
72.3%
13.0
w
7107.80
7107.80
4066.380000
4066.38
2892.20
1174.18
0.00
0.00
0.0000
Jan-2016
340.13
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
6504.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
9000.0
NaN
NaN
NaN
619978
37167317
39940064.0
10000.0
10000.0
10000.0
36 months
16.49%
354.00
D
D3
crew leader
2 years
RENT
32000.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
296xx
SC
11.40
0.0
Nov-2009
1.0
NaN
NaN
5.0
0.0
3437.0
42.4%
7.0
f
7195.29
7195.29
4229.680000
4229.68
2804.71
1424.97
0.00
0.00
0.0000
Jan-2016
354.00
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
7767.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
8100.0
NaN
NaN
NaN
619979
34743522
37436820.0
35000.0
35000.0
35000.0
36 months
12.99%
1179.12
C
C2
CEO
4 years
RENT
200000.00
Source Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
credit_card
Credit card refinancing
926xx
CA
16.19
0.0
Jun-2004
3.0
NaN
NaN
9.0
0.0
11374.0
29.2%
12.0
w
24804.18
24804.18
14098.920000
14098.92
10195.82
3903.10
0.00
0.00
0.0000
Jan-2016
1179.12
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
109376.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
69000.0
NaN
NaN
NaN
619980
36808291
39561021.0
8000.0
8000.0
8000.0
36 months
8.19%
251.40
A
A5
operator
7 years
RENT
40000.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
644xx
MO
5.55
0.0
Aug-2005
0.0
NaN
NaN
8.0
0.0
6473.0
31.4%
13.0
w
5547.70
5547.70
3009.520000
3009.52
2452.30
557.22
0.00
0.00
0.0000
Jan-2016
251.40
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
7046.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
20600.0
NaN
NaN
NaN
619981
36798010
39550722.0
8750.0
8750.0
8750.0
36 months
12.39%
292.26
C
C1
Department Manager
2 years
MORTGAGE
25000.00
Not Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
credit_card
Credit card refinancing
631xx
MO
27.70
0.0
Nov-1995
1.0
54.0
NaN
5.0
0.0
10490.0
69%
17.0
f
6184.56
6184.56
3495.070000
3495.07
2565.44
929.63
0.00
0.00
0.0000
Jan-2016
292.26
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
27927.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
15100.0
NaN
NaN
NaN
619982
37257249
40029977.0
18000.0
18000.0
18000.0
36 months
12.99%
606.41
C
C2
lieutenant
10+ years
MORTGAGE
105000.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
115xx
NY
28.00
1.0
Aug-1998
1.0
10.0
NaN
10.0
0.0
28317.0
80%
22.0
f
12756.37
12756.37
7250.940000
7250.94
5243.63
2007.31
0.00
0.00
0.0000
Jan-2016
606.41
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
339476.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
35400.0
NaN
NaN
NaN
619983
37077186
39839905.0
14000.0
14000.0
14000.0
36 months
15.99%
492.13
D
D2
District Manager
5 years
MORTGAGE
69000.00
Verified
Jan-2015
Charged Off
n
https://www.lendingclub.com/browse/loanDetail....
None
home_improvement
Home improvement
328xx
FL
8.23
0.0
Nov-2003
0.0
73.0
NaN
9.0
0.0
7755.0
64.1%
15.0
f
0.00
0.00
3420.040000
3420.04
2226.49
1193.55
0.00
0.00
0.0000
Aug-2015
492.13
None
Jan-2016
0.0
75.0
1.0
INDIVIDUAL
None
None
None
0.0
0.0
22279.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
12100.0
NaN
NaN
NaN
619984
36089213
38800806.0
8250.0
8250.0
8250.0
36 months
16.49%
292.05
D
D3
aviation Technician
9 years
RENT
91000.00
Source Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
medical
Medical expenses
553xx
MN
2.03
0.0
Apr-1996
3.0
42.0
37.0
5.0
2.0
3893.0
19.5%
17.0
f
5936.11
5936.11
3489.480000
3489.48
2313.89
1175.59
0.00
0.00
0.0000
Jan-2016
292.05
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
3893.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
20000.0
NaN
NaN
NaN
619985
37187152
39959868.0
15000.0
15000.0
15000.0
36 months
12.39%
501.02
C
C1
Merchandiser
6 years
MORTGAGE
75000.00
Verified
Jan-2015
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
304xx
GA
23.35
0.0
Feb-1999
0.0
NaN
NaN
13.0
0.0
31794.0
81.5%
25.0
f
0.00
0.00
16170.460000
16170.46
15000.00
1170.46
0.00
0.00
0.0000
Sep-2015
12683.97
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
186375.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
39000.0
NaN
NaN
NaN
619986
37297140
40039857.0
24625.0
24625.0
24625.0
36 months
14.31%
845.34
C
C4
Senior Medical Writer
< 1 year
RENT
84000.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
credit_card
Credit card refinancing
100xx
NY
2.27
0.0
Oct-1998
0.0
NaN
92.0
6.0
1.0
4047.0
101.2%
15.0
f
17552.82
17552.82
10104.930000
10104.93
7072.18
3032.75
0.00
0.00
0.0000
Jan-2016
845.34
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
14181.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
4000.0
NaN
NaN
NaN
619987
36351602
39083061.0
18275.0
18275.0
18275.0
36 months
20.99%
688.42
E
E4
Director of laboratory services
4 years
MORTGAGE
120000.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
882xx
NM
17.40
3.0
Apr-1994
2.0
7.0
NaN
12.0
0.0
10414.0
58.2%
32.0
f
13398.34
13398.34
8218.420000
8218.42
4876.66
3341.76
0.00
0.00
0.0000
Jan-2016
688.42
Feb-2016
Jan-2016
0.0
58.0
1.0
INDIVIDUAL
None
None
None
0.0
0.0
408183.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
17900.0
NaN
NaN
NaN
619988
36900303
39653039.0
1200.0
1200.0
1200.0
36 months
8.19%
37.71
A
A5
material coordinator
< 1 year
MORTGAGE
30000.00
Not Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
credit_card
Credit card refinancing
612xx
IL
7.84
0.0
Dec-1993
1.0
NaN
53.0
5.0
2.0
619.0
36.4%
16.0
w
832.16
832.16
451.430000
451.43
367.84
83.59
0.00
0.00
0.0000
Jan-2016
37.71
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
103081.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
1700.0
NaN
NaN
NaN
619989
36421722
39143147.0
20000.0
20000.0
20000.0
36 months
11.44%
658.95
B
B4
Agent
10+ years
MORTGAGE
78000.00
Source Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
921xx
CA
20.51
0.0
Sep-1984
0.0
NaN
NaN
16.0
0.0
33388.0
46.1%
37.0
f
14076.39
14076.39
7881.980000
7881.98
5923.61
1958.37
0.00
0.00
0.0000
Jan-2016
658.95
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
360.0
256735.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
72400.0
NaN
NaN
NaN
619990
35034116
37717438.0
16000.0
16000.0
16000.0
36 months
8.19%
502.79
A
A5
Manager
9 years
MORTGAGE
200000.00
Source Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
760xx
TX
26.82
0.0
May-2002
0.0
NaN
NaN
29.0
0.0
29564.0
62.5%
46.0
f
11095.53
11095.53
6018.920000
6018.92
4904.47
1114.45
0.00
0.00
0.0000
Jan-2016
502.79
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
349131.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
47300.0
NaN
NaN
NaN
619991
36870234
39622961.0
5000.0
5000.0
5000.0
36 months
13.66%
170.07
C
C3
Rental/Retail Manager
10+ years
RENT
55000.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
other
Other
053xx
VT
11.30
0.0
Nov-2002
0.0
NaN
NaN
2.0
0.0
497.0
38.2%
5.0
w
3553.84
3553.84
2033.250000
2033.25
1446.16
587.09
0.00
0.00
0.0000
Jan-2016
170.07
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
31933.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
1300.0
NaN
NaN
NaN
619992
37011266
39773999.0
28000.0
28000.0
28000.0
36 months
15.59%
978.74
D
D1
sales manager
3 years
RENT
120000.00
Verified
Jan-2015
Late (31-120 days)
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
115xx
NY
26.60
0.0
Oct-2003
0.0
69.0
NaN
17.0
0.0
39234.0
90.5%
37.0
f
22168.73
22168.73
8760.160000
8760.16
5831.27
2928.89
0.00
0.00
0.0000
Oct-2015
978.74
Feb-2016
Jan-2016
0.0
69.0
1.0
INDIVIDUAL
None
None
None
0.0
0.0
74969.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
43500.0
NaN
NaN
NaN
619993
36808246
39560970.0
6000.0
6000.0
6000.0
36 months
10.49%
194.99
B
B3
Office Administrator
4 years
RENT
42000.00
Verified
Jan-2015
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
212xx
MD
10.66
0.0
May-1986
1.0
45.0
NaN
18.0
0.0
4419.0
10.2%
50.0
f
0.00
0.00
6465.380000
6465.38
6000.00
465.38
0.00
0.00
0.0000
Nov-2015
4717.46
None
Nov-2015
0.0
45.0
1.0
INDIVIDUAL
None
None
None
0.0
2140.0
4419.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
43400.0
NaN
NaN
NaN
619994
36631385
39374138.0
13000.0
13000.0
13000.0
36 months
8.19%
408.52
A
A5
Director of Transportation
10+ years
MORTGAGE
85000.00
Not Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
credit_card
Credit card refinancing
176xx
PA
8.05
1.0
Jun-1996
0.0
15.0
NaN
8.0
0.0
6646.0
92.3%
25.0
f
9015.08
9015.08
4890.410000
4890.41
3984.92
905.49
0.00
0.00
0.0000
Jan-2016
408.52
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
199384.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
7200.0
NaN
NaN
NaN
619995
36691397
39434133.0
20000.0
20000.0
20000.0
36 months
6.99%
617.46
A
A3
Mission info Tech
2 years
MORTGAGE
72000.00
Source Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
325xx
FL
27.24
0.0
Mar-1998
1.0
69.0
NaN
15.0
0.0
21100.0
53.1%
27.0
f
13792.10
13792.10
7393.990000
7393.99
6207.90
1186.09
0.00
0.00
0.0000
Jan-2016
617.46
Feb-2016
Jan-2016
0.0
70.0
1.0
INDIVIDUAL
None
None
None
0.0
0.0
388140.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
39700.0
NaN
NaN
NaN
619996
36743377
39486112.0
4200.0
4200.0
4200.0
36 months
15.99%
147.64
D
D2
supervisor
10+ years
MORTGAGE
48000.00
Verified
Jan-2015
Charged Off
n
https://www.lendingclub.com/browse/loanDetail....
None
medical
Medical expenses
810xx
CO
36.93
0.0
Aug-1990
0.0
38.0
NaN
13.0
0.0
12943.0
63.4%
45.0
f
0.00
0.00
1026.020000
1026.02
667.96
358.06
0.00
0.00
0.0000
Aug-2015
147.64
None
Jan-2016
0.0
38.0
1.0
INDIVIDUAL
None
None
None
0.0
0.0
207975.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
20400.0
NaN
NaN
NaN
619997
36231083
38942474.0
15000.0
15000.0
15000.0
36 months
11.99%
498.15
B
B5
Support Scientist II
< 1 year
RENT
70000.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
209xx
MD
8.47
0.0
Dec-2006
0.0
NaN
NaN
8.0
0.0
9508.0
98%
15.0
w
10583.21
10583.21
5957.820000
5957.82
4416.79
1541.03
0.00
0.00
0.0000
Jan-2016
498.15
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
15724.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
9700.0
NaN
NaN
NaN
619998
36250801
38962184.0
6000.0
6000.0
6000.0
36 months
17.86%
216.50
D
D5
Operator
10+ years
MORTGAGE
90000.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
308xx
GA
2.84
0.0
Jun-2001
0.0
NaN
NaN
9.0
0.0
6707.0
78.9%
16.0
f
4342.24
4342.24
2586.090000
2586.09
1657.76
928.33
0.00
0.00
0.0000
Jan-2016
216.50
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
384500.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
8500.0
NaN
NaN
NaN
619999
36331554
39042967.0
26950.0
26950.0
26950.0
36 months
8.19%
846.88
A
A5
None
n/a
RENT
54000.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
840xx
UT
18.11
0.0
Jun-1993
0.0
NaN
NaN
14.0
0.0
32167.0
24.9%
28.0
f
18689.12
18689.12
10138.040000
10138.04
8260.88
1877.16
0.00
0.00
0.0000
Jan-2016
846.88
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
41650.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
129100.0
NaN
NaN
NaN
620000
36201871
38913321.0
21000.0
21000.0
21000.0
36 months
6.03%
639.15
A
A1
Director
10+ years
MORTGAGE
65000.00
Source Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
credit_card
Credit card refinancing
021xx
MA
17.09
0.0
Oct-1994
0.0
NaN
NaN
11.0
0.0
23356.0
30.6%
25.0
f
14416.53
14416.53
7655.730000
7655.73
6583.47
1072.26
0.00
0.00
0.0000
Jan-2016
639.15
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
212337.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
76300.0
NaN
NaN
NaN
620001
36381756
39013193.0
8000.0
8000.0
8000.0
36 months
8.19%
251.40
A
A5
Sr. Tech
9 years
MORTGAGE
50000.00
Source Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
871xx
NM
17.62
0.0
Sep-2003
1.0
24.0
NaN
11.0
0.0
4611.0
63.2%
27.0
f
5547.70
5547.70
3009.520000
3009.52
2452.30
557.22
0.00
0.00
0.0000
Jan-2016
251.40
Feb-2016
Jan-2016
0.0
24.0
1.0
INDIVIDUAL
None
None
None
0.0
0.0
211412.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
7300.0
NaN
NaN
NaN
620002
36231724
38943173.0
12000.0
12000.0
12000.0
36 months
9.49%
384.34
B
B2
Bartender
4 years
RENT
40000.00
Source Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
891xx
NV
25.65
1.0
Oct-2006
0.0
8.0
NaN
8.0
0.0
8731.0
73.4%
15.0
f
8053.46
8053.46
4946.950000
4946.95
3946.54
1000.41
0.00
0.00
0.0000
Jan-2016
384.34
Feb-2016
Jan-2016
0.0
8.0
1.0
INDIVIDUAL
None
None
None
0.0
0.0
20671.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
11900.0
NaN
NaN
NaN
620003
36231718
38943165.0
10775.0
10775.0
10775.0
36 months
6.03%
327.95
A
A1
Coordinator of RSVP
< 1 year
RENT
54000.00
Not Verified
Jan-2015
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
325xx
FL
13.22
1.0
Nov-1975
0.0
16.0
NaN
9.0
0.0
10776.0
25.8%
21.0
w
0.00
0.00
11071.870000
11071.87
10775.00
296.87
0.00
0.00
0.0000
Jul-2015
9439.34
None
Jun-2015
0.0
28.0
1.0
INDIVIDUAL
None
None
None
0.0
0.0
24696.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
41700.0
NaN
NaN
NaN
620004
36381704
39013139.0
7000.0
7000.0
7000.0
36 months
14.31%
240.30
C
C4
machining Cell Lead
10+ years
RENT
57000.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
471xx
IN
16.80
2.0
Nov-2006
3.0
10.0
52.0
13.0
2.0
2684.0
27.1%
30.0
w
4989.63
4989.63
2878.840000
2878.84
2010.37
868.47
0.00
0.00
0.0000
Jan-2016
240.30
Feb-2016
Jan-2016
0.0
10.0
1.0
INDIVIDUAL
None
None
None
0.0
0.0
32135.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
9900.0
NaN
NaN
NaN
620005
36241316
38952731.0
6225.0
6225.0
6225.0
36 months
16.49%
220.37
D
D3
Painter
2 years
RENT
27000.00
Source Verified
Jan-2015
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
330xx
FL
18.58
0.0
Feb-2011
1.0
NaN
NaN
3.0
0.0
1756.0
97.6%
4.0
f
0.00
0.00
7050.460000
7050.46
6225.00
825.46
0.00
0.00
0.0000
Dec-2015
4858.17
None
Dec-2015
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
8357.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
1800.0
NaN
NaN
NaN
620006
36301729
39023153.0
10000.0
10000.0
10000.0
36 months
6.49%
306.45
A
A2
Area Director
1 year
RENT
75000.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
333xx
FL
33.66
0.0
Mar-2000
0.0
29.0
NaN
9.0
0.0
10529.0
34.7%
32.0
w
6879.87
6879.87
3670.190000
3670.19
3120.13
550.06
0.00
0.00
0.0000
Jan-2016
306.45
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
88120.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
30300.0
NaN
NaN
NaN
620007
36421485
39142898.0
4000.0
4000.0
4000.0
36 months
8.67%
126.59
B
B1
Lead Custodian
10+ years
MORTGAGE
50000.00
Verified
Jan-2015
Fully Paid
n
https://www.lendingclub.com/browse/loanDetail....
None
car
Car financing
956xx
CA
12.63
0.0
Sep-2002
0.0
NaN
84.0
11.0
1.0
1700.0
5.6%
30.0
f
0.00
0.00
4158.020000
4158.02
4000.00
158.02
0.00
0.00
0.0000
Jun-2015
3655.51
None
Nov-2015
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
18979.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
30100.0
NaN
NaN
NaN
620008
35094480
37777829.0
7500.0
7500.0
7500.0
36 months
9.49%
240.22
B
B2
Owner
8 years
RENT
40000.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
531xx
WI
25.63
0.0
Aug-1994
0.0
69.0
88.0
10.0
1.0
6361.0
43.9%
29.0
f
5232.15
5232.15
2874.730000
2874.73
2267.85
606.88
0.00
0.00
0.0000
Jan-2016
240.22
Feb-2016
Jan-2016
0.0
69.0
1.0
INDIVIDUAL
None
None
None
0.0
3174.0
18611.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
14500.0
NaN
NaN
NaN
620009
36260758
38972123.0
10850.0
10850.0
10850.0
36 months
19.24%
399.04
E
E2
None
n/a
OWN
32000.00
Verified
Jan-2015
Charged Off
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
430xx
OH
29.44
0.0
Jun-2002
1.0
65.0
NaN
9.0
0.0
6987.0
41.6%
20.0
f
0.00
0.00
2396.050000
2396.05
1405.77
990.28
0.00
0.00
0.0000
Aug-2015
25.00
None
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
972.0
53777.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
16800.0
NaN
NaN
NaN
620010
36330911
39042282.0
12000.0
12000.0
12000.0
36 months
11.99%
398.52
B
B5
KYC Business Analyst
< 1 year
MORTGAGE
63000.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
credit_card
Credit card refinancing
432xx
OH
23.69
1.0
Jun-1995
0.0
9.0
NaN
13.0
0.0
21110.0
69.7%
61.0
f
8466.56
8466.56
4766.250000
4766.25
3533.44
1232.81
0.00
0.00
0.0000
Jan-2016
398.52
Feb-2016
Jan-2016
0.0
9.0
1.0
INDIVIDUAL
None
None
None
0.0
0.0
237002.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
30300.0
NaN
NaN
NaN
620011
36221446
38932858.0
11575.0
11575.0
11575.0
36 months
15.59%
404.61
D
D1
Manager
10+ years
RENT
25400.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
credit_card
Credit card refinancing
791xx
TX
27.08
0.0
Jul-1999
0.0
NaN
NaN
9.0
0.0
18266.0
65%
18.0
f
8296.52
8296.52
4863.330000
4863.33
3278.48
1584.85
0.00
0.00
0.0000
Jan-2016
404.61
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
19798.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
28100.0
NaN
NaN
NaN
620012
36371250
39102635.0
10000.0
10000.0
10000.0
36 months
11.99%
332.10
B
B5
Office Assistant
8 years
RENT
31000.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
debt_consolidation
Debt consolidation
905xx
CA
28.69
0.0
Sep-2004
0.0
NaN
77.0
9.0
1.0
14037.0
82.1%
15.0
f
7055.47
7055.47
3971.880000
3971.88
2944.53
1027.35
0.00
0.00
0.0000
Jan-2016
332.10
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
25274.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
17100.0
NaN
NaN
NaN
620013
36441262
39152692.0
24000.0
24000.0
24000.0
36 months
11.99%
797.03
B
B5
Director of Maintenance
10+ years
MORTGAGE
79000.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
home_improvement
Home improvement
072xx
NJ
3.90
0.0
Mar-1974
1.0
26.0
NaN
5.0
0.0
8621.0
84.5%
23.0
f
16933.26
16933.26
9532.390000
9532.39
7066.74
2465.65
0.00
0.00
0.0000
Jan-2016
797.03
Feb-2016
Jan-2016
0.0
29.0
1.0
INDIVIDUAL
None
None
None
0.0
0.0
140285.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
10200.0
NaN
NaN
NaN
620014
36271262
38982659.0
20000.0
20000.0
20000.0
36 months
11.99%
664.20
B
B5
Manager Hotel Operations Oasis
10+ years
RENT
100000.00
Verified
Jan-2015
Current
n
https://www.lendingclub.com/browse/loanDetail....
None
credit_card
Credit card refinancing
331xx
FL
10.83
0.0
Dec-2001
1.0
NaN
110.0
8.0
1.0
33266.0
79.8%
10.0
f
14110.94
14110.94
7943.760000
7943.76
5889.06
2054.70
0.00
0.00
0.0000
Jan-2016
664.20
Feb-2016
Jan-2016
0.0
NaN
1.0
INDIVIDUAL
None
None
None
0.0
0.0
33307.0
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
41700.0
NaN
NaN
NaN
620015 rows × 74 columns
In [4]:
data.columns.values
Out[4]:
array(['index', 'id', 'member_id', 'loan_amnt', 'funded_amnt',
'funded_amnt_inv', 'term', 'int_rate', 'installment', 'grade',
'sub_grade', 'emp_title', 'emp_length', 'home_ownership',
'annual_inc', 'verification_status', 'issue_d', 'loan_status',
'pymnt_plan', 'url', 'desc', 'purpose', 'title', 'zip_code',
'addr_state', 'dti', 'delinq_2yrs', 'earliest_cr_line',
'inq_last_6mths', 'mths_since_last_delinq',
'mths_since_last_record', 'open_acc', 'pub_rec', 'revol_bal',
'revol_util', 'total_acc', 'initial_list_status', 'out_prncp',
'out_prncp_inv', 'total_pymnt', 'total_pymnt_inv',
'total_rec_prncp', 'total_rec_int', 'total_rec_late_fee',
'recoveries', 'collection_recovery_fee', 'last_pymnt_d',
'last_pymnt_amnt', 'next_pymnt_d', 'last_credit_pull_d',
'collections_12_mths_ex_med', 'mths_since_last_major_derog',
'policy_code', 'application_type', 'annual_inc_joint', 'dti_joint',
'verification_status_joint', 'acc_now_delinq', 'tot_coll_amt',
'tot_cur_bal', 'open_acc_6m', 'open_il_6m', 'open_il_12m',
'open_il_24m', 'mths_since_rcnt_il', 'total_bal_il', 'il_util',
'open_rv_12m', 'open_rv_24m', 'max_bal_bc', 'all_util',
'total_rev_hi_lim', 'inq_fi', 'total_cu_tl', 'inq_last_12m'], dtype=object)
In [5]:
feat_raw=pd.DataFrame
memberinfo=['id','loan_amnt','term','int_rate','installment','sub_grade','emp_title', 'emp_length', 'home_ownership',
'annual_inc','loan_status','purpose',
'addr_state', 'dti', 'delinq_2yrs', 'earliest_cr_line',
'inq_last_6mths', 'mths_since_last_delinq',
'mths_since_last_record', 'open_acc', 'pub_rec', 'revol_bal',
'revol_util', 'total_acc','total_pymnt','total_rec_prncp','total_rec_int', 'total_rec_late_fee',
'recoveries', 'collection_recovery_fee', 'last_pymnt_d',
'last_pymnt_amnt', 'next_pymnt_d','collections_12_mths_ex_med', 'mths_since_last_major_derog']
feat_raw=data[memberinfo].copy()
In [6]:
feat_raw.dtypes
Out[6]:
id object
loan_amnt float64
term object
int_rate object
installment float64
sub_grade object
emp_title object
emp_length object
home_ownership object
annual_inc float64
loan_status object
purpose object
addr_state object
dti float64
delinq_2yrs float64
earliest_cr_line object
inq_last_6mths float64
mths_since_last_delinq float64
mths_since_last_record float64
open_acc float64
pub_rec float64
revol_bal float64
revol_util object
total_acc float64
total_pymnt float64
total_rec_prncp float64
total_rec_int float64
total_rec_late_fee float64
recoveries float64
collection_recovery_fee float64
last_pymnt_d object
last_pymnt_amnt float64
next_pymnt_d object
collections_12_mths_ex_med float64
mths_since_last_major_derog float64
dtype: object
In [7]:
feat_raw.isnull().sum()
Out[7]:
id 0
loan_amnt 0
term 0
int_rate 0
installment 0
sub_grade 0
emp_title 41496
emp_length 0
home_ownership 0
annual_inc 4
loan_status 0
purpose 0
addr_state 0
dti 0
delinq_2yrs 28
earliest_cr_line 28
inq_last_6mths 28
mths_since_last_delinq 316869
mths_since_last_record 519656
open_acc 28
pub_rec 28
revol_bal 0
revol_util 384
total_acc 28
total_pymnt 0
total_rec_prncp 0
total_rec_int 0
total_rec_late_fee 0
recoveries 0
collection_recovery_fee 0
last_pymnt_d 12222
last_pymnt_amnt 0
next_pymnt_d 195889
collections_12_mths_ex_med 140
mths_since_last_major_derog 461992
dtype: int64
In [8]:
feat_raw.annual_inc.fillna(0,inplace=True)
feat_raw.revol_bal.fillna(0,inplace=True)
feat_raw.collections_12_mths_ex_med.fillna(0,inplace=True)
feat_raw.isnull().sum()
Out[8]:
id 0
loan_amnt 0
term 0
int_rate 0
installment 0
sub_grade 0
emp_title 41496
emp_length 0
home_ownership 0
annual_inc 0
loan_status 0
purpose 0
addr_state 0
dti 0
delinq_2yrs 28
earliest_cr_line 28
inq_last_6mths 28
mths_since_last_delinq 316869
mths_since_last_record 519656
open_acc 28
pub_rec 28
revol_bal 0
revol_util 384
total_acc 28
total_pymnt 0
total_rec_prncp 0
total_rec_int 0
total_rec_late_fee 0
recoveries 0
collection_recovery_fee 0
last_pymnt_d 12222
last_pymnt_amnt 0
next_pymnt_d 195889
collections_12_mths_ex_med 0
mths_since_last_major_derog 461992
dtype: int64
In [9]:
feat_raw.query('total_acc != total_acc')
Out[9]:
id
loan_amnt
term
int_rate
installment
sub_grade
emp_title
emp_length
home_ownership
annual_inc
loan_status
purpose
addr_state
dti
delinq_2yrs
earliest_cr_line
inq_last_6mths
mths_since_last_delinq
mths_since_last_record
open_acc
pub_rec
revol_bal
revol_util
total_acc
total_pymnt
total_rec_prncp
total_rec_int
total_rec_late_fee
recoveries
collection_recovery_fee
last_pymnt_d
last_pymnt_amnt
next_pymnt_d
collections_12_mths_ex_med
mths_since_last_major_derog
30603
79967
5000.0
36 months
7.43%
155.38
A2
None
< 1 year
NONE
0.0
Does not meet the credit policy. Status:Fully ...
other
NY
1.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
5593.46
5000.00
593.46
0.000000
0.00
0.0000
Aug-2010
157.31
Sep-2010
0.0
NaN
30604
79924
7000.0
36 months
7.75%
218.55
A3
None
< 1 year
NONE
0.0
Does not meet the credit policy. Status:Fully ...
other
NY
1.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
7867.53
7000.00
867.53
0.000000
0.00
0.0000
Aug-2010
220.03
Sep-2010
0.0
NaN
30613
71823
4350.0
36 months
8.07%
136.45
A4
None
< 1 year
RENT
120000.0
Does not meet the credit policy. Status:Fully ...
other
MA
4.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
4911.68
4350.00
561.68
0.000000
0.00
0.0000
Aug-2010
139.93
Sep-2010
0.0
NaN
30624
72197
3900.0
36 months
9.33%
124.62
B3
None
< 1 year
RENT
98000.0
Does not meet the credit policy. Status:Fully ...
other
NY
10.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
4485.99
3900.00
585.99
0.000000
0.00
0.0000
Aug-2010
126.06
Sep-2010
0.0
NaN
30632
79893
6700.0
36 months
7.75%
209.18
A3
None
< 1 year
NONE
0.0
Does not meet the credit policy. Status:Fully ...
other
NY
1.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
7530.42
6700.00
830.42
0.000000
0.00
0.0000
Jul-2010
209.89
Aug-2010
0.0
NaN
30635
73003
3200.0
36 months
9.96%
103.20
B5
None
< 1 year
MORTGAGE
150000.0
Does not meet the credit policy. Status:Fully ...
other
MA
10.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
3590.53
3200.00
390.53
0.000000
0.00
0.0000
Feb-2009
1733.32
Mar-2009
0.0
NaN
30658
91023
1900.0
36 months
9.64%
61.00
B4
Scheduall
1 year
MORTGAGE
100000.0
Does not meet the credit policy. Status:Fully ...
debt_consolidation
FL
10.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
1999.12
1900.00
99.12
0.000000
0.00
0.0000
Feb-2008
0.00
Feb-2008
0.0
NaN
30663
85961
1200.0
36 months
9.01%
38.17
B2
Classic Components
< 1 year
RENT
36000.0
Does not meet the credit policy. Status:Fully ...
other
TX
3.27
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
1373.88
1200.00
173.88
0.000000
0.00
0.0000
Jul-2010
39.05
Jul-2010
0.0
NaN
30664
85818
5000.0
36 months
11.22%
164.23
C4
Compensation Solutions
< 1 year
RENT
28000.0
Does not meet the credit policy. Status:Fully ...
other
NJ
3.51
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
5858.35
5000.00
828.36
29.994759
0.00
0.0000
Apr-2010
149.43
Apr-2010
0.0
NaN
30665
85781
1400.0
36 months
10.91%
45.78
C3
Stanford University Libraries, LOCKSS Project
< 1 year
RENT
40000.0
Does not meet the credit policy. Status:Fully ...
other
MO
8.61
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
1663.04
1400.00
248.05
14.994369
0.00
0.0000
Jul-2010
1.78
Aug-2010
0.0
NaN
30666
85675
1000.0
36 months
14.07%
34.21
E3
Macy's
10+ years
RENT
25000.0
Does not meet the credit policy. Status:Fully ...
other
NJ
16.27
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
1231.38
1000.00
231.38
0.000000
0.00
0.0000
Jun-2010
35.27
Jul-2010
0.0
NaN
30667
84670
5000.0
36 months
7.75%
156.11
A3
Diamond Management and Technology Consultants
10+ years
MORTGAGE
300000.0
Does not meet the credit policy. Status:Fully ...
other
LA
5.38
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
5565.65
5000.00
565.65
0.000000
0.00
0.0000
Aug-2009
1663.91
Sep-2009
0.0
NaN
30668
84098
2500.0
36 months
7.43%
77.69
A2
U.S. Bank
9 years
MORTGAGE
66624.0
Does not meet the credit policy. Status:Fully ...
other
OH
10.36
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
2600.23
2500.00
100.23
0.000000
0.00
0.0000
Jan-2008
0.00
Jan-2008
0.0
NaN
30669
83979
3000.0
36 months
7.43%
93.23
A2
NC
1 year
MORTGAGE
80000.0
Does not meet the credit policy. Status:Fully ...
other
NJ
0.39
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
3120.26
3000.00
120.26
0.000000
0.00
0.0000
Jan-2008
0.00
Jan-2008
0.0
NaN
30670
83489
2600.0
36 months
8.38%
81.94
A5
College Pro Painters
3 years
MORTGAGE
6500.0
Does not meet the credit policy. Status:Charge...
other
CO
6.46
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
2342.01
1962.69
329.05
21.640000
28.63
0.3400
Mar-2010
21.75
Mar-2010
0.0
NaN
30671
83185
1000.0
36 months
7.12%
30.94
A1
Mana Products
6 years
RENT
50000.0
Does not meet the credit policy. Status:Fully ...
other
NY
1.10
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
1113.35
1000.00
113.35
0.000000
0.00
0.0000
Jun-2010
32.93
Jul-2010
0.0
NaN
30672
76629
1275.0
36 months
12.49%
42.65
D3
Infinitely law group
1 year
RENT
40000.0
Does not meet the credit policy. Status:Charge...
other
MA
10.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
1341.96
340.50
128.57
0.000000
872.89
305.5105
May-2008
42.65
Dec-2008
0.0
NaN
30673
74014
6450.0
36 months
11.22%
211.85
C4
Apto Solutions
2 years
RENT
32000.0
Does not meet the credit policy. Status:Fully ...
other
GA
10.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
7798.60
6450.00
1228.60
120.000000
0.00
0.0000
Jul-2010
167.78
Jul-2010
0.0
NaN
30674
81085
10500.0
36 months
11.22%
344.87
C4
Town of Plainville
3 years
RENT
60000.0
Does not meet the credit policy. Status:Fully ...
other
CT
19.50
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
11219.80
10500.00
719.80
0.000000
0.00
0.0000
Aug-2008
0.00
Aug-2008
0.0
NaN
30675
77792
3000.0
36 months
9.01%
95.42
B2
Tanks Tavern
< 1 year
RENT
35000.0
Does not meet the credit policy. Status:Fully ...
other
KS
10.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
3434.97
3000.00
434.97
0.000000
0.00
0.0000
Jul-2010
95.66
Jul-2010
0.0
NaN
30676
77757
3000.0
36 months
9.33%
95.86
B3
None
< 1 year
OWN
20000.0
Does not meet the credit policy. Status:Fully ...
other
MA
10.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
3450.79
3000.00
450.79
0.000000
0.00
0.0000
Jun-2010
96.77
Jul-2010
0.0
NaN
30677
74505
2000.0
36 months
9.96%
64.50
B5
None
< 1 year
RENT
6000.0
Does not meet the credit policy. Status:Fully ...
other
FL
10.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
2322.36
2000.00
322.36
0.000000
0.00
0.0000
Jul-2010
0.84
Aug-2010
0.0
NaN
30678
74323
6500.0
36 months
9.64%
208.66
B4
Air Force
< 1 year
RENT
20000.0
Does not meet the credit policy. Status:Charge...
other
CT
10.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
7193.05
1791.32
503.81
0.000000
4897.92
1714.2700
May-2008
208.65
Dec-2008
0.0
NaN
30679
73582
3500.0
36 months
10.28%
113.39
C1
None
< 1 year
RENT
180000.0
Does not meet the credit policy. Status:Fully ...
other
NY
10.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
3719.34
3500.00
219.34
0.000000
0.00
0.0000
Mar-2008
0.00
Mar-2008
0.0
NaN
30680
72998
1000.0
36 months
9.64%
32.11
B4
Halping hands company inc.
< 1 year
RENT
12000.0
Does not meet the credit policy. Status:Fully ...
other
MA
10.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
1155.53
1000.00
155.53
0.000000
0.00
0.0000
Jun-2010
32.41
Jul-2010
0.0
NaN
30681
72176
2525.0
36 months
9.33%
80.69
B3
None
< 1 year
RENT
110000.0
Does not meet the credit policy. Status:Fully ...
other
NY
10.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
2904.30
2525.00
379.30
0.000000
0.00
0.0000
Jun-2010
82.03
Jul-2010
0.0
NaN
30682
71623
6500.0
36 months
8.38%
204.84
A5
None
< 1 year
NONE
0.0
Does not meet the credit policy. Status:Fully ...
other
NY
4.00
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
7373.83
6500.00
873.83
0.000000
0.00
0.0000
Jun-2010
205.32
Jul-2010
0.0
NaN
30683
70686
5000.0
36 months
7.75%
156.11
A3
Homemaker
10+ years
MORTGAGE
70000.0
Does not meet the credit policy. Status:Fully ...
other
CT
8.81
NaN
None
NaN
NaN
NaN
NaN
NaN
0.0
None
NaN
5619.72
5000.00
619.72
0.000000
0.00
0.0000
Jun-2010
156.39
Jul-2010
0.0
NaN
Most interestingly, they all have a status "Does not meet the credit policy". Lets look into that, as that is not an expected value.
In [10]:
grp = feat_raw.groupby('loan_status')
grp.describe()
Out[10]:
annual_inc
collection_recovery_fee
collections_12_mths_ex_med
delinq_2yrs
dti
inq_last_6mths
installment
last_pymnt_amnt
loan_amnt
mths_since_last_delinq
mths_since_last_major_derog
mths_since_last_record
open_acc
pub_rec
recoveries
revol_bal
total_acc
total_pymnt
total_rec_int
total_rec_late_fee
total_rec_prncp
loan_status
Charged Off
count
2.899900e+04
28999.000000
28999.000000
28999.000000
28999.000000
28999.000000
28999.000000
28999.000000
28999.000000
13009.000000
5787.000000
3787.000000
28999.000000
28999.000000
28999.000000
2.899900e+04
28999.000000
28999.000000
28999.000000
28999.000000
28999.000000
mean
6.115969e+04
69.970545
0.007828
0.280423
18.104272
0.969792
403.473397
414.051346
11692.973896
34.237682
42.807327
76.785582
10.741784
0.153005
641.675609
1.347438e+04
23.084831
5584.689552
1408.531769
2.512973
3531.969198
std
6.455718e+04
225.409847
0.092334
0.802859
7.997711
1.117541
257.209008
515.120271
7347.473781
21.968352
21.744058
30.621205
4.847813
0.467737
1218.739994
1.755516e+04
11.351386
4970.646087
1326.085256
10.213291
3487.942848
min
4.080000e+03
0.000000
0.000000
0.000000
0.000000
0.000000
29.160000
0.000000
900.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000e+00
2.000000
0.000000
0.000000
0.000000
0.000000
25%
3.700000e+04
0.000000
0.000000
0.000000
12.160000
0.000000
218.130000
201.270000
6250.000000
15.000000
25.000000
56.000000
7.000000
0.000000
0.000000
5.580500e+03
15.000000
2113.830000
516.760000
0.000000
1130.910000
50%
5.130000e+04
0.700000
0.000000
0.000000
18.010000
1.000000
341.670000
334.730000
10000.000000
31.000000
42.000000
84.000000
10.000000
0.000000
26.330000
9.973000e+03
21.000000
4184.390000
1038.920000
0.000000
2477.890000
75%
7.300000e+04
17.289700
0.000000
0.000000
23.890000
2.000000
522.260000
518.340000
15000.000000
50.000000
60.000000
102.000000
13.000000
0.000000
896.930000
1.689300e+04
30.000000
7486.415000
1870.905000
0.000000
4762.535000
max
8.706582e+06
7002.190000
2.000000
18.000000
39.910000
8.000000
1424.570000
34833.350000
35000.000000
152.000000
152.000000
129.000000
45.000000
12.000000
31900.520000
1.746716e+06
110.000000
43935.130000
16602.700000
294.680000
34483.270000
Current
count
4.026380e+05
402638.000000
402638.000000
402638.000000
402638.000000
402638.000000
402638.000000
402638.000000
402638.000000
204779.000000
115041.000000
70787.000000
402638.000000
402638.000000
402638.000000
4.026380e+05
402638.000000
402638.000000
402638.000000
402638.000000
402638.000000
mean
7.367112e+04
0.000000
0.018739
0.342807
18.130677
0.608971
421.692001
425.935786
12809.665941
33.824499
44.393529
68.205108
11.488650
0.232000
0.000000
1.619940e+04
24.531892
4802.878939
1099.982654
0.137521
3702.758763
std
6.754683e+04
0.000000
0.155801
0.912100
8.367540
0.906854
262.806130
375.301486
7953.401301
21.824649
22.402884
27.006649
5.381903
0.670157
0.000000
2.335230e+04
11.780115
5230.559377
1207.551753
2.300606
4145.316809
min
3.000000e+03
0.000000
0.000000
0.000000
0.000000
0.000000
30.120000
0.000000
1000.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000e+00
2.000000
0.000000
0.000000
0.000000
0.000000
25%
4.300000e+04
0.000000
0.000000
0.000000
11.780000
0.000000
225.840000
220.050000
7000.000000
15.000000
27.000000
50.000000
8.000000
0.000000
0.000000
5.989000e+03
16.000000
1231.792500
297.100000
0.000000
903.230000
50%
6.100000e+04
0.000000
0.000000
0.000000
17.570000
0.000000
346.395000
344.950000
10000.000000
30.000000
44.000000
67.000000
11.000000
0.000000
0.000000
1.091500e+04
23.000000
3035.005000
714.610000
0.000000
2269.110000
75%
8.911925e+04
0.000000
0.000000
0.000000
24.060000
1.000000
561.430000
561.590000
17000.000000
49.000000
62.000000
87.000000
14.000000
0.000000
0.000000
1.936600e+04
31.000000
6500.780000
1480.620000
0.000000
4969.150000
max
9.000000e+06
0.000000
20.000000
30.000000
39.990000
6.000000
1445.460000
35330.490000
35000.000000
188.000000
188.000000
121.000000
84.000000
86.000000
0.000000
2.904836e+06
169.000000
46757.530000
14828.710000
229.750000
34998.170000
Default
count
7.150000e+02
715.000000
715.000000
715.000000
715.000000
715.000000
715.000000
715.000000
715.000000
345.000000
202.000000
131.000000
715.000000
715.000000
715.000000
7.150000e+02
715.000000
715.000000
715.000000
715.000000
715.000000
mean
6.228154e+04
0.000000
0.019580
0.401399
19.504517
0.871329
414.011301
430.149650
12019.860140
33.072464
43.613861
73.175573
11.496503
0.223776
0.000000
1.383329e+04
24.254545
5503.680307
1533.111301
1.772264
3968.796755
std
5.963224e+04
0.000000
0.138650
1.099910
8.298499
1.114057
255.480159
357.752037
7362.857281
21.618198
23.100675
24.960116
5.064118
0.545154
0.000000
2.060174e+04
12.225569
5433.390650
1449.510053
7.877050
4081.943163
min
9.300000e+03
0.000000
0.000000
0.000000
0.380000
0.000000
33.210000
0.000000
1000.000000
1.000000
1.000000
6.000000
1.000000
0.000000
0.000000
0.000000e+00
4.000000
0.000000
0.000000
0.000000
0.000000
25%
3.625000e+04
0.000000
0.000000
0.000000
13.440000
0.000000
221.535000
230.560000
6400.000000
14.000000
25.000000
56.000000
8.000000
0.000000
0.000000
5.237000e+03
15.000000
1959.820000
569.105000
0.000000
1363.630000
50%
5.100000e+04
0.000000
0.000000
0.000000
19.380000
1.000000
352.680000
356.480000
10000.000000
29.000000
45.000000
74.000000
11.000000
0.000000
0.000000
9.951000e+03
22.000000
3828.910000
1084.200000
0.000000
2701.970000
75%
7.431300e+04
0.000000
0.000000
0.000000
25.470000
1.000000
528.100000
537.050000
15000.000000
50.000000
60.000000
90.500000
14.000000
0.000000
0.000000
1.681600e+04
32.000000
7217.480000
2008.335000
0.000000
5174.080000
max
1.300000e+06
0.000000
1.000000
11.000000
39.720000
6.000000
1300.200000
6960.700000
35000.000000
81.000000
136.000000
119.000000
33.000000
5.000000
0.000000
4.037950e+05
82.000000
36811.500000
10535.570000
75.880000
27965.700000
Does not meet the credit policy. Status:Charged Off
count
6.170000e+02
617.000000
617.000000
614.000000
617.000000
614.000000
617.000000
617.000000
617.000000
389.000000
0.000000
263.000000
614.000000
614.000000
617.000000
6.170000e+02
614.000000
617.000000
617.000000
617.000000
617.000000
mean
6.959296e+04
109.749899
0.000000
0.214984
14.173306
4.644951
318.750016
302.882658
9249.230146
24.033419
NaN
23.292776
9.824104
0.118893
510.027901
2.946914e+04
21.355049
4650.194465
1179.285689
5.577041
2955.303890
std
6.377857e+04
474.209101
0.000000
0.617343
7.384483
3.541089
223.680466
318.749388
6412.413167
24.821661
NaN
40.194017
5.690638
0.333846
1771.524145
7.480266e+04
13.895708
4660.345010
1158.693545
15.034675
3060.022036
min
2.000000e+03
0.000000
0.000000
0.000000
0.000000
0.000000
15.910000
0.000000
500.000000
0.000000
NaN
0.000000
1.000000
0.000000
0.000000
0.000000e+00
1.000000
0.000000
0.000000
0.000000
0.000000
25%
3.600000e+04
0.000000
0.000000
0.000000
8.720000
3.000000
163.490000
118.730000
4800.000000
0.000000
NaN
0.000000
6.000000
0.000000
0.000000
2.486000e+03
10.000000
1501.190000
370.740000
0.000000
836.190000
50%
5.200000e+04
1.170000
0.000000
0.000000
14.700000
4.000000
256.790000
215.000000
7500.000000
17.000000
NaN
0.000000
9.000000
0.000000
73.810000
7.331000e+03
19.000000
3147.360000
836.070000
0.000000
1997.210000
75%
7.800000e+04
4.580000
0.000000
0.000000
19.730000
6.000000
412.350000
388.270000
12000.000000
43.000000
NaN
46.500000
13.000000
0.000000
292.960000
2.109300e+04
29.000000
6321.720000
1563.100000
0.000000
4067.370000
max
7.000000e+05
5192.990000
0.000000
6.000000
29.960000
33.000000
926.830000
4500.510000
25000.000000
80.000000
NaN
117.000000
47.000000
2.000000
27750.000000
1.207359e+06
63.000000
39473.920000
6900.580000
143.093045
19401.130000
Does not meet the credit policy. Status:Fully Paid
count
1.717000e+03
1717.000000
1717.000000
1692.000000
1717.000000
1692.000000
1717.000000
1717.000000
1717.000000
962.000000
0.000000
531.000000
1692.000000
1692.000000
1717.000000
1.717000e+03
1692.000000
1717.000000
1717.000000
1717.000000
1717.000000
mean
7.159994e+04
0.000000
0.000000
0.244090
13.986913
3.963948
294.105381
1991.360239
8587.099592
26.454262
NaN
19.822976
10.008865
0.089835
0.000000
2.845734e+04
22.229314
10268.593261
1678.519825
2.974816
8587.098626
std
7.424415e+04
0.000000
0.000000
0.799242
7.526867
3.066656
209.706436
3551.871313
6032.265276
24.012971
NaN
37.142189
5.664317
0.337263
0.000000
6.028200e+04
14.152064
7306.445628
1458.220730
12.234702
6032.264626
min
0.000000e+00
0.000000
0.000000
0.000000
0.000000
0.000000
15.670000
0.000000
500.000000
0.000000
NaN
0.000000
1.000000
0.000000
0.000000
0.000000e+00
1.000000
503.540000
3.540000
0.000000
500.000000
25%
3.650000e+04
0.000000
0.000000
0.000000
7.880000
2.000000
136.460000
160.430000
4000.000000
1.000000
NaN
0.000000
6.000000
0.000000
0.000000
2.470000e+03
11.000000
4857.590000
627.450000
0.000000
4000.000000
50%
5.500000e+04
0.000000
0.000000
0.000000
14.310000
4.000000
238.530000
420.050000
7000.000000
22.000000
NaN
0.000000
9.000000
0.000000
0.000000
8.086000e+03
20.000000
8229.690000
1228.600000
0.000000
7000.000000
75%
8.400000e+04
0.000000
0.000000
0.000000
20.000000
5.000000
399.780000
2146.650000
12000.000000
44.000000
NaN
7.500000
13.000000
0.000000
0.000000
2.247000e+04
31.000000
13947.140000
2212.140000
0.000000
12000.000000
max
1.440000e+06
0.000000
0.000000
13.000000
29.950000
31.000000
940.140000
25207.530000
25000.000000
83.000000
NaN
118.000000
38.000000
5.000000
0.000000
9.520130e+05
73.000000
33845.240000
8845.250000
208.819530
25000.010000
Fully Paid
count
1.668900e+05
166890.000000
166890.000000
166890.000000
166890.000000
166890.000000
166890.000000
166890.000000
166890.000000
73734.000000
31294.000000
21384.000000
166890.000000
166890.000000
166890.000000
1.668900e+05
166890.000000
166890.000000
166890.000000
166890.000000
166890.000000
mean
7.202174e+04
0.000000
0.006208
0.243256
15.930496
0.805908
395.264270
6049.661770
11824.835371
35.523015
43.675944
74.522353
10.745503
0.146264
0.000000
1.435865e+04
24.616963
13334.193880
1524.542976
0.347689
11809.303221
std
6.023799e+04
0.000000
0.086875
0.737969
7.697108
1.035872
248.521937
6053.308882
7343.973399
21.705506
21.570651
29.889767
4.829532
0.439646
0.000000
1.837212e+04
11.694342
8382.611237
1439.705312
3.654011
7344.010192
min
3.000000e+03
0.000000
0.000000
0.000000
0.000000
0.000000
15.690000
0.000000
500.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000e+00
2.000000
0.000000
0.000000
0.000000
0.000000
25%
4.400000e+04
0.000000
0.000000
0.000000
10.180000
0.000000
211.125000
989.182500
6250.000000
17.000000
27.000000
54.000000
7.000000
0.000000
0.000000
5.457000e+03
16.000000
7137.025000
555.110000
0.000000
6250.000000
50%
6.099600e+04
0.000000
0.000000
0.000000
15.510000
0.000000
337.190000
4586.035000
10000.000000
33.000000
43.000000
76.000000
10.000000
0.000000
0.000000
1.015700e+04
23.000000
11411.575000
1125.435000
0.000000
10000.000000
75%
8.600000e+04
0.000000
0.000000
0.000000
21.300000
1.000000
513.800000
8801.900000
15000.000000
51.000000
60.000000
101.000000
13.000000
0.000000
0.000000
1.780800e+04
31.000000
17415.120000
2038.570000
0.000000
15000.000000
max
7.141778e+06
0.000000
6.000000
29.000000
39.990000
8.000000
1409.990000
36188.840000
35000.000000
151.000000
159.000000
121.000000
58.000000
15.000000
0.000000
1.743266e+06
150.000000
49978.687781
14978.690000
286.747566
35000.020000
In Grace Period
count
3.974000e+03
3974.000000
3974.000000
3974.000000
3974.000000
3974.000000
3974.000000
3974.000000
3974.000000
2202.000000
1251.000000
697.000000
3974.000000
3974.000000
3974.000000
3.974000e+03
3974.000000
3974.000000
3974.000000
3974.000000
3974.000000
mean
7.486149e+04
0.000000
0.018369
0.458228
18.942589
0.787116
450.440458
495.445591
13233.618520
31.156222
44.007994
66.875179
11.509814
0.234776
0.000000
1.454559e+04
24.531454
6190.133998
1592.669799
2.579261
4594.884935
std
1.543129e+05
0.000000
0.137997
1.059822
8.447717
1.029627
276.693788
762.069207
8079.892180
21.348371
22.036296
26.627435
5.445590
0.620960
0.000000
1.796554e+04
12.219875
6104.177842
1529.100905
11.180137
4742.021294
min
7.680000e+03
0.000000
0.000000
0.000000
0.000000
0.000000
31.650000
0.000000
1000.000000
0.000000
1.000000
5.000000
2.000000
0.000000
0.000000
0.000000e+00
2.000000
0.000000
0.000000
0.000000
0.000000
25%
4.200000e+04
0.000000
0.000000
0.000000
12.692500
0.000000
251.522500
242.630000
7300.000000
13.000000
26.000000
50.000000
8.000000
0.000000
0.000000
5.418250e+03
15.000000
1842.857500
512.240000
0.000000
1276.705000
50%
6.000000e+04
0.000000
0.000000
0.000000
18.665000
0.000000
373.145000
375.460000
11000.000000
27.000000
44.000000
68.000000
10.000000
0.000000
0.000000
1.013600e+04
23.000000
4312.320000
1165.420000
0.000000
3075.900000
75%
8.524125e+04
0.000000
0.000000
1.000000
24.907500
1.000000
590.620000
599.995000
17600.000000
46.000000
61.000000
85.000000
14.000000
0.000000
0.000000
1.762775e+04
32.000000
8680.272500
2201.632500
0.000000
6413.185000
max
8.900060e+06
0.000000
2.000000
13.000000
39.890000
6.000000
1374.630000
20944.280000
35000.000000
83.000000
137.000000
119.000000
46.000000
7.000000
0.000000
2.998990e+05
112.000000
44062.890000
12350.760000
191.840000
34761.450000
Issued
count
5.956000e+03
5956.000000
5956.000000
5956.000000
5956.000000
5956.000000
5956.000000
5956.000000
5956.000000
3153.000000
1850.000000
1169.000000
5956.000000
5956.000000
5956.000000
5.956000e+03
5956.000000
5956.000000
5956.000000
5956.000000
5956.000000
mean
7.675392e+04
0.000000
0.026024
0.372230
18.713529
0.636165
423.752236
10.154181
12926.196273
33.576594
45.285405
64.561163
11.876427
0.259570
0.000000
1.647000e+04
25.176629
8.256095
0.000000
0.000000
8.256095
std
7.346490e+04
0.000000
0.172387
0.991464
8.640415
0.912325
275.205289
295.210915
8334.148122
21.744768
22.555566
24.183019
5.792828
0.640988
0.000000
2.387890e+04
12.347462
280.222175
0.000000
0.000000
280.222175
min
8.200000e+03
0.000000
0.000000
0.000000
0.000000
0.000000
30.650000
0.000000
1000.000000
0.000000
0.000000
1.000000
1.000000
0.000000
0.000000
0.000000e+00
4.000000
0.000000
0.000000
0.000000
0.000000
25%
4.500000e+04
0.000000
0.000000
0.000000
12.217500
0.000000
214.520000
0.000000
6400.000000
15.000000
27.000000
50.000000
8.000000
0.000000
0.000000
5.527750e+03
16.000000
0.000000
0.000000
0.000000
0.000000
50%
6.500000e+04
0.000000
0.000000
0.000000
18.110000
0.000000
340.155000
0.000000
10000.000000
30.000000
44.000000
66.000000
11.000000
0.000000
0.000000
1.053800e+04
23.000000
0.000000
0.000000
0.000000
0.000000
75%
9.141900e+04
0.000000
0.000000
0.000000
24.980000
1.000000
576.537500
0.000000
18000.000000
48.000000
63.750000
81.000000
15.000000
0.000000
0.000000
1.930050e+04
32.000000
0.000000
0.000000
0.000000
0.000000
max
3.964280e+06
0.000000
3.000000
15.000000
39.970000
5.000000
1282.790000
20000.000000
35000.000000
116.000000
141.000000
118.000000
55.000000
10.000000
0.000000
5.664200e+05
89.000000
20000.000000
0.000000
0.000000
20000.000000
Late (16-30 days)
count
1.483000e+03
1483.000000
1483.000000
1483.000000
1483.000000
1483.000000
1483.000000
1483.000000
1483.000000
846.000000
485.000000
277.000000
1483.000000
1483.000000
1483.000000
1.483000e+03
1483.000000
1483.000000
1483.000000
1483.000000
1483.000000
mean
6.939211e+04
0.000000
0.016858
0.494943
18.913136
0.832097
440.431079
498.185293
12823.229939
30.614657
43.453608
71.101083
11.305462
0.233311
0.000000
1.418807e+04
24.120701
6126.682259
1628.157687
2.855037
4495.669528
std
4.639190e+04
0.000000
0.169501
1.163639
8.589023
1.083925
289.116056
686.527872
8266.335338
21.088609
21.968714
26.570195
5.327761
0.559107
0.000000
1.814531e+04
12.060167
6225.951429
1627.265008
10.101043
4746.187546
min
1.000000e+04
0.000000
0.000000
0.000000
0.270000
0.000000
33.690000
0.000000
1000.000000
0.000000
1.000000
2.000000
2.000000
0.000000
0.000000
0.000000e+00
4.000000
0.000000
0.000000
0.000000
0.000000
25%
4.088860e+04
0.000000
0.000000
0.000000
12.595000
0.000000
218.890000
216.660000
6400.000000
14.000000
25.000000
53.000000
7.000000
0.000000
0.000000
5.254000e+03
15.000000
1969.780000
540.100000
0.000000
1349.385000
50%
6.000000e+04
0.000000
0.000000
0.000000
18.650000
0.000000
357.670000
369.200000
10000.000000
26.000000
42.000000
71.000000
10.000000
0.000000
0.000000
9.622000e+03
22.000000
4079.660000
1156.370000
0.000000
2887.410000
75%
8.500000e+04
0.000000
0.000000
1.000000
25.130000
1.000000
577.020000
610.880000
16900.000000
44.000000
62.000000
92.000000
14.000000
0.000000
0.000000
1.725500e+04
31.000000
8202.555000
2151.490000
0.000000
5919.525000
max
6.000000e+05
0.000000
4.000000
15.000000
39.940000
6.000000
1391.410000
15000.000000
35000.000000
82.000000
142.000000
119.000000
44.000000
6.000000
0.000000
3.055320e+05
78.000000
42366.830000
12181.280000
131.490000
31267.640000
Late (31-120 days)
count
7.026000e+03
7026.000000
7026.000000
7026.000000
7026.000000
7026.000000
7026.000000
7026.000000
7026.000000
3727.000000
2113.000000
1333.000000
7026.000000
7026.000000
7026.000000
7.026000e+03
7026.000000
7026.000000
7026.000000
7026.000000
7026.000000
mean
6.552567e+04
0.000000
0.020211
0.414888
19.359224
0.853117
433.942565
457.625944
12621.555650
32.232895
43.103171
72.470368
11.386280
0.242101
0.000000
1.354102e+04
24.034870
5807.477625
1596.475399
3.835197
4207.167030
std
4.437685e+04
0.000000
0.151449
1.055310
8.564884
1.080030
272.037085
512.394537
7830.235623
22.031585
22.700928
28.097670
5.346388
0.605219
0.000000
1.750044e+04
12.006276
5567.169520
1470.963509
12.619548
4233.064817
min
4.524000e+03
0.000000
0.000000
0.000000
0.000000
0.000000
31.520000
0.000000
1000.000000
0.000000
0.000000
1.000000
0.000000
0.000000
0.000000
0.000000e+00
2.000000
0.000000
0.000000
0.000000
0.000000
25%
4.000000e+04
0.000000
0.000000
0.000000
12.800000
0.000000
242.465000
235.362500
7000.000000
13.000000
25.000000
53.000000
8.000000
0.000000
0.000000
5.357250e+03
15.000000
2033.297500
603.915000
0.000000
1387.975000
50%
5.500000e+04
0.000000
0.000000
0.000000
19.120000
1.000000
352.900000
353.775000
10000.000000
28.000000
43.000000
72.000000
10.000000
0.000000
0.000000
9.486500e+03
22.000000
4175.355000
1200.795000
0.000000
2897.835000
75%
8.000000e+04
0.000000
0.000000
0.000000
25.720000
1.000000
554.510000
566.817500
16000.000000
48.000000
61.000000
97.000000
14.000000
0.000000
0.000000
1.663650e+04
30.000000
7845.232500
2109.320000
0.000000
5637.710000
max
8.000000e+05
0.000000
3.000000
21.000000
39.990000
6.000000
1408.130000
19405.900000
35000.000000
92.000000
146.000000
119.000000
76.000000
11.000000
0.000000
6.541340e+05
98.000000
43715.090000
12489.960000
268.550000
34264.360000
In [11]:
feat_raw=feat_raw[~feat_raw['loan_status'].isin(['Current',
'Issued',
'Does not meet the credit policy. Status:Charged Off',
'Does not meet the credit policy. Status:Fully Paid'])]
grp = feat_raw.groupby('loan_status')
grp.describe()
Out[11]:
annual_inc
collection_recovery_fee
collections_12_mths_ex_med
delinq_2yrs
dti
inq_last_6mths
installment
last_pymnt_amnt
loan_amnt
mths_since_last_delinq
mths_since_last_major_derog
mths_since_last_record
open_acc
pub_rec
recoveries
revol_bal
total_acc
total_pymnt
total_rec_int
total_rec_late_fee
total_rec_prncp
loan_status
Charged Off
count
2.899900e+04
28999.000000
28999.000000
28999.000000
28999.000000
28999.000000
28999.000000
28999.000000
28999.000000
13009.000000
5787.000000
3787.000000
28999.000000
28999.000000
28999.000000
2.899900e+04
28999.000000
28999.000000
28999.000000
28999.000000
28999.000000
mean
6.115969e+04
69.970545
0.007828
0.280423
18.104272
0.969792
403.473397
414.051346
11692.973896
34.237682
42.807327
76.785582
10.741784
0.153005
641.675609
1.347438e+04
23.084831
5584.689552
1408.531769
2.512973
3531.969198
std
6.455718e+04
225.409847
0.092334
0.802859
7.997711
1.117541
257.209008
515.120271
7347.473781
21.968352
21.744058
30.621205
4.847813
0.467737
1218.739994
1.755516e+04
11.351386
4970.646087
1326.085256
10.213291
3487.942848
min
4.080000e+03
0.000000
0.000000
0.000000
0.000000
0.000000
29.160000
0.000000
900.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000e+00
2.000000
0.000000
0.000000
0.000000
0.000000
25%
3.700000e+04
0.000000
0.000000
0.000000
12.160000
0.000000
218.130000
201.270000
6250.000000
15.000000
25.000000
56.000000
7.000000
0.000000
0.000000
5.580500e+03
15.000000
2113.830000
516.760000
0.000000
1130.910000
50%
5.130000e+04
0.700000
0.000000
0.000000
18.010000
1.000000
341.670000
334.730000
10000.000000
31.000000
42.000000
84.000000
10.000000
0.000000
26.330000
9.973000e+03
21.000000
4184.390000
1038.920000
0.000000
2477.890000
75%
7.300000e+04
17.289700
0.000000
0.000000
23.890000
2.000000
522.260000
518.340000
15000.000000
50.000000
60.000000
102.000000
13.000000
0.000000
896.930000
1.689300e+04
30.000000
7486.415000
1870.905000
0.000000
4762.535000
max
8.706582e+06
7002.190000
2.000000
18.000000
39.910000
8.000000
1424.570000
34833.350000
35000.000000
152.000000
152.000000
129.000000
45.000000
12.000000
31900.520000
1.746716e+06
110.000000
43935.130000
16602.700000
294.680000
34483.270000
Default
count
7.150000e+02
715.000000
715.000000
715.000000
715.000000
715.000000
715.000000
715.000000
715.000000
345.000000
202.000000
131.000000
715.000000
715.000000
715.000000
7.150000e+02
715.000000
715.000000
715.000000
715.000000
715.000000
mean
6.228154e+04
0.000000
0.019580
0.401399
19.504517
0.871329
414.011301
430.149650
12019.860140
33.072464
43.613861
73.175573
11.496503
0.223776
0.000000
1.383329e+04
24.254545
5503.680307
1533.111301
1.772264
3968.796755
std
5.963224e+04
0.000000
0.138650
1.099910
8.298499
1.114057
255.480159
357.752037
7362.857281
21.618198
23.100675
24.960116
5.064118
0.545154
0.000000
2.060174e+04
12.225569
5433.390650
1449.510053
7.877050
4081.943163
min
9.300000e+03
0.000000
0.000000
0.000000
0.380000
0.000000
33.210000
0.000000
1000.000000
1.000000
1.000000
6.000000
1.000000
0.000000
0.000000
0.000000e+00
4.000000
0.000000
0.000000
0.000000
0.000000
25%
3.625000e+04
0.000000
0.000000
0.000000
13.440000
0.000000
221.535000
230.560000
6400.000000
14.000000
25.000000
56.000000
8.000000
0.000000
0.000000
5.237000e+03
15.000000
1959.820000
569.105000
0.000000
1363.630000
50%
5.100000e+04
0.000000
0.000000
0.000000
19.380000
1.000000
352.680000
356.480000
10000.000000
29.000000
45.000000
74.000000
11.000000
0.000000
0.000000
9.951000e+03
22.000000
3828.910000
1084.200000
0.000000
2701.970000
75%
7.431300e+04
0.000000
0.000000
0.000000
25.470000
1.000000
528.100000
537.050000
15000.000000
50.000000
60.000000
90.500000
14.000000
0.000000
0.000000
1.681600e+04
32.000000
7217.480000
2008.335000
0.000000
5174.080000
max
1.300000e+06
0.000000
1.000000
11.000000
39.720000
6.000000
1300.200000
6960.700000
35000.000000
81.000000
136.000000
119.000000
33.000000
5.000000
0.000000
4.037950e+05
82.000000
36811.500000
10535.570000
75.880000
27965.700000
Fully Paid
count
1.668900e+05
166890.000000
166890.000000
166890.000000
166890.000000
166890.000000
166890.000000
166890.000000
166890.000000
73734.000000
31294.000000
21384.000000
166890.000000
166890.000000
166890.000000
1.668900e+05
166890.000000
166890.000000
166890.000000
166890.000000
166890.000000
mean
7.202174e+04
0.000000
0.006208
0.243256
15.930496
0.805908
395.264270
6049.661770
11824.835371
35.523015
43.675944
74.522353
10.745503
0.146264
0.000000
1.435865e+04
24.616963
13334.193880
1524.542976
0.347689
11809.303221
std
6.023799e+04
0.000000
0.086875
0.737969
7.697108
1.035872
248.521937
6053.308882
7343.973399
21.705506
21.570651
29.889767
4.829532
0.439646
0.000000
1.837212e+04
11.694342
8382.611237
1439.705312
3.654011
7344.010192
min
3.000000e+03
0.000000
0.000000
0.000000
0.000000
0.000000
15.690000
0.000000
500.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000e+00
2.000000
0.000000
0.000000
0.000000
0.000000
25%
4.400000e+04
0.000000
0.000000
0.000000
10.180000
0.000000
211.125000
989.182500
6250.000000
17.000000
27.000000
54.000000
7.000000
0.000000
0.000000
5.457000e+03
16.000000
7137.025000
555.110000
0.000000
6250.000000
50%
6.099600e+04
0.000000
0.000000
0.000000
15.510000
0.000000
337.190000
4586.035000
10000.000000
33.000000
43.000000
76.000000
10.000000
0.000000
0.000000
1.015700e+04
23.000000
11411.575000
1125.435000
0.000000
10000.000000
75%
8.600000e+04
0.000000
0.000000
0.000000
21.300000
1.000000
513.800000
8801.900000
15000.000000
51.000000
60.000000
101.000000
13.000000
0.000000
0.000000
1.780800e+04
31.000000
17415.120000
2038.570000
0.000000
15000.000000
max
7.141778e+06
0.000000
6.000000
29.000000
39.990000
8.000000
1409.990000
36188.840000
35000.000000
151.000000
159.000000
121.000000
58.000000
15.000000
0.000000
1.743266e+06
150.000000
49978.687781
14978.690000
286.747566
35000.020000
In Grace Period
count
3.974000e+03
3974.000000
3974.000000
3974.000000
3974.000000
3974.000000
3974.000000
3974.000000
3974.000000
2202.000000
1251.000000
697.000000
3974.000000
3974.000000
3974.000000
3.974000e+03
3974.000000
3974.000000
3974.000000
3974.000000
3974.000000
mean
7.486149e+04
0.000000
0.018369
0.458228
18.942589
0.787116
450.440458
495.445591
13233.618520
31.156222
44.007994
66.875179
11.509814
0.234776
0.000000
1.454559e+04
24.531454
6190.133998
1592.669799
2.579261
4594.884935
std
1.543129e+05
0.000000
0.137997
1.059822
8.447717
1.029627
276.693788
762.069207
8079.892180
21.348371
22.036296
26.627435
5.445590
0.620960
0.000000
1.796554e+04
12.219875
6104.177842
1529.100905
11.180137
4742.021294
min
7.680000e+03
0.000000
0.000000
0.000000
0.000000
0.000000
31.650000
0.000000
1000.000000
0.000000
1.000000
5.000000
2.000000
0.000000
0.000000
0.000000e+00
2.000000
0.000000
0.000000
0.000000
0.000000
25%
4.200000e+04
0.000000
0.000000
0.000000
12.692500
0.000000
251.522500
242.630000
7300.000000
13.000000
26.000000
50.000000
8.000000
0.000000
0.000000
5.418250e+03
15.000000
1842.857500
512.240000
0.000000
1276.705000
50%
6.000000e+04
0.000000
0.000000
0.000000
18.665000
0.000000
373.145000
375.460000
11000.000000
27.000000
44.000000
68.000000
10.000000
0.000000
0.000000
1.013600e+04
23.000000
4312.320000
1165.420000
0.000000
3075.900000
75%
8.524125e+04
0.000000
0.000000
1.000000
24.907500
1.000000
590.620000
599.995000
17600.000000
46.000000
61.000000
85.000000
14.000000
0.000000
0.000000
1.762775e+04
32.000000
8680.272500
2201.632500
0.000000
6413.185000
max
8.900060e+06
0.000000
2.000000
13.000000
39.890000
6.000000
1374.630000
20944.280000
35000.000000
83.000000
137.000000
119.000000
46.000000
7.000000
0.000000
2.998990e+05
112.000000
44062.890000
12350.760000
191.840000
34761.450000
Late (16-30 days)
count
1.483000e+03
1483.000000
1483.000000
1483.000000
1483.000000
1483.000000
1483.000000
1483.000000
1483.000000
846.000000
485.000000
277.000000
1483.000000
1483.000000
1483.000000
1.483000e+03
1483.000000
1483.000000
1483.000000
1483.000000
1483.000000
mean
6.939211e+04
0.000000
0.016858
0.494943
18.913136
0.832097
440.431079
498.185293
12823.229939
30.614657
43.453608
71.101083
11.305462
0.233311
0.000000
1.418807e+04
24.120701
6126.682259
1628.157687
2.855037
4495.669528
std
4.639190e+04
0.000000
0.169501
1.163639
8.589023
1.083925
289.116056
686.527872
8266.335338
21.088609
21.968714
26.570195
5.327761
0.559107
0.000000
1.814531e+04
12.060167
6225.951429
1627.265008
10.101043
4746.187546
min
1.000000e+04
0.000000
0.000000
0.000000
0.270000
0.000000
33.690000
0.000000
1000.000000
0.000000
1.000000
2.000000
2.000000
0.000000
0.000000
0.000000e+00
4.000000
0.000000
0.000000
0.000000
0.000000
25%
4.088860e+04
0.000000
0.000000
0.000000
12.595000
0.000000
218.890000
216.660000
6400.000000
14.000000
25.000000
53.000000
7.000000
0.000000
0.000000
5.254000e+03
15.000000
1969.780000
540.100000
0.000000
1349.385000
50%
6.000000e+04
0.000000
0.000000
0.000000
18.650000
0.000000
357.670000
369.200000
10000.000000
26.000000
42.000000
71.000000
10.000000
0.000000
0.000000
9.622000e+03
22.000000
4079.660000
1156.370000
0.000000
2887.410000
75%
8.500000e+04
0.000000
0.000000
1.000000
25.130000
1.000000
577.020000
610.880000
16900.000000
44.000000
62.000000
92.000000
14.000000
0.000000
0.000000
1.725500e+04
31.000000
8202.555000
2151.490000
0.000000
5919.525000
max
6.000000e+05
0.000000
4.000000
15.000000
39.940000
6.000000
1391.410000
15000.000000
35000.000000
82.000000
142.000000
119.000000
44.000000
6.000000
0.000000
3.055320e+05
78.000000
42366.830000
12181.280000
131.490000
31267.640000
Late (31-120 days)
count
7.026000e+03
7026.000000
7026.000000
7026.000000
7026.000000
7026.000000
7026.000000
7026.000000
7026.000000
3727.000000
2113.000000
1333.000000
7026.000000
7026.000000
7026.000000
7.026000e+03
7026.000000
7026.000000
7026.000000
7026.000000
7026.000000
mean
6.552567e+04
0.000000
0.020211
0.414888
19.359224
0.853117
433.942565
457.625944
12621.555650
32.232895
43.103171
72.470368
11.386280
0.242101
0.000000
1.354102e+04
24.034870
5807.477625
1596.475399
3.835197
4207.167030
std
4.437685e+04
0.000000
0.151449
1.055310
8.564884
1.080030
272.037085
512.394537
7830.235623
22.031585
22.700928
28.097670
5.346388
0.605219
0.000000
1.750044e+04
12.006276
5567.169520
1470.963509
12.619548
4233.064817
min
4.524000e+03
0.000000
0.000000
0.000000
0.000000
0.000000
31.520000
0.000000
1000.000000
0.000000
0.000000
1.000000
0.000000
0.000000
0.000000
0.000000e+00
2.000000
0.000000
0.000000
0.000000
0.000000
25%
4.000000e+04
0.000000
0.000000
0.000000
12.800000
0.000000
242.465000
235.362500
7000.000000
13.000000
25.000000
53.000000
8.000000
0.000000
0.000000
5.357250e+03
15.000000
2033.297500
603.915000
0.000000
1387.975000
50%
5.500000e+04
0.000000
0.000000
0.000000
19.120000
1.000000
352.900000
353.775000
10000.000000
28.000000
43.000000
72.000000
10.000000
0.000000
0.000000
9.486500e+03
22.000000
4175.355000
1200.795000
0.000000
2897.835000
75%
8.000000e+04
0.000000
0.000000
0.000000
25.720000
1.000000
554.510000
566.817500
16000.000000
48.000000
61.000000
97.000000
14.000000
0.000000
0.000000
1.663650e+04
30.000000
7845.232500
2109.320000
0.000000
5637.710000
max
8.000000e+05
0.000000
3.000000
21.000000
39.990000
6.000000
1408.130000
19405.900000
35000.000000
92.000000
146.000000
119.000000
76.000000
11.000000
0.000000
6.541340e+05
98.000000
43715.090000
12489.960000
268.550000
34264.360000
In [12]:
feat_raw.term=data.term.str.replace(' months','')
feat_raw.term=feat_raw.term.apply(pd.to_numeric)
feat_raw.int_rate=data.int_rate.str.replace('%','')
feat_raw.int_rate=feat_raw.int_rate.apply(pd.to_numeric)
feat_raw.revol_util=data.revol_util.str.replace('%','')
feat_raw.revol_util.isnull().sum()
Out[12]:
173
In [13]:
feat_raw.revol_util.fillna(0,inplace=True)
feat_raw.revol_util=feat_raw.revol_util.apply(pd.to_numeric)
feat_raw.revol_util.isnull().sum()
Out[13]:
0
In [14]:
feat_raw.revol_util.dtype
Out[14]:
dtype('float64')
In [15]:
feat_raw['last_pymnt_d']=pd.to_datetime(data.last_pymnt_d, format='%b-%Y')
feat_raw['issue_d']=pd.to_datetime(data.issue_d, format='%b-%Y')
feat_raw['earliest_cr_line']=pd.to_datetime(data.earliest_cr_line, format='%b-%Y')
In [16]:
feat_raw['num_pymnts']=round((feat_raw.last_pymnt_d-feat_raw.issue_d)/ np.timedelta64(1, 'M'))
In [17]:
feat_raw['pymnts_left']=(feat_raw.term-feat_raw.num_pymnts).fillna(0)
In [18]:
feat_raw['current']=feat_raw.loan_status.str.match('Current')
In [19]:
feat_raw.emp_length
Out[19]:
0 10+ years
1 10+ years
2 10+ years
3 3 years
4 9 years
5 10+ years
6 < 1 year
7 3 years
8 3 years
9 < 1 year
10 4 years
11 10+ years
12 1 year
13 6 years
14 10+ years
15 10+ years
16 5 years
17 1 year
18 2 years
19 9 years
20 10+ years
21 < 1 year
22 7 years
23 5 years
24 2 years
25 7 years
26 10+ years
27 2 years
28 1 year
29 1 year
30 4 years
31 10+ years
32 9 years
33 10+ years
34 10+ years
35 6 years
36 10+ years
37 6 years
38 10+ years
39 5 years
...
619841 8 years
619843 5 years
619844 1 year
619845 4 years
619846 8 years
619858 8 years
619865 1 year
619866 10+ years
619871 10+ years
619875 < 1 year
619878 n/a
619884 3 years
619885 8 years
619889 1 year
619890 10+ years
619891 10+ years
619894 4 years
619898 10+ years
619902 1 year
619910 6 years
619920 2 years
619932 4 years
619936 5 years
619940 5 years
619943 10+ years
619946 10+ years
619950 10+ years
619952 5 years
619953 3 years
619968 9 years
619971 n/a
619983 5 years
619985 6 years
619992 3 years
619993 4 years
619996 10+ years
620003 < 1 year
620005 2 years
620007 10+ years
620009 n/a
Name: emp_length, dtype: object
In [20]:
feat_raw.emp_length=data.emp_length.str.replace(' year','')
feat_raw.emp_length=feat_raw.emp_length.str.replace('s','')
feat_raw.emp_length=feat_raw.emp_length.str.replace('+','')
feat_raw.emp_length=feat_raw.emp_length.str.replace('< 1','0.5')
feat_raw.emp_length=feat_raw.emp_length.str.replace('n/a','0')
feat_raw.emp_length=feat_raw.emp_length.apply(pd.to_numeric)
feat_raw.emp_length.dtype
Out[20]:
dtype('float64')
We want to maximize the total money gained vs the loan amount. This is called a "buy rate" multiplier. For example, If a borrower receives \$12,000 and pays back \$15,000, the buy rate is 1.25, and can effectvely be thought of as 1+ interest. Although LC loans are amortized, a buy rate is a post hoc measure that penalizes loans paid early. Importantly, we do not want to penalize loans still current and in the process of payment, so the metric will have a logical gate to apply a different divisor to current loans.
For fully paid, late, and charged off loans, the equation takes the total amount paid to date, and divides it by the initial investment amount.
Equation 1: "settled" loan buy rate $$[buy\ rate]=\frac{[total\ payments\ received]}{[loan\ amount]}$$
Where the total payments received sums principle, interest, and late fee paid. A loan paid off with zero interest accrued or paid will have a value of 1.0, charged off loans will have values less than 1, and all other paid off loans will have a multiplier equivalent to 1+effective interest rate.
Notably, this unfairly penalizes loans that were categorized as "late" during the time the data was acquired, but I'm okay with that as late loans are intuitively riskier than current loans that have been brought up to current. This is a potential assumption to probe at some point, however I think the overwhelming number of current, fully paid, and charged off loans will make this unimportant. It is worth noting that loans that were ever late are harder to sell on the secondary loan market, so even if they were brought to current, late loans have less potential liquidity.
For current loans, I approximate the expected principle return as the investment amount divided over the length of the loan, and prorated for the number of months the loan has been active
Equation 2: "current" loan buy rate $$[buy\ rate]=\frac{[payments\ received\ to\ date]}{(\frac{[loan\ amount]}{[loan\ term]}*[months\ active])}$$
Amortization is not linear (more interest is paid up front), but amortization only matters if loans are paid off early, and the fully paid loans are handled with the simpler equation above. This simple metric is blind to loans that will be paid off early, or that will default (both will lower effective "buy rate") in the future, and assumes all current loans will be paid off according to schedule.
Effectively, current and fully paid (on schedule) loans will have buy rates tied directly to their interest rate. Loans paid off early will be penalized slightly from their given interest rate. Defaulted and late loans will be penalized according to how much of the principle was paid, with a 0 being a total loss, and values below 1.0 being partial losses. Interestingly, loans that accrue late fees but eventually are paid in full on schedule will be rewarded slightly. I'm not confident that this happens often enough (in comparision to late fee paying loans that eventually default) to incentivize risky loans appreciably more than the interest rate does on it's own.
Importantly, as LC sets interest rates according to the same borrower data that I can use (and potentially they actually have more), this is an exercise in finding slippage in the general loan market algorithm, heavily incentivized towards finding borrowers who appear (to loaners) riskier than the data says they are.
In [21]:
feat_raw['balance1']=(feat_raw.total_pymnt)/((feat_raw.loan_amnt/feat_raw.term)*(feat_raw.current*(feat_raw.term-feat_raw.pymnts_left)+(1-feat_raw.current)*feat_raw.term))
In [22]:
feat_raw['balance2']=(feat_raw.total_pymnt)/(feat_raw.loan_amnt)
In [23]:
feat_raw['class_label']=feat_raw.loan_status.replace(('Fully Paid','Charged Off','Default','In Grace Period','Late (16-30 days)','Late (31-120 days)'), (1,0,0,0,0,0))
feat_raw[['class_label','loan_status']]
Out[23]:
class_label
loan_status
0
1
Fully Paid
1
1
Fully Paid
2
1
Fully Paid
3
1
Fully Paid
4
1
Fully Paid
5
1
Fully Paid
6
0
Charged Off
7
1
Fully Paid
8
0
Charged Off
9
1
Fully Paid
10
1
Fully Paid
11
1
Fully Paid
12
1
Fully Paid
13
1
Fully Paid
14
0
Charged Off
15
1
Fully Paid
16
1
Fully Paid
17
0
Charged Off
18
1
Fully Paid
19
0
Charged Off
20
1
Fully Paid
21
1
Fully Paid
22
1
Fully Paid
23
1
Fully Paid
24
1
Fully Paid
25
1
Fully Paid
26
1
Fully Paid
27
1
Fully Paid
28
1
Fully Paid
29
1
Fully Paid
30
1
Fully Paid
31
1
Fully Paid
32
1
Fully Paid
33
1
Fully Paid
34
1
Fully Paid
35
1
Fully Paid
36
0
Charged Off
37
1
Fully Paid
38
1
Fully Paid
39
1
Fully Paid
...
...
...
619841
1
Fully Paid
619843
1
Fully Paid
619844
0
Charged Off
619845
1
Fully Paid
619846
1
Fully Paid
619858
1
Fully Paid
619865
0
Default
619866
0
In Grace Period
619871
1
Fully Paid
619875
1
Fully Paid
619878
0
Late (31-120 days)
619884
0
In Grace Period
619885
1
Fully Paid
619889
0
Late (31-120 days)
619890
0
Late (31-120 days)
619891
1
Fully Paid
619894
1
Fully Paid
619898
1
Fully Paid
619902
1
Fully Paid
619910
1
Fully Paid
619920
0
Late (31-120 days)
619932
0
Late (31-120 days)
619936
0
Charged Off
619940
0
Late (16-30 days)
619943
1
Fully Paid
619946
0
Charged Off
619950
0
Late (31-120 days)
619952
1
Fully Paid
619953
0
Late (31-120 days)
619968
0
Charged Off
619971
0
Charged Off
619983
0
Charged Off
619985
1
Fully Paid
619992
0
Late (31-120 days)
619993
1
Fully Paid
619996
0
Charged Off
620003
1
Fully Paid
620005
1
Fully Paid
620007
1
Fully Paid
620009
0
Charged Off
209087 rows × 2 columns
In [24]:
feat_raw[['int_rate','loan_amnt','balance1','balance2','pymnts_left','loan_status','num_pymnts','total_rec_prncp','total_rec_int','total_rec_late_fee']]
Out[24]:
int_rate
loan_amnt
balance1
balance2
pymnts_left
loan_status
num_pymnts
total_rec_prncp
total_rec_int
total_rec_late_fee
0
10.65
5000.0
1.172214
1.172214
-1.0
Fully Paid
37.0
5000.00
861.07
0.00
1
15.96
2400.0
1.251522
1.251522
6.0
Fully Paid
30.0
2400.00
603.65
0.00
2
13.49
10000.0
1.222630
1.222630
-1.0
Fully Paid
37.0
10000.00
2209.33
16.97
3
7.90
5000.0
1.126276
1.126276
-1.0
Fully Paid
37.0
5000.00
631.38
0.00
4
18.64
3000.0
1.312715
1.312715
-1.0
Fully Paid
37.0
3000.00
938.14
0.00
5
12.69
12000.0
1.161923
1.161923
15.0
Fully Paid
21.0
12000.00
1943.08
0.00
6
13.49
9000.0
0.252300
0.252300
29.0
Charged Off
7.0
1256.14
570.26
0.00
7
9.91
3000.0
1.159661
1.159661
-1.0
Fully Paid
37.0
3000.00
478.98
0.00
8
10.65
10000.0
0.747199
0.747199
14.0
Charged Off
22.0
5433.47
1393.42
0.00
9
16.29
1000.0
1.270171
1.270171
-1.0
Fully Paid
37.0
1000.00
270.17
0.00
10
15.27
10000.0
1.251926
1.251926
-1.0
Fully Paid
37.0
10000.00
2519.26
0.00
11
6.03
3600.0
1.051394
1.051394
19.0
Fully Paid
17.0
3600.00
185.02
0.00
12
11.71
6000.0
1.194083
1.194083
-2.0
Fully Paid
38.0
6000.00
1149.50
15.00
13
6.03
9200.0
1.028257
1.028257
29.0
Fully Paid
7.0
9200.00
259.96
0.00
14
12.42
21000.0
0.667876
0.667876
15.0
Charged Off
21.0
10694.96
3330.44
0.00
15
11.71
10000.0
1.190256
1.190256
-1.0
Fully Paid
37.0
10000.00
1902.56
0.00
16
11.71
10000.0
1.153631
1.153631
14.0
Fully Paid
22.0
10000.00
1536.31
0.00
17
11.71
6000.0
0.341690
0.341690
26.0
Charged Off
10.0
1305.58
475.25
0.00
18
9.91
15000.0
1.054899
1.054899
27.0
Fully Paid
9.0
15000.00
823.48
0.00
19
14.27
15000.0
0.000000
0.000000
0.0
Charged Off
NaN
0.00
0.00
0.00
20
11.71
4000.0
1.121198
1.121198
20.0
Fully Paid
16.0
4000.00
484.79
0.00
21
11.71
8500.0
1.190848
1.190848
0.0
Fully Paid
36.0
8500.00
1622.21
0.00
22
7.51
4375.0
1.119667
1.119667
-1.0
Fully Paid
37.0
4375.00
523.54
0.00
23
7.90
31825.0
1.096185
1.096185
16.0
Fully Paid
20.0
31825.00
3061.08
0.00
24
8.90
5000.0
1.142918
1.142918
-1.0
Fully Paid
37.0
5000.00
714.59
0.00
25
15.96
7000.0
1.264134
1.264134
-1.0
Fully Paid
37.0
7000.00
1848.94
0.00
26
10.65
12400.0
1.172376
1.172376
-1.0
Fully Paid
37.0
12400.00
2137.46
0.00
27
9.91
10800.0
1.125667
1.125667
13.0
Fully Paid
23.0
10800.00
1357.20
0.00
28
7.90
15000.0
1.110840
1.110840
11.0
Fully Paid
25.0
15000.00
1662.60
0.00
29
12.42
6000.0
1.187547
1.187547
8.0
Fully Paid
28.0
6000.00
1125.28
0.00
30
7.51
9600.0
1.119767
1.119767
-1.0
Fully Paid
37.0
9600.00
1149.76
0.00
31
7.90
12000.0
1.126365
1.126365
-1.0
Fully Paid
37.0
12000.00
1516.38
0.00
32
18.25
3000.0
1.305009
1.305009
-1.0
Fully Paid
37.0
3000.00
915.03
0.00
33
16.77
4400.0
1.278839
1.278839
-1.0
Fully Paid
37.0
4400.00
1226.89
0.00
34
6.03
6000.0
1.010977
1.010977
29.0
Fully Paid
7.0
6000.00
65.86
0.00
35
9.91
14000.0
1.159994
1.159994
-1.0
Fully Paid
37.0
14000.00
2239.91
0.00
36
8.90
5000.0
1.004274
1.004274
4.0
Charged Off
32.0
4217.38
696.99
0.00
37
10.65
10000.0
1.172457
1.172457
-1.0
Fully Paid
37.0
10000.00
1724.57
0.00
38
6.03
10000.0
1.028267
1.028267
29.0
Fully Paid
7.0
10000.00
282.67
0.00
39
6.62
11000.0
1.105216
1.105216
-1.0
Fully Paid
37.0
11000.00
1157.38
0.00
...
...
...
...
...
...
...
...
...
...
...
619841
8.67
30000.0
1.051029
1.051029
28.0
Fully Paid
8.0
30000.00
1530.87
0.00
619843
10.49
5000.0
1.055844
1.055844
29.0
Fully Paid
7.0
5000.00
279.22
0.00
619844
11.44
8400.0
0.229998
0.229998
29.0
Charged Off
7.0
1413.48
518.50
0.00
619845
13.66
6000.0
1.103255
1.103255
26.0
Fully Paid
10.0
6000.00
619.53
0.00
619846
11.99
1500.0
1.057553
1.057553
28.0
Fully Paid
8.0
1500.00
86.33
0.00
619858
8.19
2000.0
1.031935
1.031935
31.0
Fully Paid
5.0
2000.00
63.87
0.00
619865
8.67
35000.0
0.223685
0.223685
29.0
Default
7.0
6114.54
1714.44
0.00
619866
12.99
6000.0
0.369147
0.369147
24.0
In Grace Period
12.0
1593.48
621.40
0.00
619871
13.66
7000.0
1.044527
1.044527
32.0
Fully Paid
4.0
7000.00
311.69
0.00
619875
6.49
24000.0
1.029352
1.029352
31.0
Fully Paid
5.0
24000.00
704.45
0.00
619878
20.99
7125.0
0.299029
0.299029
28.0
Late (31-120 days)
8.0
1220.32
910.26
0.00
619884
12.39
8950.0
0.370209
0.370209
25.0
In Grace Period
11.0
2392.83
920.54
0.00
619885
23.99
26500.0
1.105963
1.105963
31.0
Fully Paid
5.0
26500.00
2808.02
0.00
619889
15.99
14075.0
0.314595
0.314595
27.0
Late (31-120 days)
9.0
2917.03
1510.89
0.00
619890
17.14
5000.0
0.319612
0.319612
27.0
Late (31-120 days)
9.0
1020.82
577.24
0.00
619891
14.99
20000.0
1.002498
1.002498
36.0
Fully Paid
0.0
20000.00
49.97
0.00
619894
14.31
20000.0
1.071025
1.071025
30.0
Fully Paid
6.0
20000.00
1420.51
0.00
619898
14.99
30000.0
1.082966
1.082966
25.0
Fully Paid
11.0
30000.00
2488.99
0.00
619902
11.99
12000.0
1.095670
1.095670
25.0
Fully Paid
11.0
12000.00
1148.04
0.00
619910
17.14
12825.0
1.054243
1.054243
32.0
Fully Paid
4.0
12825.00
695.67
0.00
619920
15.59
7675.0
0.312864
0.312864
26.0
Late (31-120 days)
10.0
1598.40
802.83
0.00
619932
12.39
12000.0
0.332640
0.332640
26.0
Late (31-120 days)
10.0
2901.47
1090.21
0.00
619936
14.99
7200.0
0.240962
0.240962
29.0
Charged Off
7.0
1160.10
574.83
0.00
619940
19.24
28500.0
0.402415
0.402415
25.0
Late (16-30 days)
11.0
7050.56
4418.27
0.00
619943
12.99
20000.0
1.094774
1.094774
27.0
Fully Paid
9.0
20000.00
1895.49
0.00
619946
14.99
20000.0
0.246791
0.246791
26.0
Charged Off
10.0
3222.40
1678.75
34.66
619950
20.99
25000.0
0.336698
0.336698
27.0
Late (31-120 days)
9.0
4871.09
3546.35
0.00
619952
16.49
5875.0
1.142157
1.142157
25.0
Fully Paid
11.0
5875.00
835.17
0.00
619953
15.59
5875.0
0.347833
0.347833
26.0
Late (31-120 days)
10.0
1356.95
686.57
0.00
619968
17.86
12000.0
0.250593
0.250593
29.0
Charged Off
7.0
1862.24
1144.88
0.00
619971
17.86
2725.0
0.216840
0.216840
30.0
Charged Off
6.0
359.21
231.68
0.00
619983
15.99
14000.0
0.244289
0.244289
29.0
Charged Off
7.0
2226.49
1193.55
0.00
619985
12.39
15000.0
1.078031
1.078031
28.0
Fully Paid
8.0
15000.00
1170.46
0.00
619992
15.59
28000.0
0.312863
0.312863
27.0
Late (31-120 days)
9.0
5831.27
2928.89
0.00
619993
10.49
6000.0
1.077563
1.077563
26.0
Fully Paid
10.0
6000.00
465.38
0.00
619996
15.99
4200.0
0.244290
0.244290
29.0
Charged Off
7.0
667.96
358.06
0.00
620003
6.03
10775.0
1.027552
1.027552
30.0
Fully Paid
6.0
10775.00
296.87
0.00
620005
16.49
6225.0
1.132604
1.132604
25.0
Fully Paid
11.0
6225.00
825.46
0.00
620007
8.67
4000.0
1.039505
1.039505
31.0
Fully Paid
5.0
4000.00
158.02
0.00
620009
19.24
10850.0
0.220834
0.220834
29.0
Charged Off
7.0
1405.77
990.28
0.00
209087 rows × 10 columns
In [25]:
%matplotlib inline
import matplotlib.pyplot as plt
plt.scatter(feat_raw.balance1,feat_raw.int_rate)
plt.show()
Interestingly, there are a lot of loans with really high mutliples. What is causing this? Ideally I expect values between 0 and 2 at the greatest. What is the metric missing?
In [26]:
feat_raw.query('balance1>5 & num_pymnts==0')
Out[26]:
id
loan_amnt
term
int_rate
installment
sub_grade
emp_title
emp_length
home_ownership
annual_inc
loan_status
purpose
addr_state
dti
delinq_2yrs
earliest_cr_line
inq_last_6mths
mths_since_last_delinq
mths_since_last_record
open_acc
pub_rec
revol_bal
revol_util
total_acc
total_pymnt
total_rec_prncp
total_rec_int
total_rec_late_fee
recoveries
collection_recovery_fee
last_pymnt_d
last_pymnt_amnt
next_pymnt_d
collections_12_mths_ex_med
mths_since_last_major_derog
issue_d
num_pymnts
pymnts_left
current
balance1
balance2
class_label
There are two things to note: firstly, there are current loans with no payments, creating a metric with a value of infinite. Not only do these loans break the metric, they also give almost no information to our algorithm, since they only thing we know is that they were funded and they sat for a year with "no payments" while still being current. This is fishy and could point to a bug in LC reporting.
Secondly, it looks like the highest values are directly due to a large upfront lumpsum payment as the only payment, and values between the highest and 2 are loans with a large lump sum and additional regular payments. The more payments since the lump sum, the closer to "convential" values. It is worth noting that only low interest rate loans seem to be paying large lump sums. This meshes with intuition - people that receive nice rates likely are more financially secure and can make large lump sum payments.
As most in this data have at least a year's worth of data, I will approach this with two things: first by removing 'current' loans with less than normal number of payments, and secondly, by attenuating large lump sums payments that do not fully pay the loan.
Explicitly, we want to exclude loans that show less than 11 payments, but are marked "current", NOT loans with less than normal payments that are late, defaulted, or charged off. A non-negligible number of loans default with no payments at all. This gets rid of loans that people pay large lump sums and then stop paying for a while. It does NOT get rid of loans with large lump sums and then all the regular payments.
In [27]:
feat_inform=feat_raw.query('(num_pymnts >11 & current==True) | current==False')
In [28]:
feat_inform[['balance1','balance2','pymnts_left','loan_status','total_rec_prncp','total_rec_int','total_rec_late_fee']]
Out[28]:
balance1
balance2
pymnts_left
loan_status
total_rec_prncp
total_rec_int
total_rec_late_fee
0
1.172214
1.172214
-1.0
Fully Paid
5000.00
861.07
0.00
1
1.251522
1.251522
6.0
Fully Paid
2400.00
603.65
0.00
2
1.222630
1.222630
-1.0
Fully Paid
10000.00
2209.33
16.97
3
1.126276
1.126276
-1.0
Fully Paid
5000.00
631.38
0.00
4
1.312715
1.312715
-1.0
Fully Paid
3000.00
938.14
0.00
5
1.161923
1.161923
15.0
Fully Paid
12000.00
1943.08
0.00
6
0.252300
0.252300
29.0
Charged Off
1256.14
570.26
0.00
7
1.159661
1.159661
-1.0
Fully Paid
3000.00
478.98
0.00
8
0.747199
0.747199
14.0
Charged Off
5433.47
1393.42
0.00
9
1.270171
1.270171
-1.0
Fully Paid
1000.00
270.17
0.00
10
1.251926
1.251926
-1.0
Fully Paid
10000.00
2519.26
0.00
11
1.051394
1.051394
19.0
Fully Paid
3600.00
185.02
0.00
12
1.194083
1.194083
-2.0
Fully Paid
6000.00
1149.50
15.00
13
1.028257
1.028257
29.0
Fully Paid
9200.00
259.96
0.00
14
0.667876
0.667876
15.0
Charged Off
10694.96
3330.44
0.00
15
1.190256
1.190256
-1.0
Fully Paid
10000.00
1902.56
0.00
16
1.153631
1.153631
14.0
Fully Paid
10000.00
1536.31
0.00
17
0.341690
0.341690
26.0
Charged Off
1305.58
475.25
0.00
18
1.054899
1.054899
27.0
Fully Paid
15000.00
823.48
0.00
19
0.000000
0.000000
0.0
Charged Off
0.00
0.00
0.00
20
1.121198
1.121198
20.0
Fully Paid
4000.00
484.79
0.00
21
1.190848
1.190848
0.0
Fully Paid
8500.00
1622.21
0.00
22
1.119667
1.119667
-1.0
Fully Paid
4375.00
523.54
0.00
23
1.096185
1.096185
16.0
Fully Paid
31825.00
3061.08
0.00
24
1.142918
1.142918
-1.0
Fully Paid
5000.00
714.59
0.00
25
1.264134
1.264134
-1.0
Fully Paid
7000.00
1848.94
0.00
26
1.172376
1.172376
-1.0
Fully Paid
12400.00
2137.46
0.00
27
1.125667
1.125667
13.0
Fully Paid
10800.00
1357.20
0.00
28
1.110840
1.110840
11.0
Fully Paid
15000.00
1662.60
0.00
29
1.187547
1.187547
8.0
Fully Paid
6000.00
1125.28
0.00
30
1.119767
1.119767
-1.0
Fully Paid
9600.00
1149.76
0.00
31
1.126365
1.126365
-1.0
Fully Paid
12000.00
1516.38
0.00
32
1.305009
1.305009
-1.0
Fully Paid
3000.00
915.03
0.00
33
1.278839
1.278839
-1.0
Fully Paid
4400.00
1226.89
0.00
34
1.010977
1.010977
29.0
Fully Paid
6000.00
65.86
0.00
35
1.159994
1.159994
-1.0
Fully Paid
14000.00
2239.91
0.00
36
1.004274
1.004274
4.0
Charged Off
4217.38
696.99
0.00
37
1.172457
1.172457
-1.0
Fully Paid
10000.00
1724.57
0.00
38
1.028267
1.028267
29.0
Fully Paid
10000.00
282.67
0.00
39
1.105216
1.105216
-1.0
Fully Paid
11000.00
1157.38
0.00
...
...
...
...
...
...
...
...
619841
1.051029
1.051029
28.0
Fully Paid
30000.00
1530.87
0.00
619843
1.055844
1.055844
29.0
Fully Paid
5000.00
279.22
0.00
619844
0.229998
0.229998
29.0
Charged Off
1413.48
518.50
0.00
619845
1.103255
1.103255
26.0
Fully Paid
6000.00
619.53
0.00
619846
1.057553
1.057553
28.0
Fully Paid
1500.00
86.33
0.00
619858
1.031935
1.031935
31.0
Fully Paid
2000.00
63.87
0.00
619865
0.223685
0.223685
29.0
Default
6114.54
1714.44
0.00
619866
0.369147
0.369147
24.0
In Grace Period
1593.48
621.40
0.00
619871
1.044527
1.044527
32.0
Fully Paid
7000.00
311.69
0.00
619875
1.029352
1.029352
31.0
Fully Paid
24000.00
704.45
0.00
619878
0.299029
0.299029
28.0
Late (31-120 days)
1220.32
910.26
0.00
619884
0.370209
0.370209
25.0
In Grace Period
2392.83
920.54
0.00
619885
1.105963
1.105963
31.0
Fully Paid
26500.00
2808.02
0.00
619889
0.314595
0.314595
27.0
Late (31-120 days)
2917.03
1510.89
0.00
619890
0.319612
0.319612
27.0
Late (31-120 days)
1020.82
577.24
0.00
619891
1.002498
1.002498
36.0
Fully Paid
20000.00
49.97
0.00
619894
1.071025
1.071025
30.0
Fully Paid
20000.00
1420.51
0.00
619898
1.082966
1.082966
25.0
Fully Paid
30000.00
2488.99
0.00
619902
1.095670
1.095670
25.0
Fully Paid
12000.00
1148.04
0.00
619910
1.054243
1.054243
32.0
Fully Paid
12825.00
695.67
0.00
619920
0.312864
0.312864
26.0
Late (31-120 days)
1598.40
802.83
0.00
619932
0.332640
0.332640
26.0
Late (31-120 days)
2901.47
1090.21
0.00
619936
0.240962
0.240962
29.0
Charged Off
1160.10
574.83
0.00
619940
0.402415
0.402415
25.0
Late (16-30 days)
7050.56
4418.27
0.00
619943
1.094774
1.094774
27.0
Fully Paid
20000.00
1895.49
0.00
619946
0.246791
0.246791
26.0
Charged Off
3222.40
1678.75
34.66
619950
0.336698
0.336698
27.0
Late (31-120 days)
4871.09
3546.35
0.00
619952
1.142157
1.142157
25.0
Fully Paid
5875.00
835.17
0.00
619953
0.347833
0.347833
26.0
Late (31-120 days)
1356.95
686.57
0.00
619968
0.250593
0.250593
29.0
Charged Off
1862.24
1144.88
0.00
619971
0.216840
0.216840
30.0
Charged Off
359.21
231.68
0.00
619983
0.244289
0.244289
29.0
Charged Off
2226.49
1193.55
0.00
619985
1.078031
1.078031
28.0
Fully Paid
15000.00
1170.46
0.00
619992
0.312863
0.312863
27.0
Late (31-120 days)
5831.27
2928.89
0.00
619993
1.077563
1.077563
26.0
Fully Paid
6000.00
465.38
0.00
619996
0.244290
0.244290
29.0
Charged Off
667.96
358.06
0.00
620003
1.027552
1.027552
30.0
Fully Paid
10775.00
296.87
0.00
620005
1.132604
1.132604
25.0
Fully Paid
6225.00
825.46
0.00
620007
1.039505
1.039505
31.0
Fully Paid
4000.00
158.02
0.00
620009
0.220834
0.220834
29.0
Charged Off
1405.77
990.28
0.00
209087 rows × 7 columns
In [29]:
%matplotlib inline
import matplotlib.pyplot as plt
plt.scatter(feat_inform.balance1,feat_inform.int_rate)
plt.show()
This deals with abberant loans that aren't paid back on a monthly schedule.
The problem loans now are large lump sum payments on current loans, as they throw off the amortization schedule. The simpliest way to avoid this is to subtract large payments from principal and recalulate, but only the most recent payment information is given so this would be tricky with most of the loans. Instead, with the data I have, the easiest thing to do is to remove any loan with average payments that are much more than the installment amount, and hope for a still large sample set. currently, there are 381,065 loans in the sample. If we remove less that 10% of the data, it won't impact the amount of data too much
In [30]:
feat_inform['excess_pymnt']=(feat_inform.total_pymnt-feat_inform.total_rec_late_fee)/(feat_inform.installment*(feat_raw.term-feat_raw.pymnts_left))
In [31]:
feat_inform.query('excess_pymnt>1.1 & current==True')
Out[31]:
id
loan_amnt
term
int_rate
installment
sub_grade
emp_title
emp_length
home_ownership
annual_inc
loan_status
purpose
addr_state
dti
delinq_2yrs
earliest_cr_line
inq_last_6mths
mths_since_last_delinq
mths_since_last_record
open_acc
pub_rec
revol_bal
revol_util
total_acc
total_pymnt
total_rec_prncp
total_rec_int
total_rec_late_fee
recoveries
collection_recovery_fee
last_pymnt_d
last_pymnt_amnt
next_pymnt_d
collections_12_mths_ex_med
mths_since_last_major_derog
issue_d
num_pymnts
pymnts_left
current
balance1
balance2
class_label
excess_pymnt
In [32]:
feat_inform=feat_inform.query('(excess_pymnt<1.1 & current==True) | current==False')
In [33]:
feat_inform
Out[33]:
id
loan_amnt
term
int_rate
installment
sub_grade
emp_title
emp_length
home_ownership
annual_inc
loan_status
purpose
addr_state
dti
delinq_2yrs
earliest_cr_line
inq_last_6mths
mths_since_last_delinq
mths_since_last_record
open_acc
pub_rec
revol_bal
revol_util
total_acc
total_pymnt
total_rec_prncp
total_rec_int
total_rec_late_fee
recoveries
collection_recovery_fee
last_pymnt_d
last_pymnt_amnt
next_pymnt_d
collections_12_mths_ex_med
mths_since_last_major_derog
issue_d
num_pymnts
pymnts_left
current
balance1
balance2
class_label
excess_pymnt
0
1077501
5000.0
36
10.65
162.87
B2
None
10.0
RENT
24000.00
Fully Paid
credit_card
AZ
27.65
0.0
1985-01-01
1.0
NaN
NaN
3.0
0.0
13648.0
83.70
9.0
5861.071414
5000.00
861.07
0.00
0.00
0.0000
2015-01-01
171.62
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.172214
1.172214
1
0.972600
1
1077175
2400.0
36
15.96
84.33
C5
None
10.0
RENT
12252.00
Fully Paid
small_business
IL
8.72
0.0
2001-11-01
2.0
NaN
NaN
2.0
0.0
2956.0
98.50
10.0
3003.653644
2400.00
603.65
0.00
0.00
0.0000
2014-06-01
649.91
None
0.0
NaN
2011-12-01
30.0
6.0
False
1.251522
1.251522
1
1.187262
2
1076863
10000.0
36
13.49
339.31
C1
AIR RESOURCES BOARD
10.0
RENT
49200.00
Fully Paid
other
CA
20.00
0.0
1996-02-01
1.0
35.0
NaN
10.0
0.0
5598.0
21.00
37.0
12226.302212
10000.00
2209.33
16.97
0.00
0.0000
2015-01-01
357.48
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.222630
1.222630
1
0.972509
3
1075269
5000.0
36
7.90
156.46
A4
Veolia Transportaton
3.0
RENT
36000.00
Fully Paid
wedding
AZ
11.20
0.0
2004-11-01
3.0
NaN
NaN
9.0
0.0
7963.0
28.30
12.0
5631.377753
5000.00
631.38
0.00
0.00
0.0000
2015-01-01
161.03
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.126276
1.126276
1
0.972769
4
1072053
3000.0
36
18.64
109.43
E1
MKC Accounting
9.0
RENT
48000.00
Fully Paid
car
CA
5.35
0.0
2007-01-01
2.0
NaN
NaN
4.0
0.0
8221.0
87.50
4.0
3938.144334
3000.00
938.14
0.00
0.00
0.0000
2015-01-01
111.34
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.312715
1.312715
1
0.972643
5
1069908
12000.0
36
12.69
402.54
B5
UCLA
10.0
OWN
75000.00
Fully Paid
debt_consolidation
CA
10.78
0.0
1989-10-01
0.0
NaN
NaN
12.0
0.0
23336.0
67.10
34.0
13943.080000
12000.00
1943.08
0.00
0.00
0.0000
2013-09-01
6315.30
None
0.0
NaN
2011-12-01
21.0
15.0
False
1.161923
1.161923
1
1.649417
6
1064687
9000.0
36
13.49
305.38
C1
Va. Dept of Conservation/Recreation
0.5
RENT
30000.00
Charged Off
debt_consolidation
VA
10.08
0.0
2004-04-01
1.0
NaN
NaN
4.0
0.0
10452.0
91.70
9.0
2270.700000
1256.14
570.26
0.00
444.30
4.1600
2012-07-01
305.38
None
0.0
NaN
2011-12-01
7.0
29.0
False
0.252300
0.252300
0
1.062236
7
1069866
3000.0
36
9.91
96.68
B1
Target
3.0
RENT
15000.00
Fully Paid
credit_card
IL
12.56
0.0
2003-07-01
2.0
NaN
NaN
11.0
0.0
7323.0
43.10
11.0
3478.981915
3000.00
478.98
0.00
0.00
0.0000
2015-01-01
102.43
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.159661
1.159661
1
0.972554
8
1069057
10000.0
36
10.65
325.74
B2
SFMTA
3.0
RENT
100000.00
Charged Off
other
CA
7.06
0.0
1991-05-01
2.0
NaN
NaN
14.0
0.0
11997.0
55.50
29.0
7471.990000
5433.47
1393.42
0.00
645.10
6.3145
2013-10-01
325.74
None
0.0
NaN
2011-12-01
22.0
14.0
False
0.747199
0.747199
0
1.042660
9
1069759
1000.0
36
16.29
35.31
D1
Internal revenue Service
0.5
RENT
28000.00
Fully Paid
debt_consolidation
MO
20.31
0.0
2007-09-01
1.0
NaN
NaN
11.0
0.0
6524.0
81.50
23.0
1270.171106
1000.00
270.17
0.00
0.00
0.0000
2015-01-01
36.32
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.270171
1.270171
1
0.972216
10
1065775
10000.0
36
15.27
347.98
C4
Chin's Restaurant
4.0
RENT
42000.00
Fully Paid
home_improvement
CA
18.60
0.0
1998-10-01
2.0
61.0
NaN
14.0
0.0
24043.0
70.20
28.0
12519.260450
10000.00
2519.26
0.00
0.00
0.0000
2015-01-01
370.46
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.251926
1.251926
1
0.972350
11
1069971
3600.0
36
6.03
109.57
A1
Duracell
10.0
MORTGAGE
110000.00
Fully Paid
major_purchase
CT
10.52
0.0
1993-08-01
0.0
NaN
NaN
20.0
0.0
22836.0
16.00
42.0
3785.020000
3600.00
185.02
0.00
0.00
0.0000
2013-05-01
583.45
None
0.0
NaN
2011-12-01
17.0
19.0
False
1.051394
1.051394
1
2.032018
12
1062474
6000.0
36
11.71
198.46
B3
Connection Inspection
1.0
MORTGAGE
84000.00
Fully Paid
medical
UT
18.44
2.0
2003-10-01
0.0
8.0
NaN
4.0
0.0
0.0
37.73
14.0
7164.499852
6000.00
1149.50
15.00
0.00
0.0000
2015-02-01
16.98
None
0.0
NaN
2011-12-01
38.0
-2.0
False
1.194083
1.194083
1
0.948023
13
1069742
9200.0
36
6.03
280.01
A1
Network Interpreting Service
6.0
RENT
77385.19
Fully Paid
debt_consolidation
CA
9.86
0.0
2001-01-01
0.0
NaN
NaN
8.0
0.0
7314.0
23.10
28.0
9459.960000
9200.00
259.96
0.00
0.00
0.0000
2012-07-01
8061.10
None
0.0
NaN
2011-12-01
7.0
29.0
False
1.028257
1.028257
1
4.826338
14
1039153
21000.0
36
12.42
701.73
B4
Osram Sylvania
10.0
RENT
105000.00
Charged Off
debt_consolidation
FL
13.22
0.0
1983-02-01
0.0
NaN
NaN
7.0
0.0
32135.0
90.30
38.0
14025.400000
10694.96
3330.44
0.00
0.00
0.0000
2013-09-01
701.73
None
0.0
NaN
2011-12-01
21.0
15.0
False
0.667876
0.667876
0
0.951757
15
1069710
10000.0
36
11.71
330.76
B3
Value Air
10.0
OWN
50000.00
Fully Paid
credit_card
TX
11.18
0.0
1985-07-01
0.0
NaN
NaN
8.0
0.0
10056.0
82.40
21.0
11902.561575
10000.00
1902.56
0.00
0.00
0.0000
2015-01-01
349.21
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.190256
1.190256
1
0.972581
16
1069700
10000.0
36
11.71
330.76
B3
Wells Fargo Bank
5.0
RENT
50000.00
Fully Paid
debt_consolidation
CA
16.01
0.0
2003-04-01
0.0
NaN
NaN
6.0
0.0
17800.0
91.80
17.0
11536.310000
10000.00
1536.31
0.00
0.00
0.0000
2013-10-01
4942.63
None
0.0
NaN
2011-12-01
22.0
14.0
False
1.153631
1.153631
1
1.585372
17
1069559
6000.0
36
11.71
198.46
B3
bmg-educational
1.0
RENT
76000.00
Charged Off
major_purchase
CA
2.40
0.0
2001-06-01
1.0
NaN
NaN
7.0
0.0
5963.0
29.70
7.0
2050.140000
1305.58
475.25
0.00
269.31
2.5700
2012-10-01
198.46
None
0.0
NaN
2011-12-01
10.0
26.0
False
0.341690
0.341690
0
1.033024
18
1069697
15000.0
36
9.91
483.38
B1
Winfield Pathology Consultants
2.0
MORTGAGE
92000.00
Fully Paid
credit_card
IL
29.44
0.0
2002-02-01
0.0
NaN
NaN
8.0
0.0
13707.0
93.90
31.0
15823.480000
15000.00
823.48
0.00
0.00
0.0000
2012-09-01
2447.05
None
0.0
NaN
2011-12-01
9.0
27.0
False
1.054899
1.054899
1
3.637230
19
1069800
15000.0
36
14.27
514.64
C2
nyc transit
9.0
RENT
60000.00
Charged Off
debt_consolidation
NY
15.22
0.0
2003-10-01
1.0
NaN
NaN
7.0
0.0
5872.0
57.60
11.0
0.000000
0.00
0.00
0.00
0.00
0.0000
NaT
0.00
None
0.0
NaN
2011-12-01
NaN
0.0
False
0.000000
0.000000
0
0.000000
20
1069799
4000.0
36
11.71
132.31
B3
Shands Hospital at the University of Fl
10.0
MORTGAGE
106000.00
Fully Paid
debt_consolidation
FL
5.63
1.0
1984-08-01
0.0
18.0
NaN
12.0
0.0
6110.0
37.70
44.0
4484.790000
4000.00
484.79
0.00
0.00
0.0000
2013-04-01
2638.77
None
0.0
NaN
2011-12-01
16.0
20.0
False
1.121198
1.121198
1
2.118505
21
1047704
8500.0
36
11.71
281.15
B3
Oakridge homes
0.5
RENT
25000.00
Fully Paid
credit_card
MN
12.19
0.0
2006-11-01
0.0
NaN
NaN
8.0
0.0
6441.0
59.10
12.0
10122.208614
8500.00
1622.21
0.00
0.00
0.0000
2014-12-01
581.59
None
0.0
NaN
2011-12-01
36.0
0.0
False
1.190848
1.190848
1
1.000080
22
1032111
4375.0
36
7.51
136.11
A3
None
7.0
MORTGAGE
17108.00
Fully Paid
debt_consolidation
NY
20.34
0.0
1987-12-01
0.0
NaN
NaN
6.0
0.0
11210.0
86.90
12.0
4898.543558
4375.00
523.54
0.00
0.00
0.0000
2015-01-01
144.94
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.119667
1.119667
1
0.972692
23
1069539
31825.0
36
7.90
995.82
A4
Audubon Mutual Housing Corporation
5.0
MORTGAGE
75000.00
Fully Paid
debt_consolidation
NJ
14.03
0.0
1981-11-01
0.0
NaN
NaN
12.0
0.0
23151.0
27.40
26.0
34886.080000
31825.00
3061.08
0.00
0.00
0.0000
2013-08-01
16966.70
None
0.0
NaN
2011-12-01
20.0
16.0
False
1.096185
1.096185
1
1.751626
24
1069591
5000.0
36
8.90
158.77
A5
Good Samaritan Society
2.0
RENT
24044.00
Fully Paid
debt_consolidation
OR
11.93
0.0
2005-04-01
0.0
45.0
NaN
8.0
0.0
2224.0
29.30
16.0
5714.592129
5000.00
714.59
0.00
0.00
0.0000
2015-01-01
163.64
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.142918
1.142918
1
0.972781
25
1069530
7000.0
36
15.96
245.97
C5
GREG BARRETT DRYWALL
7.0
RENT
34000.00
Fully Paid
credit_card
CA
6.35
0.0
2007-10-01
1.0
NaN
NaN
6.0
0.0
6113.0
60.50
6.0
8848.940430
7000.00
1848.94
0.00
0.00
0.0000
2015-01-01
260.74
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.264134
1.264134
1
0.972316
26
1069522
12400.0
36
10.65
403.91
B2
Sharp Lawn Inc.
10.0
RENT
41000.00
Fully Paid
credit_card
KY
11.80
0.0
2005-07-01
2.0
NaN
NaN
9.0
0.0
11095.0
57.20
12.0
14537.459527
12400.00
2137.46
0.00
0.00
0.0000
2015-01-01
417.61
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.172376
1.172376
1
0.972752
27
1069361
10800.0
36
9.91
348.03
B1
Department of Justice
2.0
RENT
55596.00
Fully Paid
moving
CA
5.50
0.0
2000-12-01
0.0
NaN
NaN
7.0
0.0
2535.0
13.30
18.0
12157.200000
10800.00
1357.20
0.00
0.00
0.0000
2013-11-01
3483.79
None
0.0
NaN
2011-12-01
23.0
13.0
False
1.125667
1.125667
1
1.518760
28
1069357
15000.0
36
7.90
469.36
A4
Gateway Hospice
1.0
RENT
45000.00
Fully Paid
debt_consolidation
OH
8.48
0.0
2004-11-01
0.0
NaN
NaN
7.0
0.0
6704.0
50.40
27.0
16662.600000
15000.00
1662.60
0.00
0.00
0.0000
2014-01-01
5872.80
None
0.0
NaN
2011-12-01
25.0
11.0
False
1.110840
1.110840
1
1.420027
29
1069356
6000.0
36
12.42
200.50
B4
Cox Communications
1.0
RENT
36852.00
Fully Paid
debt_consolidation
AZ
10.62
0.0
2007-04-01
1.0
NaN
NaN
7.0
0.0
7310.0
66.50
12.0
7125.283165
6000.00
1125.28
0.00
0.00
0.0000
2014-04-01
1923.53
None
0.0
NaN
2011-12-01
28.0
8.0
False
1.187547
1.187547
1
1.269199
30
1067573
9600.0
36
7.51
298.67
A3
Nucor Building Systems
4.0
RENT
68004.00
Fully Paid
other
SC
6.63
0.0
2003-01-01
0.0
NaN
NaN
6.0
0.0
2896.0
18.10
11.0
10749.762645
9600.00
1149.76
0.00
0.00
0.0000
2015-01-01
311.56
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.119767
1.119767
1
0.972760
31
1069506
12000.0
36
7.90
375.49
A4
John Wiley Jr.
10.0
RENT
62300.00
Fully Paid
debt_consolidation
NJ
16.70
0.0
1994-03-01
0.0
38.0
NaN
15.0
0.0
8601.0
21.00
25.0
13516.382957
12000.00
1516.38
0.00
0.00
0.0000
2015-01-01
380.98
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.126365
1.126365
1
0.972882
32
1069314
3000.0
36
18.25
108.84
D5
None
9.0
MORTGAGE
65000.00
Fully Paid
other
PA
17.39
0.0
1998-09-01
0.0
NaN
NaN
8.0
0.0
43936.0
98.10
22.0
3915.027595
3000.00
915.03
0.00
0.00
0.0000
2015-01-01
115.38
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.305009
1.305009
1
0.972175
33
1060578
4400.0
36
16.77
156.37
D2
citizens bank
10.0
RENT
55000.00
Fully Paid
debt_consolidation
RI
20.01
0.0
2004-06-01
0.0
NaN
NaN
7.0
0.0
25237.0
99.00
11.0
5626.892655
4400.00
1226.89
0.00
0.00
0.0000
2015-01-01
162.44
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.278839
1.278839
1
0.972553
34
1069469
6000.0
36
6.03
182.62
A1
Stewart Enterprises, Inc.
10.0
MORTGAGE
45600.00
Fully Paid
debt_consolidation
LA
5.34
0.0
1995-11-01
1.0
NaN
NaN
6.0
0.0
3378.0
32.50
28.0
6065.860000
6000.00
65.86
0.00
0.00
0.0000
2012-07-01
15.01
None
0.0
NaN
2011-12-01
7.0
29.0
False
1.010977
1.010977
1
4.745107
35
1051117
14000.0
36
9.91
451.15
B1
golfers warehouse
6.0
RENT
80000.00
Fully Paid
small_business
MA
10.00
0.0
1999-07-01
1.0
45.0
NaN
7.0
0.0
2219.0
13.40
40.0
16239.914128
14000.00
2239.91
0.00
0.00
0.0000
2015-01-01
457.91
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.159994
1.159994
1
0.972884
36
1069465
5000.0
36
8.90
158.77
A5
STERIS Corporation
10.0
MORTGAGE
100000.00
Charged Off
debt_consolidation
OH
16.33
0.0
1995-06-01
0.0
NaN
NaN
17.0
0.0
74351.0
62.10
35.0
5021.370000
4217.38
696.99
0.00
107.00
1.0700
2014-08-01
158.77
None
0.0
NaN
2011-12-01
32.0
4.0
False
1.004274
1.004274
0
0.988334
37
1069283
10000.0
36
10.65
325.74
B2
Costco Wholesale Corp.
6.0
RENT
27000.00
Fully Paid
other
NY
11.47
0.0
2006-11-01
0.0
NaN
NaN
7.0
0.0
7814.0
52.30
10.0
11724.567737
10000.00
1724.57
0.00
0.00
0.0000
2015-01-01
332.92
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.172457
1.172457
1
0.972801
38
1069287
10000.0
36
6.03
304.36
A1
Helicoil
10.0
RENT
60000.00
Fully Paid
credit_card
CT
12.74
0.0
1992-09-01
1.0
NaN
NaN
11.0
0.0
14019.0
19.50
18.0
10282.670000
10000.00
282.67
0.00
0.00
0.0000
2012-07-01
8762.05
None
0.0
NaN
2011-12-01
7.0
29.0
False
1.028267
1.028267
1
4.826366
39
1069453
11000.0
36
6.62
337.75
A2
cognizant technology solutions
5.0
RENT
70000.00
Fully Paid
debt_consolidation
CT
10.85
0.0
2002-01-01
0.0
NaN
NaN
5.0
0.0
11638.0
36.40
7.0
12157.380047
11000.00
1157.38
0.00
0.00
0.0000
2015-01-01
346.13
None
0.0
NaN
2011-12-01
37.0
-1.0
False
1.105216
1.105216
1
0.972843
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
619841
37840758
30000.0
36
8.67
949.40
B1
Accounts Payable Coordinator and Leas
8.0
MORTGAGE
60000.00
Fully Paid
debt_consolidation
OR
9.26
0.0
1995-03-01
0.0
49.0
NaN
14.0
0.0
20801.0
52.30
26.0
31530.870000
30000.00
1530.87
0.00
0.00
0.0000
2015-09-01
155.03
None
0.0
NaN
2015-01-01
8.0
28.0
False
1.051029
1.051029
1
4.151421
619843
36281499
5000.0
36
10.49
162.49
B3
Qc inspector
5.0
MORTGAGE
46000.00
Fully Paid
credit_card
CA
8.10
0.0
2007-02-01
0.0
NaN
NaN
11.0
0.0
106171.0
22.00
22.0
5279.220000
5000.00
279.22
0.00
0.00
0.0000
2015-08-01
4310.11
None
0.0
NaN
2015-01-01
7.0
29.0
False
1.055844
1.055844
1
4.641358
619844
37740718
8400.0
36
11.44
276.76
B4
Operator
1.0
MORTGAGE
100000.00
Charged Off
credit_card
TX
37.20
2.0
2007-05-01
0.0
11.0
NaN
11.0
0.0
6007.0
50.10
34.0
1931.980000
1413.48
518.50
0.00
0.00
0.0000
2015-08-01
276.76
None
0.0
NaN
2015-01-01
7.0
29.0
False
0.229998
0.229998
0
0.997244
619845
37680304
6000.0
36
13.66
204.08
C3
Account Executive
4.0
RENT
60000.00
Fully Paid
debt_consolidation
NY
21.10
0.0
2006-08-01
1.0
32.0
NaN
19.0
0.0
5796.0
30.80
39.0
6619.530000
6000.00
619.53
0.00
0.00
0.0000
2015-11-01
4791.92
None
0.0
32.0
2015-01-01
10.0
26.0
False
1.103255
1.103255
1
3.243596
619846
37750780
1500.0
36
11.99
49.82
B5
PTF Clerk
8.0
OWN
62000.00
Fully Paid
other
MN
7.18
0.0
1992-12-01
0.0
71.0
NaN
11.0
0.0
11397.0
73.50
22.0
1586.330000
1500.00
86.33
0.00
0.00
0.0000
2015-09-01
488.87
None
0.0
NaN
2015-01-01
8.0
28.0
False
1.057553
1.057553
1
3.980154
619858
37760680
2000.0
36
8.19
62.85
A5
medical biller
8.0
MORTGAGE
31000.00
Fully Paid
credit_card
CA
8.45
0.0
2004-11-01
1.0
62.0
NaN
13.0
0.0
4043.0
16.90
48.0
2063.870000
2000.00
63.87
0.00
0.00
0.0000
2015-06-01
1785.69
None
1.0
62.0
2015-01-01
5.0
31.0
False
1.031935
1.031935
1
6.567605
619865
37770544
35000.0
36
8.67
1107.63
B1
Manager
1.0
OWN
185000.00
Default
credit_card
CA
8.72
0.0
1995-01-01
0.0
37.0
45.0
10.0
5.0
6341.0
77.30
28.0
7828.980000
6114.54
1714.44
0.00
0.00
0.0000
2015-08-01
1107.63
Feb-2016
0.0
47.0
2015-01-01
7.0
29.0
False
0.223685
0.223685
0
1.009747
619866
37780598
6000.0
36
12.99
202.14
C2
personal banker
10.0
MORTGAGE
66000.00
In Grace Period
other
NJ
16.15
0.0
1989-05-01
1.0
34.0
45.0
17.0
4.0
7046.0
71.30
45.0
2214.880000
1593.48
621.40
0.00
0.00
0.0000
2016-01-01
202.14
Feb-2016
0.0
34.0
2015-01-01
12.0
24.0
False
0.369147
0.369147
0
0.913097
619871
37750629
7000.0
36
13.66
238.09
C3
Hotel Clerk
10.0
RENT
48681.00
Fully Paid
debt_consolidation
NY
10.85
1.0
1995-09-01
0.0
15.0
NaN
13.0
0.0
11856.0
58.10
41.0
7311.690000
7000.00
311.69
0.00
0.00
0.0000
2015-05-01
6608.04
None
0.0
15.0
2015-01-01
4.0
32.0
False
1.044527
1.044527
1
7.677443
619875
37620521
24000.0
36
6.49
735.47
A2
owner
0.5
MORTGAGE
75000.00
Fully Paid
credit_card
TX
21.31
0.0
2001-09-01
1.0
NaN
NaN
10.0
0.0
15117.0
65.20
17.0
24704.450000
24000.00
704.45
0.00
0.00
0.0000
2015-06-01
21779.88
None
0.0
NaN
2015-01-01
5.0
31.0
False
1.029352
1.029352
1
6.718003
619878
37710609
7125.0
36
20.99
268.40
E4
None
0.0
OWN
17000.00
Late (31-120 days)
credit_card
FL
29.04
0.0
2001-10-01
3.0
NaN
115.0
9.0
1.0
4129.0
38.60
19.0
2130.580000
1220.32
910.26
0.00
0.00
0.0000
2015-09-01
436.80
Feb-2016
0.0
NaN
2015-01-01
8.0
28.0
False
0.299029
0.299029
0
0.992260
619884
37600609
8950.0
36
12.39
298.94
C1
None
3.0
MORTGAGE
50000.00
In Grace Period
home_improvement
AR
16.80
0.0
2004-05-01
0.0
NaN
68.0
7.0
1.0
1970.0
59.70
14.0
3313.370000
2392.83
920.54
0.00
0.00
0.0000
2015-12-01
298.94
Feb-2016
0.0
NaN
2015-01-01
11.0
25.0
False
0.370209
0.370209
0
1.007612
619885
37810537
26500.0
36
23.99
1039.54
F2
driver
8.0
MORTGAGE
170000.00
Fully Paid
small_business
NJ
5.89
0.0
2009-02-01
2.0
NaN
37.0
6.0
2.0
2128.0
23.60
9.0
29308.020000
26500.00
2808.02
0.00
0.00
0.0000
2015-06-01
25220.50
None
0.0
NaN
2015-01-01
5.0
31.0
False
1.105963
1.105963
1
5.638652
619889
36783346
14075.0
36
15.99
494.77
D2
Room Service
1.0
RENT
35370.00
Late (31-120 days)
small_business
CA
15.95
0.0
2001-09-01
1.0
NaN
NaN
7.0
0.0
3113.0
21.20
25.0
4427.920000
2917.03
1510.89
0.00
0.00
0.0000
2015-10-01
494.77
Feb-2016
0.0
NaN
2015-01-01
9.0
27.0
False
0.314595
0.314595
0
0.994383
619890
37660446
5000.0
36
17.14
178.62
D4
Accounting Personnel Specialist
10.0
MORTGAGE
40160.00
Late (31-120 days)
medical
GA
31.53
1.0
1998-08-01
1.0
16.0
NaN
11.0
0.0
3484.0
65.70
21.0
1598.060000
1020.82
577.24
0.00
0.00
0.0000
2015-10-01
178.62
Feb-2016
0.0
NaN
2015-01-01
9.0
27.0
False
0.319612
0.319612
0
0.994078
619891
37650375
20000.0
36
14.99
693.21
C5
Senior HR Manager
10.0
OWN
80000.00
Fully Paid
home_improvement
VA
23.65
0.0
1993-12-01
1.0
NaN
NaN
10.0
0.0
56172.0
68.80
18.0
20049.970000
20000.00
49.97
0.00
0.00
0.0000
2015-01-01
20083.28
None
0.0
NaN
2015-01-01
0.0
36.0
False
1.002498
1.002498
1
inf
619894
37650403
20000.0
36
14.31
686.57
C4
Executive Director (CEO)
4.0
MORTGAGE
262000.00
Fully Paid
home_improvement
NY
9.51
0.0
2006-05-01
2.0
NaN
NaN
12.0
0.0
13917.0
19.90
14.0
21420.510000
20000.00
1420.51
0.00
0.00
0.0000
2015-07-01
18019.46
None
0.0
NaN
2015-01-01
6.0
30.0
False
1.071025
1.071025
1
5.199885
619898
37790415
30000.0
36
14.99
1039.82
C5
Teacher
10.0
MORTGAGE
84000.00
Fully Paid
debt_consolidation
CA
16.54
0.0
2003-07-01
1.0
62.0
NaN
15.0
0.0
30246.0
70.20
45.0
32488.990000
30000.00
2488.99
0.00
0.00
0.0000
2015-12-01
140.76
None
0.0
62.0
2015-01-01
11.0
25.0
False
1.082966
1.082966
1
2.840438
619902
36118265
12000.0
36
11.99
398.52
B5
utility Pre-Craft Trainee
1.0
RENT
65000.00
Fully Paid
debt_consolidation
CA
8.49
0.0
1993-09-01
1.0
NaN
NaN
14.0
0.0
12987.0
44.60
25.0
13148.040000
12000.00
1148.04
0.00
0.00
0.0000
2015-12-01
9178.83
None
0.0
NaN
2015-01-01
11.0
25.0
False
1.095670
1.095670
1
2.999288
619910
36400285
12825.0
36
17.14
458.15
D4
Sales Associate
6.0
MORTGAGE
38000.00
Fully Paid
debt_consolidation
TX
9.03
0.0
2006-06-01
0.0
NaN
NaN
8.0
0.0
11878.0
70.70
24.0
13520.670000
12825.00
695.67
0.00
0.00
0.0000
2015-05-01
12170.64
None
0.0
NaN
2015-01-01
4.0
32.0
False
1.054243
1.054243
1
7.377862
619920
37830269
7675.0
36
15.59
268.28
D1
Sub teacher / Coach
2.0
OWN
27000.00
Late (31-120 days)
debt_consolidation
CA
18.62
0.0
2000-06-01
0.0
NaN
NaN
29.0
0.0
14722.0
47.00
42.0
2401.230000
1598.40
802.83
0.00
0.00
0.0000
2015-11-01
268.28
Feb-2016
0.0
NaN
2015-01-01
10.0
26.0
False
0.312864
0.312864
0
0.895046
619932
37117178
12000.0
36
12.39
400.82
C1
Groomer
4.0
MORTGAGE
55000.00
Late (31-120 days)
debt_consolidation
CO
26.58
0.0
2006-01-01
2.0
41.0
NaN
23.0
0.0
8835.0
29.70
45.0
3991.680000
2901.47
1090.21
0.00
0.00
0.0000
2015-11-01
400.82
Feb-2016
0.0
41.0
2015-01-01
10.0
26.0
False
0.332640
0.332640
0
0.995878
619936
37068125
7200.0
36
14.99
249.56
C5
Asst. General Superintendent
5.0
MORTGAGE
74000.00
Charged Off
credit_card
TX
22.25
0.0
2005-07-01
2.0
NaN
NaN
8.0
0.0
5432.0
45.60
12.0
1734.930000
1160.10
574.83
0.00
0.00
0.0000
2015-08-01
249.56
None
0.0
NaN
2015-01-01
7.0
29.0
False
0.240962
0.240962
0
0.993136
619940
37147964
28500.0
36
19.24
1048.16
E2
President
5.0
MORTGAGE
57200.00
Late (16-30 days)
home_improvement
CA
28.85
0.0
1999-02-01
2.0
NaN
NaN
11.0
0.0
42256.0
65.00
23.0
11468.830000
7050.56
4418.27
0.00
0.00
0.0000
2015-12-01
1048.16
Feb-2016
0.0
NaN
2015-01-01
11.0
25.0
False
0.402415
0.402415
0
0.994715
619943
36801355
20000.0
36
12.99
673.79
C2
Letter Carrier
10.0
MORTGAGE
76584.00
Fully Paid
credit_card
CA
12.83
1.0
1981-09-01
2.0
10.0
NaN
10.0
0.0
10868.0
59.70
36.0
21895.490000
20000.00
1895.49
0.00
0.00
0.0000
2015-10-01
16534.04
None
0.0
37.0
2015-01-01
9.0
27.0
False
1.094774
1.094774
1
3.610668
619946
37297854
20000.0
36
14.99
693.21
C5
Chiropractor
10.0
MORTGAGE
100000.00
Charged Off
small_business
GA
23.74
2.0
1997-11-01
0.0
6.0
65.0
17.0
2.0
16190.0
35.90
26.0
4935.810000
3222.40
1678.75
34.66
0.00
0.0000
2015-11-01
100.00
None
0.0
6.0
2015-01-01
10.0
26.0
False
0.246791
0.246791
0
0.707022
619950
37257620
25000.0
36
20.99
941.75
E4
shop foreman
10.0
MORTGAGE
55000.00
Late (31-120 days)
debt_consolidation
TN
31.22
0.0
1999-10-01
1.0
NaN
NaN
13.0
0.0
22438.0
63.20
18.0
8417.440000
4871.09
3546.35
0.00
0.00
0.0000
2015-10-01
941.75
Feb-2016
0.0
NaN
2015-01-01
9.0
27.0
False
0.336698
0.336698
0
0.993120
619952
37127712
5875.0
36
16.49
207.98
D3
Sales
5.0
OWN
35000.00
Fully Paid
debt_consolidation
MS
18.93
0.0
2006-09-01
1.0
NaN
119.0
10.0
1.0
2796.0
27.10
22.0
6710.170000
5875.00
835.17
0.00
0.00
0.0000
2015-12-01
4641.13
None
0.0
NaN
2015-01-01
11.0
25.0
False
1.142157
1.142157
1
2.933049
619953
35998858
5875.0
36
15.59
205.37
D1
Elementary School Teacher
3.0
MORTGAGE
41000.00
Late (31-120 days)
debt_consolidation
SC
26.70
0.0
2006-06-01
0.0
NaN
NaN
10.0
0.0
7594.0
61.70
28.0
2043.520000
1356.95
686.57
0.00
0.00
0.0000
2015-11-01
410.74
Feb-2016
0.0
NaN
2015-01-01
10.0
26.0
False
0.347833
0.347833
0
0.995043
619968
37087435
12000.0
36
17.86
432.99
D5
Accounting
9.0
RENT
42000.00
Charged Off
debt_consolidation
NC
26.74
1.0
2001-09-01
0.0
11.0
NaN
7.0
0.0
1294.0
34.10
21.0
3007.120000
1862.24
1144.88
0.00
0.00
0.0000
2015-08-01
432.99
None
0.0
11.0
2015-01-01
7.0
29.0
False
0.250593
0.250593
0
0.992144
619971
37227443
2725.0
36
17.86
98.33
D5
None
0.0
MORTGAGE
47784.00
Charged Off
debt_consolidation
FL
14.69
1.0
2001-12-01
1.0
11.0
44.0
10.0
1.0
1963.0
33.80
18.0
590.890000
359.21
231.68
0.00
0.00
0.0000
2015-07-01
98.33
None
0.0
29.0
2015-01-01
6.0
30.0
False
0.216840
0.216840
0
1.001542
619983
37077186
14000.0
36
15.99
492.13
D2
District Manager
5.0
MORTGAGE
69000.00
Charged Off
home_improvement
FL
8.23
0.0
2003-11-01
0.0
73.0
NaN
9.0
0.0
7755.0
64.10
15.0
3420.040000
2226.49
1193.55
0.00
0.00
0.0000
2015-08-01
492.13
None
0.0
75.0
2015-01-01
7.0
29.0
False
0.244289
0.244289
0
0.992781
619985
37187152
15000.0
36
12.39
501.02
C1
Merchandiser
6.0
MORTGAGE
75000.00
Fully Paid
debt_consolidation
GA
23.35
0.0
1999-02-01
0.0
NaN
NaN
13.0
0.0
31794.0
81.50
25.0
16170.460000
15000.00
1170.46
0.00
0.00
0.0000
2015-09-01
12683.97
None
0.0
NaN
2015-01-01
8.0
28.0
False
1.078031
1.078031
1
4.034385
619992
37011266
28000.0
36
15.59
978.74
D1
sales manager
3.0
RENT
120000.00
Late (31-120 days)
debt_consolidation
NY
26.60
0.0
2003-10-01
0.0
69.0
NaN
17.0
0.0
39234.0
90.50
37.0
8760.160000
5831.27
2928.89
0.00
0.00
0.0000
2015-10-01
978.74
Feb-2016
0.0
69.0
2015-01-01
9.0
27.0
False
0.312863
0.312863
0
0.994494
619993
36808246
6000.0
36
10.49
194.99
B3
Office Administrator
4.0
RENT
42000.00
Fully Paid
debt_consolidation
MD
10.66
0.0
1986-05-01
1.0
45.0
NaN
18.0
0.0
4419.0
10.20
50.0
6465.380000
6000.00
465.38
0.00
0.00
0.0000
2015-11-01
4717.46
None
0.0
45.0
2015-01-01
10.0
26.0
False
1.077563
1.077563
1
3.315750
619996
36743377
4200.0
36
15.99
147.64
D2
supervisor
10.0
MORTGAGE
48000.00
Charged Off
medical
CO
36.93
0.0
1990-08-01
0.0
38.0
NaN
13.0
0.0
12943.0
63.40
45.0
1026.020000
667.96
358.06
0.00
0.00
0.0000
2015-08-01
147.64
None
0.0
38.0
2015-01-01
7.0
29.0
False
0.244290
0.244290
0
0.992782
620003
36231718
10775.0
36
6.03
327.95
A1
Coordinator of RSVP
0.5
RENT
54000.00
Fully Paid
debt_consolidation
FL
13.22
1.0
1975-11-01
0.0
16.0
NaN
9.0
0.0
10776.0
25.80
21.0
11071.870000
10775.00
296.87
0.00
0.00
0.0000
2015-07-01
9439.34
None
0.0
28.0
2015-01-01
6.0
30.0
False
1.027552
1.027552
1
5.626808
620005
36241316
6225.0
36
16.49
220.37
D3
Painter
2.0
RENT
27000.00
Fully Paid
debt_consolidation
FL
18.58
0.0
2011-02-01
1.0
NaN
NaN
3.0
0.0
1756.0
97.60
4.0
7050.460000
6225.00
825.46
0.00
0.00
0.0000
2015-12-01
4858.17
None
0.0
NaN
2015-01-01
11.0
25.0
False
1.132604
1.132604
1
2.908522
620007
36421485
4000.0
36
8.67
126.59
B1
Lead Custodian
10.0
MORTGAGE
50000.00
Fully Paid
car
CA
12.63
0.0
2002-09-01
0.0
NaN
84.0
11.0
1.0
1700.0
5.60
30.0
4158.020000
4000.00
158.02
0.00
0.00
0.0000
2015-06-01
3655.51
None
0.0
NaN
2015-01-01
5.0
31.0
False
1.039505
1.039505
1
6.569271
620009
36260758
10850.0
36
19.24
399.04
E2
None
0.0
OWN
32000.00
Charged Off
debt_consolidation
OH
29.44
0.0
2002-06-01
1.0
65.0
NaN
9.0
0.0
6987.0
41.60
20.0
2396.050000
1405.77
990.28
0.00
0.00
0.0000
2015-08-01
25.00
None
0.0
NaN
2015-01-01
7.0
29.0
False
0.220834
0.220834
0
0.857791
209087 rows × 43 columns
In [34]:
feat_inform=feat_inform.query('purpose=="credit_card" | purpose=="debt_consolidation"')
feat_inform=feat_inform.query('home_ownership!="ANY" &home_ownership!="OTHER"& home_ownership!="NONE"')
In [35]:
%matplotlib inline
import matplotlib.pyplot as plt
plt.scatter(feat_inform.balance1,feat_inform.int_rate)
plt.show()
This scatterplot neatly shows the right edge created by loans paid in full and on schedule, increasing with loan rate. Interestingly, there appear to be no loans with rates much above 25% that are paid in full and on time.
In [36]:
feat_raw.query('int_rate> 28')
Out[36]:
id
loan_amnt
term
int_rate
installment
sub_grade
emp_title
emp_length
home_ownership
annual_inc
loan_status
purpose
addr_state
dti
delinq_2yrs
earliest_cr_line
inq_last_6mths
mths_since_last_delinq
mths_since_last_record
open_acc
pub_rec
revol_bal
revol_util
total_acc
total_pymnt
total_rec_prncp
total_rec_int
total_rec_late_fee
recoveries
collection_recovery_fee
last_pymnt_d
last_pymnt_amnt
next_pymnt_d
collections_12_mths_ex_med
mths_since_last_major_derog
issue_d
num_pymnts
pymnts_left
current
balance1
balance2
class_label
361979
66320245
9500.0
36
28.49
395.48
G4
Van Driver
10.0
RENT
29743.0
In Grace Period
medical
CA
24.46
0.0
1995-12-01
1.0
NaN
NaN
8.0
0.0
6909.0
33.9
10.0
0.00
0.00
0.00
0.00
0.0
0.0
NaT
0.00
Feb-2016
0.0
NaN
2015-12-01
NaN
0.0
False
0.000000
0.000000
0
447942
58563231
11975.0
36
28.99
501.76
G5
credit and collection specialist
8.0
MORTGAGE
60000.0
Late (31-120 days)
house
NJ
24.43
2.0
1994-02-01
4.0
15.0
NaN
21.0
0.0
4037.0
33.1
60.0
1553.49
652.91
900.58
0.00
0.0
0.0
2015-12-01
501.76
Feb-2016
0.0
18.0
2015-08-01
4.0
32.0
False
0.129728
0.129728
0
452438
57991149
6375.0
36
28.49
265.39
G4
factory worker
8.0
OWN
24000.0
Fully Paid
debt_consolidation
NJ
19.40
0.0
2007-07-01
0.0
NaN
NaN
6.0
0.0
13722.0
65.3
6.0
6727.76
6375.00
352.76
0.00
0.0
0.0
2015-10-01
6482.55
None
0.0
NaN
2015-08-01
2.0
34.0
False
1.055335
1.055335
1
453923
57950353
7200.0
36
28.49
299.73
G4
front end manager
3.0
RENT
24000.0
Fully Paid
house
WA
15.95
0.0
2009-12-01
1.0
NaN
NaN
12.0
0.0
897.0
8.5
15.0
7433.93
7200.00
233.93
0.00
0.0
0.0
2015-10-01
5645.33
None
0.0
NaN
2015-08-01
2.0
34.0
False
1.032490
1.032490
1
472451
56059424
13800.0
36
28.49
574.48
G4
mechanic
2.0
RENT
38400.0
Late (31-120 days)
debt_consolidation
CA
29.72
0.0
1989-02-01
1.0
NaN
NaN
6.0
0.0
15887.0
66.8
12.0
14895.66
13800.00
1066.94
28.72
0.0
0.0
2015-11-01
14364.86
Feb-2016
0.0
NaN
2015-07-01
4.0
32.0
False
1.079396
1.079396
0
490896
54393585
3875.0
36
28.49
161.32
G4
Production Assistant
9.0
OWN
20000.0
Fully Paid
house
CA
20.05
1.0
1996-12-01
2.0
6.0
NaN
9.0
0.0
439.0
25.8
11.0
3924.07
3875.00
49.07
0.00
0.0
0.0
2015-07-01
3936.34
None
0.0
NaN
2015-07-01
0.0
36.0
False
1.012663
1.012663
1
A lot of these loans are current, and all were issued in 2015. Potentially LC did not have loans with this high of a interest rate before 2015, so they are a bit of a wild card. They are mostly filtered out by the payment number filter above, which I think it fair.
Worth noting, a lot of the features in the dataset related to payments are clearly not available at the beginning of the loan, and therefore are not predictive when choosing new loans to fund. The metric also is highly correlated to the given rating and interest rate set by LC. Additionally, a lot of the other data is highly correlated.
In [37]:
feat_inform.columns.values
Out[37]:
array(['id', 'loan_amnt', 'term', 'int_rate', 'installment', 'sub_grade',
'emp_title', 'emp_length', 'home_ownership', 'annual_inc',
'loan_status', 'purpose', 'addr_state', 'dti', 'delinq_2yrs',
'earliest_cr_line', 'inq_last_6mths', 'mths_since_last_delinq',
'mths_since_last_record', 'open_acc', 'pub_rec', 'revol_bal',
'revol_util', 'total_acc', 'total_pymnt', 'total_rec_prncp',
'total_rec_int', 'total_rec_late_fee', 'recoveries',
'collection_recovery_fee', 'last_pymnt_d', 'last_pymnt_amnt',
'next_pymnt_d', 'collections_12_mths_ex_med',
'mths_since_last_major_derog', 'issue_d', 'num_pymnts',
'pymnts_left', 'current', 'balance1', 'balance2', 'class_label',
'excess_pymnt'], dtype=object)
In [38]:
import seaborn as sns
corr=data.corr()
sns.heatmap(corr)
#g=sns.pairplot(data)
Out[38]:
<matplotlib.axes._subplots.AxesSubplot at 0x1257185c0>
Looking at the raw data, some of the correlations are obvious: loan amount, funding amount, and installment are closely tied (or identical). the payment information is highly correlated with itself as well as the funding amounts. delinquencies and records are correlated, balance amounts are correlated.
Looking at the feature data, there are still correlations - mostly due to payment info, and info that will not be attached to new loans. I will create my final feature set below based on the corr map and data dictionary.
In [39]:
corr=feat_inform.corr()
sns.heatmap(corr)
Out[39]:
<matplotlib.axes._subplots.AxesSubplot at 0x124cf6550>
Interestingly you can get an idea of what numeric (I find them to be continuous as well) values are correlated with the given interest rate: mainly inquiries, delinquincies, dti, and public records; as well as annual income and total accounts with a negative corr. What is tricky are the 'months since last __' features, as they include a bunch of NaNs, indicating no issues. NaNs can be tricky with ML algos, and beyond setting NaNs to a large number (like 1200 months, or 100 years), it would be hard to work around them. To be safe and simple, I will exclude them from my final features, but if I am unsatisfied I may find a way to include them.
In [40]:
keepfeat=['sub_grade','loan_amnt', 'emp_title', 'emp_length', 'home_ownership',
'annual_inc','purpose',
'addr_state', 'dti', 'delinq_2yrs', 'earliest_cr_line',
'inq_last_6mths','open_acc', 'pub_rec', 'revol_bal',
'revol_util', 'total_acc','collections_12_mths_ex_med']
features=feat_inform[keepfeat]
In [41]:
corr=features.corr()
g=sns.heatmap(corr)
In [42]:
sns.set(style="ticks", color_codes=True)
g=sns.pairplot(features,vars=['loan_amnt' ,'open_acc', 'dti','collections_12_mths_ex_med'])
In [43]:
features.isnull().sum()
Out[43]:
sub_grade 0
loan_amnt 0
emp_title 9139
emp_length 0
home_ownership 0
annual_inc 0
purpose 0
addr_state 0
dti 0
delinq_2yrs 0
earliest_cr_line 0
inq_last_6mths 0
open_acc 0
pub_rec 0
revol_bal 0
revol_util 0
total_acc 0
collections_12_mths_ex_med 0
dtype: int64
One last thing, check those nulls in emp title, they should be "None". This is fine, as it can be its own category when they are one hot encoded!
In [44]:
features.query('emp_title!=emp_title')
Out[44]:
sub_grade
loan_amnt
emp_title
emp_length
home_ownership
annual_inc
purpose
addr_state
dti
delinq_2yrs
earliest_cr_line
inq_last_6mths
open_acc
pub_rec
revol_bal
revol_util
total_acc
collections_12_mths_ex_med
0
B2
5000.0
None
10.0
RENT
24000.0
credit_card
AZ
27.65
0.0
1985-01-01
1.0
3.0
0.0
13648.0
83.7
9.0
0.0
22
A3
4375.0
None
7.0
MORTGAGE
17108.0
debt_consolidation
NY
20.34
0.0
1987-12-01
0.0
6.0
0.0
11210.0
86.9
12.0
0.0
125
A3
2500.0
None
0.0
OWN
12000.0
debt_consolidation
CA
16.30
0.0
1994-08-01
2.0
13.0
0.0
4853.0
42.2
20.0
0.0
140
B2
9000.0
None
9.0
MORTGAGE
74000.0
credit_card
SD
8.89
0.0
1998-09-01
0.0
7.0
0.0
7388.0
71.7
10.0
0.0
150
C1
20000.0
None
6.0
RENT
75000.0
debt_consolidation
CA
22.38
0.0
1998-11-01
1.0
7.0
0.0
19548.0
90.8
17.0
0.0
185
C1
6000.0
None
5.0
MORTGAGE
50000.0
debt_consolidation
NM
15.58
0.0
2003-05-01
1.0
8.0
0.0
7361.0
83.6
14.0
0.0
205
B3
7000.0
None
2.0
RENT
75000.0
debt_consolidation
CA
15.57
0.0
2001-01-01
0.0
7.0
0.0
22196.0
94.1
17.0
0.0
222
B1
10400.0
None
6.0
RENT
40000.0
debt_consolidation
FL
11.67
0.0
1999-10-01
2.0
7.0
0.0
11624.0
80.6
19.0
0.0
330
A5
7000.0
None
1.0
RENT
46000.0
credit_card
VA
7.90
0.0
2002-08-01
1.0
7.0
0.0
8717.0
76.5
18.0
0.0
332
A3
8250.0
None
0.0
MORTGAGE
31500.0
debt_consolidation
MD
17.87
0.0
1981-12-01
4.0
17.0
0.0
7521.0
10.4
37.0
0.0
360
A5
3600.0
None
10.0
RENT
55000.0
debt_consolidation
NY
5.48
0.0
2002-06-01
0.0
8.0
0.0
9550.0
65.9
18.0
0.0
410
B2
6200.0
None
10.0
MORTGAGE
24000.0
credit_card
AK
19.95
0.0
2001-10-01
1.0
10.0
0.0
18210.0
55.2
11.0
0.0
424
D4
8575.0
None
0.0
MORTGAGE
32000.0
debt_consolidation
FL
22.54
0.0
2004-09-01
1.0
4.0
0.0
20142.0
89.9
5.0
0.0
431
A5
8000.0
None
3.0
MORTGAGE
120000.0
credit_card
CA
10.52
0.0
2000-10-01
0.0
10.0
0.0
13268.0
60.6
15.0
0.0
493
B4
10700.0
None
4.0
RENT
68000.0
debt_consolidation
AZ
16.41
0.0
2005-09-01
1.0
7.0
0.0
5192.0
66.6
12.0
0.0
557
B4
14125.0
None
0.0
MORTGAGE
45696.0
debt_consolidation
NC
21.93
0.0
2000-08-01
0.0
10.0
0.0
15831.0
91.5
26.0
0.0
571
C3
10500.0
None
1.0
MORTGAGE
42000.0
debt_consolidation
GA
10.77
0.0
2002-03-01
2.0
7.0
0.0
16705.0
52.2
23.0
0.0
620
B5
12000.0
None
2.0
RENT
60000.0
credit_card
CT
18.38
0.0
2005-03-01
0.0
6.0
0.0
16464.0
89.5
6.0
0.0
629
B4
17050.0
None
10.0
MORTGAGE
53000.0
debt_consolidation
GA
23.64
0.0
1995-09-01
1.0
8.0
0.0
17414.0
59.4
28.0
0.0
637
B2
30000.0
None
7.0
MORTGAGE
175000.0
debt_consolidation
TX
17.15
0.0
1993-10-01
1.0
12.0
0.0
26103.0
56.9
47.0
0.0
716
B4
4000.0
None
7.0
RENT
100000.0
credit_card
NY
9.60
0.0
2002-06-01
3.0
15.0
0.0
12710.0
54.9
39.0
0.0
717
B4
15000.0
None
0.0
RENT
60000.0
debt_consolidation
WA
14.18
0.0
1993-08-01
0.0
8.0
0.0
15451.0
72.5
19.0
0.0
779
A1
12000.0
None
0.0
OWN
40000.0
credit_card
GA
18.75
0.0
1981-06-01
0.0
10.0
0.0
20899.0
51.1
25.0
0.0
780
D3
15000.0
None
0.0
OWN
57000.0
debt_consolidation
CA
12.08
0.0
2006-09-01
1.0
13.0
0.0
16549.0
89.0
13.0
0.0
791
A4
18000.0
None
10.0
MORTGAGE
60000.0
debt_consolidation
SD
21.22
0.0
1996-09-01
0.0
12.0
0.0
27390.0
71.5
28.0
0.0
794
C4
11100.0
None
6.0
RENT
45000.0
debt_consolidation
NY
4.64
0.0
1996-12-01
1.0
3.0
0.0
9866.0
95.8
9.0
0.0
799
C5
8500.0
None
0.0
RENT
27050.0
credit_card
GA
10.25
0.0
2005-10-01
3.0
7.0
0.0
5956.0
62.7
10.0
0.0
806
A5
6000.0
None
5.0
RENT
24000.0
credit_card
FL
11.55
0.0
2000-02-01
0.0
4.0
0.0
7186.0
88.7
9.0
0.0
818
C4
4000.0
None
0.0
OWN
25000.0
debt_consolidation
TX
12.62
0.0
2003-01-01
1.0
5.0
0.0
5550.0
91.0
9.0
0.0
822
B3
3000.0
None
3.0
RENT
55000.0
credit_card
IL
9.75
0.0
2001-05-01
0.0
12.0
0.0
11679.0
92.7
19.0
0.0
871
A4
5000.0
None
0.0
RENT
30000.0
debt_consolidation
MA
12.64
0.0
1999-02-01
0.0
7.0
0.0
11277.0
94.8
14.0
0.0
889
A5
1400.0
None
0.0
MORTGAGE
30108.0
debt_consolidation
MI
20.29
0.0
1986-10-01
1.0
8.0
0.0
3344.0
33.4
40.0
0.0
906
B2
9250.0
None
0.0
OWN
20000.0
debt_consolidation
PA
9.18
0.0
2001-04-01
0.0
4.0
1.0
3772.0
48.4
12.0
0.0
917
C1
20000.0
None
5.0
RENT
140000.0
credit_card
NY
7.89
0.0
1992-11-01
1.0
11.0
0.0
20631.0
75.0
35.0
0.0
931
B5
7200.0
None
0.0
MORTGAGE
45000.0
credit_card
CA
11.39
0.0
1994-08-01
2.0
8.0
0.0
19331.0
76.4
18.0
0.0
936
A2
6000.0
None
5.0
RENT
24000.0
debt_consolidation
FL
7.20
0.0
1999-11-01
1.0
5.0
0.0
3238.0
33.0
22.0
0.0
941
B4
5325.0
None
0.0
RENT
22000.0
credit_card
CA
12.55
0.0
2002-06-01
0.0
7.0
0.0
8766.0
88.5
14.0
0.0
948
A3
12000.0
None
0.0
MORTGAGE
60000.0
debt_consolidation
AZ
5.66
0.0
1988-07-01
1.0
8.0
0.0
13725.0
40.7
12.0
0.0
960
D1
1600.0
None
8.0
RENT
30000.0
debt_consolidation
VT
16.84
1.0
1997-11-01
0.0
9.0
0.0
6029.0
90.0
18.0
0.0
967
B1
20000.0
None
10.0
MORTGAGE
210000.0
debt_consolidation
NY
17.86
0.0
1987-12-01
3.0
7.0
0.0
130920.0
90.3
25.0
0.0
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
615363
B2
15000.0
None
0.0
RENT
50000.0
credit_card
IL
12.03
2.0
1995-04-01
1.0
13.0
1.0
7610.0
33.8
35.0
0.0
615376
A5
2800.0
None
0.0
RENT
25350.0
debt_consolidation
CA
6.01
0.0
2002-11-01
2.0
14.0
1.0
4206.0
13.1
28.0
0.0
615406
A3
12000.0
None
0.0
MORTGAGE
52000.0
credit_card
NC
18.97
0.0
1976-05-01
0.0
21.0
0.0
19884.0
10.7
35.0
0.0
615416
A3
19000.0
None
0.0
MORTGAGE
48000.0
debt_consolidation
WA
16.43
0.0
1977-05-01
0.0
12.0
0.0
7892.0
15.8
40.0
0.0
615480
C4
5000.0
None
0.0
RENT
24000.0
debt_consolidation
CT
7.20
2.0
1993-10-01
0.0
9.0
1.0
4422.0
48.1
18.0
0.0
615484
B1
12000.0
None
0.0
RENT
65000.0
credit_card
GA
13.66
0.0
1999-07-01
1.0
10.0
1.0
13945.0
73.0
19.0
0.0
615494
B2
7000.0
None
0.0
MORTGAGE
27600.0
credit_card
CO
20.39
0.0
2000-07-01
0.0
9.0
1.0
10482.0
59.2
19.0
0.0
615524
C4
3375.0
None
0.0
RENT
8580.0
debt_consolidation
NY
27.55
0.0
1983-11-01
0.0
11.0
1.0
2518.0
15.6
33.0
0.0
615592
B4
7575.0
None
0.0
RENT
16000.0
credit_card
SC
27.46
0.0
1998-04-01
0.0
5.0
0.0
7069.0
57.5
7.0
0.0
615662
C4
10000.0
None
0.0
RENT
42200.0
debt_consolidation
NY
24.23
0.0
2001-07-01
1.0
16.0
0.0
11072.0
40.7
31.0
0.0
615889
C2
17000.0
None
0.0
MORTGAGE
66000.0
credit_card
PA
14.33
0.0
2000-09-01
0.0
8.0
0.0
17084.0
53.1
14.0
0.0
615916
C4
6000.0
None
0.0
MORTGAGE
36500.0
debt_consolidation
GA
20.12
1.0
1999-11-01
1.0
7.0
1.0
3299.0
55.0
26.0
0.0
615967
D3
27200.0
None
0.0
MORTGAGE
88000.0
debt_consolidation
NY
19.07
0.0
1989-03-01
1.0
16.0
0.0
36569.0
79.0
36.0
0.0
616209
B3
20500.0
None
0.0
MORTGAGE
76464.0
credit_card
NJ
16.46
1.0
1991-09-01
0.0
8.0
0.0
17430.0
90.8
17.0
0.0
616346
C2
7000.0
None
0.0
OWN
20000.0
debt_consolidation
HI
16.85
0.0
2007-09-01
1.0
11.0
0.0
746.0
4.6
14.0
0.0
616504
C4
8000.0
None
0.0
RENT
30189.0
debt_consolidation
CO
30.89
0.0
1993-06-01
3.0
24.0
0.0
13197.0
55.9
44.0
0.0
616670
B5
11000.0
None
0.0
MORTGAGE
44154.0
debt_consolidation
AZ
10.93
0.0
2001-05-01
1.0
10.0
0.0
10762.0
75.3
18.0
0.0
616720
C1
10000.0
None
0.0
OWN
35800.0
debt_consolidation
TX
17.72
1.0
2002-06-01
1.0
11.0
0.0
3463.0
35.7
23.0
0.0
616751
C5
4000.0
None
0.0
RENT
18000.0
credit_card
CA
28.00
0.0
2011-09-01
1.0
5.0
0.0
5140.0
71.4
6.0
0.0
616874
D5
7175.0
None
0.0
MORTGAGE
40000.0
debt_consolidation
CT
24.54
2.0
2003-08-01
1.0
12.0
1.0
3048.0
22.2
28.0
0.0
616971
C4
10000.0
None
0.0
OWN
30000.0
debt_consolidation
CA
17.28
0.0
2004-08-01
0.0
7.0
1.0
803.0
13.2
18.0
1.0
617158
A3
10325.0
None
0.0
MORTGAGE
36958.0
debt_consolidation
FL
19.32
0.0
1983-04-01
0.0
17.0
0.0
5729.0
14.4
43.0
0.0
617223
C4
5000.0
None
0.0
OWN
32000.0
credit_card
MO
29.59
0.0
2002-01-01
2.0
9.0
0.0
10751.0
35.7
23.0
0.0
617231
A5
5000.0
None
0.0
RENT
70000.0
debt_consolidation
FL
18.29
1.0
2000-04-01
1.0
19.0
1.0
4098.0
15.3
43.0
0.0
617333
C2
9450.0
None
0.0
RENT
50000.0
debt_consolidation
NC
34.80
0.0
1983-04-01
0.0
15.0
0.0
23234.0
61.0
32.0
0.0
617442
D4
16600.0
None
0.0
RENT
50000.0
debt_consolidation
FL
27.38
0.0
2010-10-01
0.0
6.0
0.0
3571.0
81.2
7.0
0.0
617525
E2
16075.0
None
0.0
MORTGAGE
61000.0
debt_consolidation
LA
22.49
0.0
1997-07-01
2.0
9.0
0.0
7155.0
95.4
65.0
0.0
617569
B1
3500.0
None
0.0
OWN
30000.0
debt_consolidation
TX
20.96
0.0
1972-04-01
0.0
10.0
0.0
16301.0
62.0
11.0
0.0
617610
D2
1000.0
None
0.0
RENT
60000.0
debt_consolidation
OR
15.94
0.0
2005-08-01
1.0
9.0
1.0
518.0
5.1
29.0
0.0
617672
D1
15000.0
None
0.0
RENT
62000.0
debt_consolidation
DC
21.23
0.0
2007-06-01
1.0
10.0
0.0
12894.0
65.8
19.0
0.0
617697
C2
9000.0
None
0.0
MORTGAGE
45000.0
debt_consolidation
AZ
7.23
0.0
1999-02-01
5.0
10.0
4.0
6315.0
27.0
28.0
0.0
617721
B4
5000.0
None
0.0
OWN
37500.0
debt_consolidation
RI
19.65
1.0
1998-02-01
0.0
12.0
0.0
9205.0
40.2
22.0
0.0
617759
E5
9250.0
None
0.0
MORTGAGE
27383.0
debt_consolidation
AL
33.98
0.0
1999-03-01
0.0
13.0
0.0
19213.0
84.3
22.0
0.0
617828
D1
15000.0
None
0.0
RENT
49900.0
debt_consolidation
NY
31.12
0.0
1992-04-01
3.0
18.0
0.0
18282.0
63.3
26.0
0.0
618463
C3
12000.0
None
0.0
MORTGAGE
48000.0
debt_consolidation
PA
18.28
0.0
1997-07-01
2.0
11.0
1.0
15016.0
49.7
32.0
0.0
619282
D1
9600.0
None
0.0
OWN
23000.0
credit_card
IL
22.70
0.0
1993-04-01
1.0
6.0
1.0
8090.0
55.8
16.0
0.0
619755
A3
18000.0
None
0.0
RENT
46500.0
debt_consolidation
IL
16.59
0.0
2005-01-01
0.0
9.0
0.0
110.0
0.8
22.0
0.0
619878
E4
7125.0
None
0.0
OWN
17000.0
credit_card
FL
29.04
0.0
2001-10-01
3.0
9.0
1.0
4129.0
38.6
19.0
0.0
619971
D5
2725.0
None
0.0
MORTGAGE
47784.0
debt_consolidation
FL
14.69
1.0
2001-12-01
1.0
10.0
1.0
1963.0
33.8
18.0
0.0
620009
E2
10850.0
None
0.0
OWN
32000.0
debt_consolidation
OH
29.44
0.0
2002-06-01
1.0
9.0
0.0
6987.0
41.6
20.0
0.0
9139 rows × 18 columns
In [45]:
labels=pd.DataFrame
classlabels=pd.DataFrame
labels=feat_inform['balance1']
classlabels=feat_inform['class_label']
In [46]:
labels
Out[46]:
0 1.172214
5 1.161923
6 0.252300
7 1.159661
9 1.270171
13 1.028257
14 0.667876
15 1.190256
16 1.153631
18 1.054899
19 0.000000
20 1.121198
21 1.190848
22 1.119667
23 1.096185
24 1.142918
25 1.264134
26 1.172376
28 1.110840
29 1.187547
31 1.126365
33 1.278839
34 1.010977
36 1.004274
38 1.028267
39 1.105216
40 1.078518
41 1.159985
42 1.172211
44 1.145684
45 1.147476
46 1.057594
47 1.278780
48 1.283408
49 1.172334
50 1.106405
51 1.237493
52 0.746320
53 1.082267
54 1.278872
...
619755 0.153587
619762 1.082765
619766 1.092462
619771 1.090242
619778 1.066983
619781 1.120232
619785 0.312862
619790 1.110429
619810 0.363978
619814 0.336371
619822 1.004657
619826 0.398615
619830 0.267212
619841 1.051029
619843 1.055844
619844 0.229998
619845 1.103255
619858 1.031935
619865 0.223685
619871 1.044527
619875 1.029352
619878 0.299029
619898 1.082966
619902 1.095670
619910 1.054243
619920 0.312864
619932 0.332640
619936 0.240962
619943 1.094774
619950 0.336698
619952 1.142157
619953 0.347833
619968 0.250593
619971 0.216840
619985 1.078031
619992 0.312863
619993 1.077563
620003 1.027552
620005 1.132604
620009 0.220834
Name: balance1, dtype: float64
In [47]:
import joblib
joblib.dump(features,'clean_LCfeatures.p')
joblib.dump(labels,'clean_LClabels.p')
joblib.dump(classlabels,'clean_LCclassifierlabel.p')
Out[47]:
['clean_LCclassifierlabel.p']
In [48]:
feat_inform.describe()
Out[48]:
loan_amnt
term
int_rate
installment
emp_length
annual_inc
dti
delinq_2yrs
inq_last_6mths
mths_since_last_delinq
mths_since_last_record
open_acc
pub_rec
revol_bal
revol_util
total_acc
total_pymnt
total_rec_prncp
total_rec_int
total_rec_late_fee
recoveries
collection_recovery_fee
last_pymnt_amnt
collections_12_mths_ex_med
mths_since_last_major_derog
num_pymnts
pymnts_left
balance1
balance2
class_label
excess_pymnt
count
162960.000000
162960.0
162960.000000
162960.000000
162960.000000
1.629600e+05
162960.000000
162960.000000
162960.000000
73148.000000
21786.000000
162960.000000
162960.000000
1.629600e+05
162960.000000
162960.00000
162960.000000
162960.000000
162960.000000
162960.000000
162960.000000
162960.000000
162960.000000
162960.000000
33015.000000
162578.000000
162960.000000
162960.000000
162960.000000
162960.000000
1.629600e+05
mean
12567.071060
36.0
12.735522
422.174604
5.536331
6.941628e+04
17.094275
0.257444
0.798251
35.268360
75.619985
11.066605
0.154885
1.494061e+04
56.284744
24.82330
12511.566468
10817.366101
1602.411008
0.780103
91.009261
9.966185
5301.222845
0.007388
43.628108
17.095591
18.860095
0.995219
0.995219
0.798270
inf
std
7268.238624
0.0
3.683862
247.521399
3.669860
6.174766e+04
7.648075
0.764867
1.025866
21.787639
29.079043
4.856109
0.454758
1.734485e+04
23.310834
11.59762
8421.032511
7509.935571
1448.808200
5.766119
514.319545
86.148434
5975.523003
0.094495
21.692331
10.777441
10.803552
0.297402
0.297402
0.401293
NaN
min
700.000000
36.0
5.320000
22.510000
0.000000
4.080000e+03
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000e+00
0.000000
2.00000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
-34.000000
0.000000
0.000000
0.000000
0.000000e+00
25%
7200.000000
36.0
10.150000
245.160000
2.000000
4.235700e+04
11.340000
0.000000
0.000000
17.000000
55.000000
8.000000
0.000000
6.334750e+03
39.400000
16.00000
6357.955000
5200.000000
621.847500
0.000000
0.000000
0.000000
456.620000
0.000000
26.000000
8.000000
11.000000
1.026315
1.026315
1.000000
1.000000e+00
50%
10575.000000
36.0
12.850000
360.380000
5.000000
6.000000e+04
16.690000
0.000000
0.000000
32.000000
78.000000
10.000000
0.000000
1.099050e+04
57.400000
23.00000
10856.960000
9600.000000
1213.720000
0.000000
0.000000
0.000000
3497.520000
0.000000
43.000000
15.000000
21.000000
1.096713
1.096713
1.000000
1.717166e+00
75%
16000.000000
36.0
15.230000
541.810000
10.000000
8.400000e+04
22.440000
0.000000
1.000000
51.000000
101.000000
14.000000
0.000000
1.851125e+04
74.500000
32.00000
16761.797500
15000.000000
2132.165000
0.000000
0.000000
0.000000
8107.102500
0.000000
61.000000
25.000000
28.000000
1.162133
1.162133
1.000000
3.122675e+00
max
35000.000000
36.0
28.490000
1424.570000
10.000000
8.900060e+06
39.990000
29.000000
8.000000
152.000000
129.000000
76.000000
15.000000
1.743266e+06
892.300000
118.00000
49978.687781
35000.020000
16602.700000
294.680000
31900.520000
7002.190000
36188.840000
6.000000
159.000000
70.000000
36.000000
1.522311
1.522311
1.000000
inf
In [49]:
feat_inform.query('class_label==1').describe()
Out[49]:
loan_amnt
term
int_rate
installment
emp_length
annual_inc
dti
delinq_2yrs
inq_last_6mths
mths_since_last_delinq
mths_since_last_record
open_acc
pub_rec
revol_bal
revol_util
total_acc
total_pymnt
total_rec_prncp
total_rec_int
total_rec_late_fee
recoveries
collection_recovery_fee
last_pymnt_amnt
collections_12_mths_ex_med
mths_since_last_major_derog
num_pymnts
pymnts_left
balance1
balance2
class_label
excess_pymnt
count
130086.000000
130086.0
130086.000000
130086.000000
130086.000000
1.300860e+05
130086.000000
130086.000000
130086.000000
57608.000000
16891.000000
130086.000000
130086.000000
1.300860e+05
130086.000000
130086.000000
130086.000000
130086.000000
130086.000000
130086.000000
130086.0
130086.0
130086.000000
130086.000000
25275.000000
130086.000000
130086.000000
130086.000000
130086.000000
130086.0
1.300860e+05
mean
12549.847409
36.0
12.362191
419.291340
5.595798
7.107115e+04
16.603720
0.241448
0.775441
35.667893
75.640223
11.032609
0.148533
1.513643e+04
55.265404
25.054064
14151.448831
12532.587633
1618.556307
0.304897
0.0
0.0
6526.780219
0.006503
43.687478
18.034677
17.965323
1.126780
1.126780
1.0
inf
std
7225.967110
0.0
3.611199
244.601934
3.653889
5.625120e+04
7.486221
0.730637
1.011112
21.706118
29.169557
4.818621
0.441061
1.781933e+04
23.442999
11.597379
8268.084573
7227.083159
1461.600690
3.456548
0.0
0.0
6099.918680
0.089607
21.592163
11.175401
11.175401
0.079349
0.079349
0.0
NaN
min
700.000000
36.0
5.320000
22.510000
0.000000
4.800000e+03
0.000000
0.000000
0.000000
0.000000
0.000000
1.000000
0.000000
0.000000e+00
0.000000
2.000000
0.000000
0.000000
0.000000
0.000000
0.0
0.0
0.000000
0.000000
0.000000
0.000000
-34.000000
0.000000
0.000000
1.0
0.000000e+00
25%
7200.000000
36.0
9.670000
243.480000
2.000000
4.500000e+04
10.980000
0.000000
0.000000
17.000000
55.000000
8.000000
0.000000
6.384000e+03
38.200000
17.000000
8141.717500
7200.000000
628.970000
0.000000
0.0
0.0
1520.572500
0.000000
27.000000
9.000000
9.000000
1.071670
1.071670
1.0
1.317724e+00
50%
10625.000000
36.0
12.350000
360.080000
5.000000
6.000200e+04
16.170000
0.000000
0.000000
33.000000
78.000000
10.000000
0.000000
1.110200e+04
56.200000
23.000000
12212.643513
10625.000000
1226.175000
0.000000
0.0
0.0
5199.690000
0.000000
43.000000
16.000000
20.000000
1.119886
1.119886
1.0
2.110896e+00
75%
16000.000000
36.0
14.640000
539.395000
10.000000
8.500000e+04
21.810000
0.000000
1.000000
52.000000
101.000000
14.000000
0.000000
1.873600e+04
73.500000
32.000000
18244.035070
16000.000000
2150.647500
0.000000
0.0
0.0
9413.387500
0.000000
60.000000
27.000000
27.000000
1.178824
1.178824
1.0
3.663192e+00
max
35000.000000
36.0
28.490000
1409.990000
10.000000
7.141778e+06
39.990000
29.000000
8.000000
151.000000
121.000000
58.000000
15.000000
1.743266e+06
892.300000
118.000000
49978.687781
35000.020000
14978.690000
286.747566
0.0
0.0
36188.840000
6.000000
159.000000
70.000000
36.000000
1.522311
1.522311
1.0
inf
In [50]:
feat_inform.query('class_label==0').describe()
Out[50]:
loan_amnt
term
int_rate
installment
emp_length
annual_inc
dti
delinq_2yrs
inq_last_6mths
mths_since_last_delinq
mths_since_last_record
open_acc
pub_rec
revol_bal
revol_util
total_acc
total_pymnt
total_rec_prncp
total_rec_int
total_rec_late_fee
recoveries
collection_recovery_fee
last_pymnt_amnt
collections_12_mths_ex_med
mths_since_last_major_derog
num_pymnts
pymnts_left
balance1
balance2
class_label
excess_pymnt
count
32874.000000
32874.0
32874.000000
32874.000000
32874.000000
3.287400e+04
32874.000000
32874.000000
32874.000000
15540.000000
4895.000000
32874.000000
32874.000000
32874.000000
32874.000000
32874.000000
32874.000000
32874.000000
32874.000000
32874.000000
32874.000000
32874.000000
32874.000000
32874.000000
7740.000000
32492.000000
32874.000000
32874.000000
32874.000000
32874.0
3.287400e+04
mean
12635.226927
36.0
14.212833
433.583992
5.301013
6.286778e+04
19.035456
0.320740
0.888514
33.787259
75.550153
11.201132
0.180021
14165.716615
60.318387
23.910142
6022.373274
4030.047610
1538.522301
2.660542
451.142821
49.403467
451.558779
0.010890
43.434238
13.335837
22.400803
0.474622
0.474622
0.0
inf
std
7432.874589
0.0
3.596503
258.439712
3.723140
7.953434e+04
7.966653
0.884642
1.077566
22.024778
28.767374
4.999504
0.504554
15299.542002
22.328826
11.553632
5316.409586
3896.772821
1395.228895
10.635284
1071.836027
186.659960
547.762634
0.111693
22.016550
7.969428
8.286942
0.272062
0.272062
0.0
NaN
min
1000.000000
36.0
5.320000
30.710000
0.000000
4.080000e+03
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
2.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
-16.000000
0.000000
0.000000
0.0
0.000000e+00
25%
7325.000000
36.0
11.990000
252.480000
2.000000
3.800000e+04
13.112500
0.000000
0.000000
15.000000
55.000000
8.000000
0.000000
6159.250000
44.500000
15.000000
2328.727500
1368.437500
595.267500
0.000000
0.000000
0.000000
236.620000
0.000000
25.000000
7.000000
17.000000
0.263937
0.263937
0.0
9.876071e-01
50%
10375.000000
36.0
14.090000
362.725000
5.000000
5.300000e+04
18.900000
0.000000
1.000000
30.000000
78.000000
10.000000
0.000000
10601.000000
61.700000
22.000000
4532.185000
2866.460000
1161.680000
0.000000
0.000000
0.000000
356.280000
0.000000
43.000000
12.000000
24.000000
0.435581
0.435581
0.0
1.000000e+00
75%
16000.000000
36.0
16.550000
550.660000
10.000000
7.500000e+04
24.760000
0.000000
1.000000
50.000000
100.000000
14.000000
0.000000
17654.000000
77.800000
30.000000
8087.677500
5396.092500
2037.165000
0.000000
514.382500
6.852025
553.800000
0.000000
61.000000
18.000000
29.000000
0.654232
0.654232
0.0
1.084464e+00
max
35000.000000
36.0
28.490000
1424.570000
10.000000
8.900060e+06
39.950000
21.000000
8.000000
152.000000
129.000000
76.000000
9.000000
654134.000000
141.100000
112.000000
44062.890000
34483.270000
16602.700000
294.680000
31900.520000
7002.190000
34833.350000
4.000000
152.000000
52.000000
36.000000
1.341594
1.341594
0.0
inf
In [51]:
intrate=feat_inform.groupby('sub_grade').int_rate.mean()
In [52]:
defaultrate=feat_inform.groupby('sub_grade').class_label.mean()
In [53]:
%matplotlib inline
plt.plot(intrate[0:29],defaultrate[0:29])
plt.show()
In [54]:
intrate,defaultrate
Out[54]:
(sub_grade
A1 5.970017
A2 6.538729
A3 7.406936
A4 7.771233
A5 8.627672
B1 9.670348
B2 10.684016
B3 11.660315
B4 12.461510
B5 13.017239
C1 13.570876
C2 14.164827
C3 14.673749
C4 15.243976
C5 15.867740
D1 16.655523
D2 17.345837
D3 17.737749
D4 18.238910
D5 18.776561
E1 19.117309
E2 19.782724
E3 20.243106
E4 21.028102
E5 21.853750
F1 22.539137
F2 22.988647
F3 23.859950
F4 23.875806
F5 24.262394
G1 24.698333
G2 24.757500
G3 23.851000
G4 24.120000
G5 23.896000
Name: int_rate, dtype: float64, sub_grade
A1 0.955605
A2 0.929143
A3 0.919470
A4 0.906231
A5 0.887125
B1 0.865450
B2 0.854789
B3 0.840879
B4 0.824832
B5 0.801634
C1 0.782131
C2 0.767573
C3 0.734156
C4 0.721569
C5 0.719203
D1 0.700364
D2 0.686492
D3 0.688192
D4 0.657415
D5 0.646336
E1 0.637232
E2 0.598765
E3 0.614728
E4 0.597907
E5 0.558712
F1 0.565495
F2 0.613527
F3 0.470297
F4 0.532258
F5 0.366197
G1 0.500000
G2 0.500000
G3 0.400000
G4 0.900000
G5 0.700000
Name: class_label, dtype: float64)
In [ ]:
Content source: mccormd1/LCandR
Similar notebooks: