# Personal Credit Risk Assessment Based on Stacking Ensemble Model

Maoguang Wang, Jiayu Yu, Zijian Ji

► To cite this version:

Maoguang Wang, Jiayu Yu, Zijian Ji. Personal Credit Risk Assessment Based on Stacking Ensemble Model. 10th International Conference on Intelligent Information Processing (IIP), Oct 2018, Nanning, China. pp.328-333, 10.1007/978-3-030-00828-4_33. hal-02197794

HAL Id: hal-02197794

https://inria.hal.science/hal-02197794

Submitted on 30 Jul 2019

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Personal Credit Risk Assessment Based on Stacking
Ensemble Model

Maoguang Wang¹, Jiayu Yu¹, and Zijian Ji¹

¹ School of Information, Central University of Finance and Economics, Beijing, China

**Abstract.** Nowadays, compared with the traditional artificial risk control audit method, a more sophisticated intelligent risk assessment system is needed to support credit risk assessment. Ensemble learning combines multiple learners that can achieve better generalization performance than a single model. This paper proposes a personal credit risk assessment model based on Stacking ensemble learning. The model uses different training subsets and feature sampling and parameter perturbation methods to train multiple differentiated XGBoost classifiers. According to Xgboost's high accuracy and susceptibility to disturbances, it is used as a base learner to guarantee every learning "Good and different". Logistic regression is then used as a secondary learner to learn the results obtained by Xgboost, thereby constructing an evaluation model. Using the German credit data set published by UCI to verify this model and Compared with the single model and Bagging ensemble model, it is proved that the Stacking learning strategy has better generalization ability.

**Keywords:** Credit risk, XGBoost, Stacking.

# 1 Introduction

Credit risk, also known as default risk, refers to the possibility of a default occurring when the borrower fails to repay the agreed debt on the basis of the credit relationship. The occurrence of credit risk mainly involves two aspects of repayment ability and repayment willingness. The repayment ability means that the borrower does not have enough funds to repay the previous loan for some reason; and the willingness to repay means the idea of the repayment of the borrower. The former is a concern and consideration in the field of credit risk assessment and measurement, while the latter mainly involves the identification of fraud.

Credit assessment allows the credit industry to benefit from improved cash flow, guaranteed credit collection, reduced potential risks, and better management decisions [1]. Therefore, the credit evaluation field has received a great deal of attention and it is of practical significance to carry out research on this.

Durand[2] first analyzed the credit risk and for the first time built a consumer credit evaluation model using statistical discriminant analysis. The results show that the use of quantitative methods can achieve better predictive ability. With the increase of data
volume and the development of machine learning algorithms, machine learning algo-
rithms have been extensively studied in the field of credit evaluation.

Lean Yu[3] et al. used SVM to construct a credit risk assessment model. However, SVM is sensitive to parameter settings and optimization methods. Khashman[4] studied the credit risk assessment system based on back propagation neural network. Experimental results show that the neural network can be effectively used for automatic processing of credit applications.

Ensemble learning which combines multiple learners allows the learner to learn dif-
ferent parts, making the ensemble model more generalized than a single model. Xiang
Hui [5] combined bagging with the C4.5 decision tree algorithm and applied it to Ger-
man and Australian data to evaluate consumer credit. Chen Qiwei [6] used XGBoost as
a base classifier to construct a credit scoring model using data space, feature space, and
algorithm parameter strategies, and then used a bagging method to learn a good inte-
gration model.

Because XGBoost has strong learning ability and generalization ability, it can guar-
antee accuracy; while the tree-based model belongs to the unstable learner, it is sensi-
tive to parameter perturbation. Integrating XGBoost to ensure a "good and different"
base learner improves the classification accuracy of the integrated model. This paper
proposes a Stacking ensemble credit scoring model based on XGboost-LR. The model
uses different training subsets and feature sampling and parameter perturbation meth-
ods to train multiple differentiated XGBoost classifiers; then the predicted probability
obtained by each base classifier is used as a logistic regression feature variable to train
logistic regression models, and According to the threshold, the probability is converted
into the classification result. Using AUC as evaluation indicators, the effectiveness of
the Stacking integration strategy was verified through comparison with a single model
and a Bagging ensemble strategy. In the personal credit assessment, this method makes
full use of the advantages of Stacking, and can solves the inadequacies of a single al-
gorithm, providing a new research idea.

2 Model strategy and design

2.1 Model strategy

GBDT (Gradient Boosting Decision Tree) was first proposed by Friedman [7]. The idea of GBDT optimizing its parameters is that each iteration is to fit the residual and approximate the residual using the negative gradient value of the loss function in the current model, and then fit a weak CART regression tree.

However, GBDT needs to iterate several times before the model have a better per-
formance. Chen Tianqi [8] have optimized this and proposed the XGBoost model.
XGBoost uses a second-order Taylor expansion for the loss function.
According to the “Error-ambiguity decomposition” principle [9], the effectiveness of the ensemble model depends on the difference of the base learner. Therefore, constructing a xgboost with a large difference is the key to this model. The diversity of the base learner is mainly considered in the following three parts: Diversity of sample space, Diversity of feature space and Diversity of parameters.

