{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Credit Card Default Prediction"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Delinquent in general is a slightly mild term where a borrower is not repaying charges and is behind by certain months whereas Default is a term where a borrower has not been able to pay charges and is behind for a long period of months and is unlikely to repay the charges.\n",
"\n",
"This case study is about identifying the borrowers who are likely to default in the next two years with serious delinquency of having delinquent more than 3 months.\n",
"\n",
"##### Objective\n",
"Building a model using the inputs/attributes which are general profile and historical records of a borrower to predict whether one is likely to have serious delinquency in the next 2 years"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Import Libraries"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"import plotly.express as px\n",
"import plotly.graph_objs as go\n",
"\n",
"from sklearn.compose import ColumnTransformer\n",
"from sklearn.pipeline import Pipeline\n",
"from sklearn.preprocessing import StandardScaler, OneHotEncoder\n",
"from sklearn.impute import SimpleImputer\n",
"from sklearn.model_selection import train_test_split, GridSearchCV\n",
"from sklearn.metrics import accuracy_score, roc_auc_score, f1_score, recall_score, precision_score, classification_report, confusion_matrix, roc_curve, auc\n",
"\n",
"from sklearn.linear_model import LogisticRegression\n",
"from sklearn.svm import SVC\n",
"from sklearn.tree import DecisionTreeClassifier\n",
"from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier\n",
"from xgboost import XGBClassifier\n",
"from lightgbm import LGBMClassifier\n",
"\n",
"from imblearn.over_sampling import SMOTE\n",
"from imblearn.under_sampling import RandomUnderSampler\n",
"\n",
"\n",
"# Ignore all warnings\n",
"import warnings\n",
"warnings.filterwarnings('ignore')\n",
"warnings.filterwarnings(action='ignore', category=DeprecationWarning)\n",
"\n",
"# Display all rows and columns of a dataframe \n",
"from IPython.display import display\n",
"pd.set_option('display.max_columns', None)\n",
"pd.set_option('display.max_rows', None)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Load Data"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n", " | Unnamed: 0 | \n", "SeriousDlqin2yrs | \n", "RevolvingUtilizationOfUnsecuredLines | \n", "age | \n", "NumberOfTime30-59DaysPastDueNotWorse | \n", "DebtRatio | \n", "MonthlyIncome | \n", "NumberOfOpenCreditLinesAndLoans | \n", "NumberOfTimes90DaysLate | \n", "NumberRealEstateLoansOrLines | \n", "NumberOfTime60-89DaysPastDueNotWorse | \n", "NumberOfDependents | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1 | \n", "1 | \n", "0.766127 | \n", "45 | \n", "2 | \n", "0.802982 | \n", "9120.0 | \n", "13 | \n", "0 | \n", "6 | \n", "0 | \n", "2.0 | \n", "
1 | \n", "2 | \n", "0 | \n", "0.957151 | \n", "40 | \n", "0 | \n", "0.121876 | \n", "2600.0 | \n", "4 | \n", "0 | \n", "0 | \n", "0 | \n", "1.0 | \n", "
2 | \n", "3 | \n", "0 | \n", "0.658180 | \n", "38 | \n", "1 | \n", "0.085113 | \n", "3042.0 | \n", "2 | \n", "1 | \n", "0 | \n", "0 | \n", "0.0 | \n", "
3 | \n", "4 | \n", "0 | \n", "0.233810 | \n", "30 | \n", "0 | \n", "0.036050 | \n", "3300.0 | \n", "5 | \n", "0 | \n", "0 | \n", "0 | \n", "0.0 | \n", "
4 | \n", "5 | \n", "0 | \n", "0.907239 | \n", "49 | \n", "1 | \n", "0.024926 | \n", "63588.0 | \n", "7 | \n", "0 | \n", "1 | \n", "0 | \n", "0.0 | \n", "
\n", " | count | \n", "mean | \n", "std | \n", "min | \n", "25% | \n", "50% | \n", "75% | \n", "max | \n", "
---|---|---|---|---|---|---|---|---|
CustomerID | \n", "150000.000000 | \n", "75000.500000 | \n", "43301.414527 | \n", "1.000000 | \n", "37500.750000 | \n", "75000.500000 | \n", "112500.250000 | \n", "150000.000000 | \n", "
SeriousDlqin2yrs | \n", "150000.000000 | \n", "0.066840 | \n", "0.249746 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "1.000000 | \n", "
RevolvingUtilizationOfUnsecuredLines | \n", "150000.000000 | \n", "6.048438 | \n", "249.755371 | \n", "0.000000 | \n", "0.029867 | \n", "0.154181 | \n", "0.559046 | \n", "50708.000000 | \n", "
age | \n", "150000.000000 | \n", "52.295207 | \n", "14.771866 | \n", "0.000000 | \n", "41.000000 | \n", "52.000000 | \n", "63.000000 | \n", "109.000000 | \n", "
NumberOfTime30-59DaysPastDueNotWorse | \n", "150000.000000 | \n", "0.421033 | \n", "4.192781 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "98.000000 | \n", "
DebtRatio | \n", "150000.000000 | \n", "353.005076 | \n", "2037.818523 | \n", "0.000000 | \n", "0.175074 | \n", "0.366508 | \n", "0.868254 | \n", "329664.000000 | \n", "
MonthlyIncome | \n", "120269.000000 | \n", "6670.221237 | \n", "14384.674215 | \n", "0.000000 | \n", "3400.000000 | \n", "5400.000000 | \n", "8249.000000 | \n", "3008750.000000 | \n", "
NumberOfOpenCreditLinesAndLoans | \n", "150000.000000 | \n", "8.452760 | \n", "5.145951 | \n", "0.000000 | \n", "5.000000 | \n", "8.000000 | \n", "11.000000 | \n", "58.000000 | \n", "
NumberOfTimes90DaysLate | \n", "150000.000000 | \n", "0.265973 | \n", "4.169304 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "98.000000 | \n", "
NumberRealEstateLoansOrLines | \n", "150000.000000 | \n", "1.018240 | \n", "1.129771 | \n", "0.000000 | \n", "0.000000 | \n", "1.000000 | \n", "2.000000 | \n", "54.000000 | \n", "
NumberOfTime60-89DaysPastDueNotWorse | \n", "150000.000000 | \n", "0.240387 | \n", "4.155179 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "98.000000 | \n", "
NumberOfDependents | \n", "146076.000000 | \n", "0.757222 | \n", "1.115086 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "1.000000 | \n", "20.000000 | \n", "
\n", " | Model | \n", "Accuracy | \n", "ROC AUC | \n", "F1 Score | \n", "
---|---|---|---|---|
0 | \n", "LogisticRegression | \n", "0.930800 | \n", "0.507650 | \n", "0.031716 | \n", "
1 | \n", "RandomForestClassifier | \n", "0.933000 | \n", "0.576874 | \n", "0.252788 | \n", "
2 | \n", "SVC | \n", "0.930800 | \n", "0.504092 | \n", "0.017045 | \n", "
3 | \n", "AdaBoostClassifier | \n", "0.935100 | \n", "0.593790 | \n", "0.296858 | \n", "
4 | \n", "XGBClassifier | \n", "0.933767 | \n", "0.584846 | \n", "0.273492 | \n", "
5 | \n", "LGBMClassifier | \n", "0.934833 | \n", "0.582306 | \n", "0.269159 | \n", "
\n", " | Model | \n", "Accuracy | \n", "ROC AUC | \n", "F1 Score | \n", "
---|---|---|---|---|
3 | \n", "AdaBoostClassifier | \n", "0.935100 | \n", "0.593790 | \n", "0.296858 | \n", "
5 | \n", "LGBMClassifier | \n", "0.934833 | \n", "0.582306 | \n", "0.269159 | \n", "
4 | \n", "XGBClassifier | \n", "0.933767 | \n", "0.584846 | \n", "0.273492 | \n", "
1 | \n", "RandomForestClassifier | \n", "0.933000 | \n", "0.576874 | \n", "0.252788 | \n", "
0 | \n", "LogisticRegression | \n", "0.930800 | \n", "0.507650 | \n", "0.031716 | \n", "
2 | \n", "SVC | \n", "0.930800 | \n", "0.504092 | \n", "0.017045 | \n", "
GridSearchCV(cv=3,\n", " estimator=XGBClassifier(base_score=None, booster=None,\n", " callbacks=None, colsample_bylevel=None,\n", " colsample_bynode=None,\n", " colsample_bytree=None,\n", " early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None,\n", " feature_types=None, gamma=None,\n", " gpu_id=None, grow_policy=None,\n", " importance_type=None,\n", " interaction_constraints=None,\n", " learning_rate=None,...\n", " max_leaves=None, min_child_weight=None,\n", " missing=nan, monotone_constraints=None,\n", " n_estimators=100, n_jobs=None,\n", " num_parallel_tree=None, predictor=None,\n", " random_state=42, ...),\n", " n_jobs=-1,\n", " param_grid={'colsample_bytree': [0.8, 1.0], 'gamma': [0, 0.1, 0.2],\n", " 'learning_rate': [0.1, 0.01, 0.001],\n", " 'max_depth': [3, 4, 5],\n", " 'n_estimators': [100, 200, 300],\n", " 'subsample': [0.8, 1.0]},\n", " scoring='roc_auc')In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
GridSearchCV(cv=3,\n", " estimator=XGBClassifier(base_score=None, booster=None,\n", " callbacks=None, colsample_bylevel=None,\n", " colsample_bynode=None,\n", " colsample_bytree=None,\n", " early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None,\n", " feature_types=None, gamma=None,\n", " gpu_id=None, grow_policy=None,\n", " importance_type=None,\n", " interaction_constraints=None,\n", " learning_rate=None,...\n", " max_leaves=None, min_child_weight=None,\n", " missing=nan, monotone_constraints=None,\n", " n_estimators=100, n_jobs=None,\n", " num_parallel_tree=None, predictor=None,\n", " random_state=42, ...),\n", " n_jobs=-1,\n", " param_grid={'colsample_bytree': [0.8, 1.0], 'gamma': [0, 0.1, 0.2],\n", " 'learning_rate': [0.1, 0.01, 0.001],\n", " 'max_depth': [3, 4, 5],\n", " 'n_estimators': [100, 200, 300],\n", " 'subsample': [0.8, 1.0]},\n", " scoring='roc_auc')
XGBClassifier(base_score=None, booster=None, callbacks=None,\n", " colsample_bylevel=None, colsample_bynode=None,\n", " colsample_bytree=None, early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None, feature_types=None,\n", " gamma=None, gpu_id=None, grow_policy=None, importance_type=None,\n", " interaction_constraints=None, learning_rate=None, max_bin=None,\n", " max_cat_threshold=None, max_cat_to_onehot=None,\n", " max_delta_step=None, max_depth=None, max_leaves=None,\n", " min_child_weight=None, missing=nan, monotone_constraints=None,\n", " n_estimators=100, n_jobs=None, num_parallel_tree=None,\n", " predictor=None, random_state=42, ...)
XGBClassifier(base_score=None, booster=None, callbacks=None,\n", " colsample_bylevel=None, colsample_bynode=None,\n", " colsample_bytree=None, early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None, feature_types=None,\n", " gamma=None, gpu_id=None, grow_policy=None, importance_type=None,\n", " interaction_constraints=None, learning_rate=None, max_bin=None,\n", " max_cat_threshold=None, max_cat_to_onehot=None,\n", " max_delta_step=None, max_depth=None, max_leaves=None,\n", " min_child_weight=None, missing=nan, monotone_constraints=None,\n", " n_estimators=100, n_jobs=None, num_parallel_tree=None,\n", " predictor=None, random_state=42, ...)
XGBClassifier(base_score=None, booster=None, callbacks=None,\n", " colsample_bylevel=None, colsample_bynode=None,\n", " colsample_bytree=0.8, early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None, feature_types=None,\n", " gamma=0, gpu_id=None, grow_policy=None, importance_type=None,\n", " interaction_constraints=None, learning_rate=0.1, max_bin=None,\n", " max_cat_threshold=None, max_cat_to_onehot=None,\n", " max_delta_step=None, max_depth=4, max_leaves=None,\n", " min_child_weight=None, missing=nan, monotone_constraints=None,\n", " n_estimators=100, n_jobs=None, num_parallel_tree=None,\n", " predictor=None, random_state=42, ...)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
XGBClassifier(base_score=None, booster=None, callbacks=None,\n", " colsample_bylevel=None, colsample_bynode=None,\n", " colsample_bytree=0.8, early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None, feature_types=None,\n", " gamma=0, gpu_id=None, grow_policy=None, importance_type=None,\n", " interaction_constraints=None, learning_rate=0.1, max_bin=None,\n", " max_cat_threshold=None, max_cat_to_onehot=None,\n", " max_delta_step=None, max_depth=4, max_leaves=None,\n", " min_child_weight=None, missing=nan, monotone_constraints=None,\n", " n_estimators=100, n_jobs=None, num_parallel_tree=None,\n", " predictor=None, random_state=42, ...)
GridSearchCV(cv=3,\n", " estimator=XGBClassifier(base_score=None, booster=None,\n", " callbacks=None, colsample_bylevel=None,\n", " colsample_bynode=None,\n", " colsample_bytree=None,\n", " early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None,\n", " feature_types=None, gamma=None,\n", " gpu_id=None, grow_policy=None,\n", " importance_type=None,\n", " interaction_constraints=None,\n", " learning_rate=None,...\n", " max_leaves=None, min_child_weight=None,\n", " missing=nan, monotone_constraints=None,\n", " n_estimators=100, n_jobs=None,\n", " num_parallel_tree=None, predictor=None,\n", " random_state=42, ...),\n", " n_jobs=-1,\n", " param_grid={'colsample_bytree': [0.8, 1.0], 'gamma': [0, 0.1, 0.2],\n", " 'learning_rate': [0.1, 0.01, 0.001],\n", " 'max_depth': [3, 4, 5],\n", " 'n_estimators': [100, 200, 300],\n", " 'subsample': [0.8, 1.0]},\n", " scoring='roc_auc')In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
GridSearchCV(cv=3,\n", " estimator=XGBClassifier(base_score=None, booster=None,\n", " callbacks=None, colsample_bylevel=None,\n", " colsample_bynode=None,\n", " colsample_bytree=None,\n", " early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None,\n", " feature_types=None, gamma=None,\n", " gpu_id=None, grow_policy=None,\n", " importance_type=None,\n", " interaction_constraints=None,\n", " learning_rate=None,...\n", " max_leaves=None, min_child_weight=None,\n", " missing=nan, monotone_constraints=None,\n", " n_estimators=100, n_jobs=None,\n", " num_parallel_tree=None, predictor=None,\n", " random_state=42, ...),\n", " n_jobs=-1,\n", " param_grid={'colsample_bytree': [0.8, 1.0], 'gamma': [0, 0.1, 0.2],\n", " 'learning_rate': [0.1, 0.01, 0.001],\n", " 'max_depth': [3, 4, 5],\n", " 'n_estimators': [100, 200, 300],\n", " 'subsample': [0.8, 1.0]},\n", " scoring='roc_auc')
XGBClassifier(base_score=None, booster=None, callbacks=None,\n", " colsample_bylevel=None, colsample_bynode=None,\n", " colsample_bytree=None, early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None, feature_types=None,\n", " gamma=None, gpu_id=None, grow_policy=None, importance_type=None,\n", " interaction_constraints=None, learning_rate=None, max_bin=None,\n", " max_cat_threshold=None, max_cat_to_onehot=None,\n", " max_delta_step=None, max_depth=None, max_leaves=None,\n", " min_child_weight=None, missing=nan, monotone_constraints=None,\n", " n_estimators=100, n_jobs=None, num_parallel_tree=None,\n", " predictor=None, random_state=42, ...)
XGBClassifier(base_score=None, booster=None, callbacks=None,\n", " colsample_bylevel=None, colsample_bynode=None,\n", " colsample_bytree=None, early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None, feature_types=None,\n", " gamma=None, gpu_id=None, grow_policy=None, importance_type=None,\n", " interaction_constraints=None, learning_rate=None, max_bin=None,\n", " max_cat_threshold=None, max_cat_to_onehot=None,\n", " max_delta_step=None, max_depth=None, max_leaves=None,\n", " min_child_weight=None, missing=nan, monotone_constraints=None,\n", " n_estimators=100, n_jobs=None, num_parallel_tree=None,\n", " predictor=None, random_state=42, ...)
XGBClassifier(base_score=None, booster=None, callbacks=None,\n", " colsample_bylevel=None, colsample_bynode=None,\n", " colsample_bytree=1.0, early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None, feature_types=None,\n", " gamma=0.1, gpu_id=None, grow_policy=None, importance_type=None,\n", " interaction_constraints=None, learning_rate=0.1, max_bin=None,\n", " max_cat_threshold=None, max_cat_to_onehot=None,\n", " max_delta_step=None, max_depth=5, max_leaves=None,\n", " min_child_weight=None, missing=nan, monotone_constraints=None,\n", " n_estimators=300, n_jobs=None, num_parallel_tree=None,\n", " predictor=None, random_state=42, ...)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
XGBClassifier(base_score=None, booster=None, callbacks=None,\n", " colsample_bylevel=None, colsample_bynode=None,\n", " colsample_bytree=1.0, early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None, feature_types=None,\n", " gamma=0.1, gpu_id=None, grow_policy=None, importance_type=None,\n", " interaction_constraints=None, learning_rate=0.1, max_bin=None,\n", " max_cat_threshold=None, max_cat_to_onehot=None,\n", " max_delta_step=None, max_depth=5, max_leaves=None,\n", " min_child_weight=None, missing=nan, monotone_constraints=None,\n", " n_estimators=300, n_jobs=None, num_parallel_tree=None,\n", " predictor=None, random_state=42, ...)
GridSearchCV(cv=3,\n", " estimator=XGBClassifier(base_score=None, booster=None,\n", " callbacks=None, colsample_bylevel=None,\n", " colsample_bynode=None,\n", " colsample_bytree=None,\n", " early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None,\n", " feature_types=None, gamma=None,\n", " gpu_id=None, grow_policy=None,\n", " importance_type=None,\n", " interaction_constraints=None,\n", " learning_rate=None,...\n", " max_leaves=None, min_child_weight=None,\n", " missing=nan, monotone_constraints=None,\n", " n_estimators=100, n_jobs=None,\n", " num_parallel_tree=None, predictor=None,\n", " random_state=42, ...),\n", " n_jobs=-1,\n", " param_grid={'colsample_bytree': [0.8, 1.0], 'gamma': [0, 0.1, 0.2],\n", " 'learning_rate': [0.1, 0.01, 0.001],\n", " 'max_depth': [3, 4, 5],\n", " 'n_estimators': [100, 200, 300],\n", " 'subsample': [0.8, 1.0]},\n", " scoring='roc_auc')In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
GridSearchCV(cv=3,\n", " estimator=XGBClassifier(base_score=None, booster=None,\n", " callbacks=None, colsample_bylevel=None,\n", " colsample_bynode=None,\n", " colsample_bytree=None,\n", " early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None,\n", " feature_types=None, gamma=None,\n", " gpu_id=None, grow_policy=None,\n", " importance_type=None,\n", " interaction_constraints=None,\n", " learning_rate=None,...\n", " max_leaves=None, min_child_weight=None,\n", " missing=nan, monotone_constraints=None,\n", " n_estimators=100, n_jobs=None,\n", " num_parallel_tree=None, predictor=None,\n", " random_state=42, ...),\n", " n_jobs=-1,\n", " param_grid={'colsample_bytree': [0.8, 1.0], 'gamma': [0, 0.1, 0.2],\n", " 'learning_rate': [0.1, 0.01, 0.001],\n", " 'max_depth': [3, 4, 5],\n", " 'n_estimators': [100, 200, 300],\n", " 'subsample': [0.8, 1.0]},\n", " scoring='roc_auc')
XGBClassifier(base_score=None, booster=None, callbacks=None,\n", " colsample_bylevel=None, colsample_bynode=None,\n", " colsample_bytree=None, early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None, feature_types=None,\n", " gamma=None, gpu_id=None, grow_policy=None, importance_type=None,\n", " interaction_constraints=None, learning_rate=None, max_bin=None,\n", " max_cat_threshold=None, max_cat_to_onehot=None,\n", " max_delta_step=None, max_depth=None, max_leaves=None,\n", " min_child_weight=None, missing=nan, monotone_constraints=None,\n", " n_estimators=100, n_jobs=None, num_parallel_tree=None,\n", " predictor=None, random_state=42, ...)
XGBClassifier(base_score=None, booster=None, callbacks=None,\n", " colsample_bylevel=None, colsample_bynode=None,\n", " colsample_bytree=None, early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None, feature_types=None,\n", " gamma=None, gpu_id=None, grow_policy=None, importance_type=None,\n", " interaction_constraints=None, learning_rate=None, max_bin=None,\n", " max_cat_threshold=None, max_cat_to_onehot=None,\n", " max_delta_step=None, max_depth=None, max_leaves=None,\n", " min_child_weight=None, missing=nan, monotone_constraints=None,\n", " n_estimators=100, n_jobs=None, num_parallel_tree=None,\n", " predictor=None, random_state=42, ...)
XGBClassifier(base_score=None, booster=None, callbacks=None,\n", " colsample_bylevel=None, colsample_bynode=None,\n", " colsample_bytree=0.8, early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None, feature_types=None,\n", " gamma=0, gpu_id=None, grow_policy=None, importance_type=None,\n", " interaction_constraints=None, learning_rate=0.01, max_bin=None,\n", " max_cat_threshold=None, max_cat_to_onehot=None,\n", " max_delta_step=None, max_depth=5, max_leaves=None,\n", " min_child_weight=None, missing=nan, monotone_constraints=None,\n", " n_estimators=300, n_jobs=None, num_parallel_tree=None,\n", " predictor=None, random_state=42, ...)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
XGBClassifier(base_score=None, booster=None, callbacks=None,\n", " colsample_bylevel=None, colsample_bynode=None,\n", " colsample_bytree=0.8, early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None, feature_types=None,\n", " gamma=0, gpu_id=None, grow_policy=None, importance_type=None,\n", " interaction_constraints=None, learning_rate=0.01, max_bin=None,\n", " max_cat_threshold=None, max_cat_to_onehot=None,\n", " max_delta_step=None, max_depth=5, max_leaves=None,\n", " min_child_weight=None, missing=nan, monotone_constraints=None,\n", " n_estimators=300, n_jobs=None, num_parallel_tree=None,\n", " predictor=None, random_state=42, ...)
\n", " | RevolvingUtilizationOfUnsecuredLines | \n", "age | \n", "DebtRatio | \n", "MonthlyIncome | \n", "NumberOfOpenCreditLinesAndLoans | \n", "NumberRealEstateLoansOrLines | \n", "NumberOfDependents | \n", "TotalDelinquencies90DaysLate | \n", "Probability of default | \n", "SeriousDlqin2yrs | \n", "
---|---|---|---|---|---|---|---|---|---|---|
57850 | \n", "-0.020214 | \n", "-0.629253 | \n", "-0.103545 | \n", "-0.088304 | \n", "-1.448281 | \n", "-0.901283 | \n", "-0.679073 | \n", "0.326693 | \n", "0.948333 | \n", "1 | \n", "
79708 | \n", "-0.020214 | \n", "-0.967735 | \n", "-0.140349 | \n", "-0.088304 | \n", "-1.642610 | \n", "-0.901283 | \n", "-0.679073 | \n", "0.326693 | \n", "0.948261 | \n", "1 | \n", "
101207 | \n", "-0.020214 | \n", "-0.696949 | \n", "-0.167339 | \n", "-0.088304 | \n", "-1.642610 | \n", "-0.901283 | \n", "-0.679073 | \n", "23.509448 | \n", "0.948035 | \n", "1 | \n", "
70904 | \n", "-0.020284 | \n", "-0.696949 | \n", "0.230146 | \n", "-0.088304 | \n", "-0.476640 | \n", "-0.901283 | \n", "2.011311 | \n", "0.326693 | \n", "0.947934 | \n", "1 | \n", "
28799 | \n", "-0.020214 | \n", "-0.426163 | \n", "0.228183 | \n", "-0.088304 | \n", "0.495001 | \n", "-0.901283 | \n", "-0.679073 | \n", "0.727779 | \n", "0.947616 | \n", "1 | \n", "
35421 | \n", "-0.020214 | \n", "-0.832342 | \n", "-0.050547 | \n", "-0.088304 | \n", "-1.059625 | \n", "-0.901283 | \n", "-0.679073 | \n", "0.326693 | \n", "0.947565 | \n", "1 | \n", "
61120 | \n", "-0.020038 | \n", "-0.358467 | \n", "0.078513 | \n", "-0.088304 | \n", "-0.476640 | \n", "-0.901283 | \n", "-0.679073 | \n", "0.888213 | \n", "0.947228 | \n", "1 | \n", "
34603 | \n", "-0.020214 | \n", "-0.290770 | \n", "-0.160469 | \n", "-0.088304 | \n", "-1.642610 | \n", "-0.901283 | \n", "-0.679073 | \n", "23.509448 | \n", "0.947212 | \n", "1 | \n", "
94360 | \n", "-0.020214 | \n", "-0.290770 | \n", "-0.167830 | \n", "-0.088304 | \n", "-1.642610 | \n", "-0.901283 | \n", "-0.679073 | \n", "23.509448 | \n", "0.947212 | \n", "1 | \n", "
84164 | \n", "-0.020214 | \n", "-0.155377 | \n", "-0.167339 | \n", "-0.088304 | \n", "-1.642610 | \n", "-0.901283 | \n", "-0.679073 | \n", "23.509448 | \n", "0.947212 | \n", "1 | \n", "
\n", " | RevolvingUtilizationOfUnsecuredLines | \n", "age | \n", "DebtRatio | \n", "MonthlyIncome | \n", "NumberOfOpenCreditLinesAndLoans | \n", "NumberRealEstateLoansOrLines | \n", "NumberOfDependents | \n", "TotalDelinquencies90DaysLate | \n", "Probability of default | \n", "SeriousDlqin2yrs | \n", "
---|---|---|---|---|---|---|---|---|---|---|
79708 | \n", "1.000000 | \n", "38.0 | \n", "67.0 | \n", "5400.0 | \n", "0.0 | \n", "0.0 | \n", "1.110223e-16 | \n", "5.0 | \n", "0.9483 | \n", "1 | \n", "
57850 | \n", "1.000000 | \n", "43.0 | \n", "142.0 | \n", "5400.0 | \n", "1.0 | \n", "0.0 | \n", "1.110223e-16 | \n", "5.0 | \n", "0.9483 | \n", "1 | \n", "
101207 | \n", "1.000000 | \n", "42.0 | \n", "12.0 | \n", "5400.0 | \n", "0.0 | \n", "0.0 | \n", "1.110223e-16 | \n", "294.0 | \n", "0.9480 | \n", "1 | \n", "
70904 | \n", "0.982451 | \n", "42.0 | \n", "822.0 | \n", "5400.0 | \n", "6.0 | \n", "0.0 | \n", "3.000000e+00 | \n", "5.0 | \n", "0.9479 | \n", "1 | \n", "
35421 | \n", "1.000000 | \n", "40.0 | \n", "250.0 | \n", "5400.0 | \n", "3.0 | \n", "0.0 | \n", "1.110223e-16 | \n", "5.0 | \n", "0.9476 | \n", "1 | \n", "
28799 | \n", "1.000000 | \n", "46.0 | \n", "818.0 | \n", "5400.0 | \n", "11.0 | \n", "0.0 | \n", "1.110223e-16 | \n", "10.0 | \n", "0.9476 | \n", "1 | \n", "
34603 | \n", "1.000000 | \n", "48.0 | \n", "26.0 | \n", "5400.0 | \n", "0.0 | \n", "0.0 | \n", "1.110223e-16 | \n", "294.0 | \n", "0.9472 | \n", "1 | \n", "
61120 | \n", "1.043912 | \n", "47.0 | \n", "513.0 | \n", "5400.0 | \n", "6.0 | \n", "0.0 | \n", "1.110223e-16 | \n", "12.0 | \n", "0.9472 | \n", "1 | \n", "
84164 | \n", "1.000000 | \n", "50.0 | \n", "12.0 | \n", "5400.0 | \n", "0.0 | \n", "0.0 | \n", "1.110223e-16 | \n", "294.0 | \n", "0.9472 | \n", "1 | \n", "
88891 | \n", "1.356828 | \n", "49.0 | \n", "682.0 | \n", "5400.0 | \n", "10.0 | \n", "0.0 | \n", "1.110223e-16 | \n", "9.0 | \n", "0.9472 | \n", "1 | \n", "