以 Python 進行信用風險建模
Michael Crabtree
Data Scientist, Ford Motor Company
離群值可能的成因:
離群值可能的成因:
| 特徵 | 含離群值的係數 | 不含離群值的係數 |
|---|---|---|
| Interest Rate | 0.2 | 0.01 |
| Employment Length | 0.5 | 0.6 |
| Income | 0.6 | 0.75 |
pd.crosstab(cr_loan['person_home_ownership'], cr_loan['loan_status'],
values=cr_loan['loan_int_rate'], aggfunc='mean').round(2)
視覺化偵測離群值
.drop() 方法indices = cr_loan[cr_loan['person_emp_length'] >= 60].index
cr_loan.drop(indices, inplace=True)
以 Python 進行信用風險建模