Python में क्रेडिट रिस्क मॉडलिंग
Michael Crabtree
Data Scientist, Ford Motor Company
''| Missing Data Type | Possible Result |
|---|---|
| NULL in numeric column | Error |
| NULL in string column | Error |
| Missing Data | Interpretation | Action |
|---|---|---|
NULL in loan_status |
लोन हाल ही में अप्रूव हुआ | prediction डेटा से हटाएँ |
NULL in person_age |
उम्र दर्ज/प्रकट नहीं | median से replace करें |
isnull() फंक्शन से null values आसानी से मिलती हैंsum() फंक्शन से null records की गिनती हो जाती है.any() मेथड सभी कॉलम जाँचता हैnull_columns = cr_loan.columns[cr_loan.isnull().any()]
cr_loan[null_columns].isnull().sum()
# Total number of null values per column
person_home_ownership 25
person_emp_length 895
loan_intent 25
loan_int_rate 3140
cb_person_default_on_file 15
.fillna() जैसी विधियों से मिसिंग डेटा replace करेंcr_loan['loan_int_rate'].fillna((cr_loan['loan_int_rate'].mean()), inplace = True)
.drop() मेथड से records को पूरी तरह हटा देंindices = cr_loan[cr_loan['person_emp_length'].isnull()].index
cr_loan.drop(indices, inplace=True)
Python में क्रेडिट रिस्क मॉडलिंग