The Bootsrap method [10] is a random sampling method with replacement. This method is conducive to the construction of different training sets, this paper will use the Bootsrap sampling method for sample space disturbance. The Random Subspace Method (RSM) proposed by Ho [11] refers to extracting some attribute subsets and then generating a base learner for each attribute subset training. This ensemble method based on feature partitioning can enhance the independence between the base learners. The difference in parameters of the base learner can easily generate a variety of base learners and enhance the generalization ability of the training model.

## 2.2 Model design

Xgboost trains the model on the training set and then obtains the predicted probability of the trained Xgboost model on the validation set. The prediction probabilities are entered into the logistic regression model together with the original verification set labels as training samples of the secondary trainer, and the final model based on the Stacking ensemble strategy is trained.

For the accuracy of the Xgboost model, the influence of Learning rate, max_depth, and Column subsample ratio is greater. So in diversity of parameters aspect, Xgboost parameters are randomly selected in **Table 1**, making the model parameters diversified.

<table><caption>**Table 1.** Range of base classifiers Parameters</caption><thead><tr><td>Parameter</td><td>Range</td></tr></thead><tbody><tr><td>Learning rate</td><td>[0.01,0.05,0.1,0.2]</td></tr><tr><td>max_depth</td><td>[3,4,5,7,8]</td></tr><tr><td>Column subsample ratio</td><td>[0.5,0.6,0.7,0.8]</td></tr><tr><td>reg cerba</td><td>[0.4,0.6,0.8,1,2,3]</td></tr><tr><td>Number of estimators</td><td>[70,80,90,100]</td></tr></tbody></table>

# 3 Experiments

## 3.1 Data pre-processing

This paper uses UCI public the German credit data set [12] for model validation. The sample size in the data set is 1000, and the ratio of "good credit" customers to "bad credit" customers is 7/3. There are 20 variables in the original data set, including 7 numerical variables and 13 qualitative variables. Ordered qualitative variables can be directly divided into numbers. Unordered qualitative variables need to be transformed
into dummy variables using one-hot encoding. In the end, there are 24 variables, 1 dependent variable, and dependent variable = 1 means “good credit”, dependent variable = -1 means "bad credit".

Due to the need to compare the generalization capabilities of different models in the follow-up, the distance-based training model is susceptible to the gap between the data orders. Therefore, the data needs to be normalized. This article takes the maximum and minimum normalization method for the original data.

Randomly divide the initial sample data into disjoint two parts: the training set and the test set. 65% of the samples were used as training set, and 35% of the samples were used as test set. In constructing the xgboost-based learner, a training set is divided into a training subset and a validation subset in a 5-fold cross validation manner. So there will be 5 base classifiers.

## 3.2 Model training

Because risk assessment is a two-category problem. Therefore, in the XGBoost model, the negative binomial log likelihood is used as a loss function:

$$L(y, f(x)) = \ln(1 + \exp(-yf(x))), \quad y \in \{-1,1\} \qquad (1)$$

As mentioned before, XGBoost belongs to a classifier with a large number of hyper-parameters. The value of the parameter is crucial. The performance of the model depends on the choice of parameters. However, so far, there is no theoretical method to guide the choice of parameters. In addition to the parameters in the spatial perturbations mentioned above, the remaining parameters are selected by the grid search method. The range of the value of the hyper-parameter is shown in Table 2.

<table><caption>**Table 2.** Range of other XGBoost Parameters in Grid Search</caption><thead><tr><td>Parameter</td><td>Grid Search</td></tr></thead><tbody><tr><td>min_child_weight</td><td>(1,6,2)</td></tr><tr><td>Subsample ratio</td><td>(0.5,1,0.1)</td></tr><tr><td>Gamma</td><td>(0,0.1,0.01)</td></tr></tbody></table>

Grid search uses 10-fold cross validation to perform parameter optimization. After parameter optimization, the min_child_weight of each leaf node was 2, and the Subsample ratio was 0.7, gamma was 0.

In terms of criteria, AUC on the test set are used as performance evaluation criteria for the model. AUC is an important indicator to measure the quality of different models. It is the area under the ROC curve. The closer AUC is to 1, the higher the degree of reality is.

## 3.3 Model results

In order to verify the validity of the XGBoost-LR model using the Stacking ensemble strategy, this paper combines the three single models of Random Forest, XGBoost
and Naive Bayes Algorithms, and these algorithms using the Bagging ensemble strategy model to compare the results. All models for comparison use the same data training set and test set for training and are trained 1000 epochs for robust. All single models apply the default values of the model in the scikit-learn package. In the bagging strategy, the sample space sampling rate is 0.8 and the feature space sampling rate is 0.6.

<table><caption>**Table 3.** Performance comparisons for different classification and ensemble models</caption><thead><tr><td>Model</td><td>AUC(%)</td></tr></thead><tbody><tr><td>Random Forest</td><td>74.34</td></tr><tr><td>Naive Bayes</td><td>75.28</td></tr><tr><td>XGBoost</td><td><strong>76.77</strong></td></tr><tr><td>RF-Bagging</td><td>77.66</td></tr><tr><td>Naive Bayes-Bagging</td><td>75.64</td></tr><tr><td>XGBoost- Bagging</td><td><strong>77.81</strong></td></tr><tr><td>XGBoost-LR-Stacking</td><td><strong>78.48</strong></td></tr></tbody></table>

From Table 3, it can be seen that in the three single models using the original features, the XGBoost has the highest AUC value of 76.77%, and Naive Bayes is second only to XGBoost. The AUC of the learner applying Bagging strategy is higher than that of the single model, which shows the effectiveness of the ensemble strategy. As far as the ensemble strategy is concerned, it can be seen from this paper that the Stacking strategy has better generalization ability than the Bagging strategy and the AUC value increases from 77.81% to 78.48%. Although the increase in AUC is not significant, it is very promising because the ensemble training of 1000 samples is a very challenging classification task. Therefore, the classification AUC value proves the effectiveness of the proposed Stacking method.

## 4 Conclusion

This paper studies the ensemble strategy of models in the field of personal credit risk assessment and proposes an ensemble model based on Stacking. This model uses XGBoost as a base classifier and combines the random subspace and Bootstrap algorithms to increase the diversity between the base classifiers. The Logistic Regression model is used as a secondary learner, learning the results of each XGBoost as a feature variable to obtain an assessment model. The experiment confirmed that the model can have a certain degree of early warning for identifying customers with risks and has better generalization capabilities.

The future direction of work will focus on expanding the amount of data and constructing a more diverse base learner to verify the effectiveness of the model. And the use of domestic credit data to better build the XGBoost-LR ensemble model for China's real credit business.
5 Acknowledgments

This work is supported partially by NSFC under the Agreement No. 61073020 and
the Project of CUFE under the Agreement No. 020674115002,020676114004,
020676115005.

References

1. A Khashman(2009), "A neural network model for credit risk evaluation. International Journal of Neural Systems", 19 (04) :285-294

2. A.Krogh, J.Vedelsby.(1994), "Neural network ensembles, cross validation and active learn-
ing", International Conference on Neural Information Processing Systems:7(10):231-238.

3. B.Efron,&R.Tibshirani(1998), "An Introduction to the Bootstrap", Chapman & Hall, New York,23(2):49-54.

4. CHEN Li, HUANG Yan-ying, YOU De-chuang(2017), "Application on Individual Credit Score for Bank of a Boosting-based Ensemble Learning Algorithm", Value Engineering:18:170-172

5. Chen Qiwei, Wang Wei, Ma Di, et al (2018), "Class-imbalance credit scoring using Ext-GBDT ensemble[J]", Application Research of Computers: 35(2): 421-427(in Chinese)

6. Chen Tianqi, Guestrin C (2016), "XGBoost: a scalable tree boosting system", [C]//Proc of ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco: ACM.

7. Ding Lan, Luo Pinliang (2017), “Research on Early Warning of P2P Network Loan Default Risk Based on Stacking Integration Strategy”, Review of Investment Studies:4:41-54

8. Durand D (1941), "Risk elements in consumer instalment financing", New York: National Bureau of Economic Research: 189-201

9. Friedman J H (2002), "Stochastic gradient boosting", Computational Statistics & Data Analysis: 38(4): 367-378

10. Harrell F E, Lee K L (1985), "A comparison of the discrimination of discriminant. analysis and logistic regression under multivariate normality", Biostatistics: Statistics in Biomedical, Public Health and Environmental Sciences :333-343

11. Lee Tian-Shyug, Chiu Chih-Chou, Lu Chi-Jie, et al (2002), “Credit scoring using the hybrid neural discriminant technique”, Expert Systems with Applications 23 (3) :245-254

12. L Yu, X Yao, S Wang, KK Lai (2011), "Credit risk evaluation using a weighted least squares SVM classifier with design of experiment for parameter selection", Expert Systems with Applications 38(12) :15392-15399

13. Qin Wanshun. Shi Qingyan(2003), "Personal Credit Grading Model Basing On Logistic Regression", Quantitative Economics in the 21st Century: 4 (in Chinese)

14. T.K.Ho (1998), "The random subspace method for constructing decision forests[J]", IEEE Transactions on Pattern Analysis and Machine Intelligence, 20(8):832-844.

15. UCI. Statlog (German credit data) data set[EB/OL]. https://archive.ics. uci.edu/ml/machine-learning-databases/statlog /german.

16. Wang Li, Liao Wenjian (2015), “Personal credit scoring method using gradient boosting decision tree”, Electronic Design Engineering: 15: 68-72(in Chinese)

17. Xiang Hui, Yang Shenggang (2011), “Clustering-based bagging ensemble consumer credit assessment model”, Consumer Economics: (1) :50-52