# Financial Credit Risk Control Strategy Based on Weighted Random Forest Algorithm

Authors: Guo Yangyudongnanxin
Journal: Scientific Programming
 (2021)

---

## Abstract

In order to improve the effectiveness of financial credit risk control, a financial credit risk control strategy based on weighted random forest algorithm is proposed. The weighted random forest algorithm is used to classify the financial credit risk data, construct the evaluation index system, and use the analytic hierarchy process to evaluate the financial credit risk level. The targeted risk control strategies are taken according to different risk assessment results. We compared the proposed method with two other methods, and the experimental results show that the proposed method has higher classification accuracy of financial credit data and the risk assessment threshold is basically consistent with the actual results.


---

## Body

## 1. Introduction

In recent years, with the rapid development of Internet finance, online credit has developed very rapidly and its participants are becoming more and more diversified. Online credit helps more and more users with emergency and short-term capital turnover. However, in the process of opening user loan business, the total amount of loans is increasing, the default probability of users is rising, and the risk of user loans is gradually revealed. Therefore, in-depth research on user loan risk and evaluation of the scientificity and rationality of the risk are extremely important for microonline credit enterprises to prevent Internet financial risk [1–3]. In the study of user loan risk prediction and analysis, it is found that the user’s data have the following three important characteristics: unbalanced distribution, a large amount of noise, and high-dimensional characteristics. The user loan risk is caused by the interaction of the characteristics of multiple different dimensions of users. For the traditional statistical methods, only a single feature or a small number of features can study the relationship between user loan risk. Therefore, it is a challenge to the traditional statistical methods [4].With the rapid development of the financial industry and the Internet industry, Internet finance, as an emerging business model, has gradually come into everyone’s sight. The online business volume of Internet finance such as medium and small loans is also increasing rapidly with the growth of Internet scale. The loan applications of individuals, businesses, and even enterprises are gradually moving towards rapidity and paperless [5]. In the early days, loan default forecasts relied entirely on manual review. This forecasting method is only suitable for small-scale credit audit, and there is nothing to do with large-scale loan audit. In order to solve the uncertainty of human factors in the process of manual audit, a method to judge whether to make a loan according to detailed rules is proposed by financial institutions. This method gives a conclusion according to the rules, so that the credit auditor can judge whether to lend money according to clear indicators. At the same time, the proposal of this method greatly reduces the requirements for the credit auditor, and ordinary staff can start credit work after relevant training. In addition, many researchers have proposed data mining models to study credit default [6].The random forest (RF) algorithm has been very successful in general purpose classification and as a regression method. It is an machine learning algorithm that could be applied to large-scale problems that involve big data and could be easily adapted to various ad-hoc learning tasks [7–9]. The voting mechanism of random forest algorithm assumes the same weight for all of the base classifiers, which is not always the case. Some of them may have lower weights than the others, and all of the trees may not have the same ability to make decisions. Therefore, the weighted RF algorithm performs better than RF algorithm in most cases [10, 11].In order to control the financial credit risk more effectively, a financial credit risk control strategy based on weighted random forest algorithm is proposed.


## 2. Related Work

The study in [12] proposed a financial credit risk assessment method based on particle swarm optimization algorithm. On the basis of fully demonstrating the supply chain financial risk characteristic index system, a binary particle swarm optimization algorithm is used to optimize the feature subset, and the support vector machine (SVM) parameters are co-optimized to obtain the financial credit risk classification assessment results. The work in [13] proposed the financial credit risk assessment method of stack noise reduction self-coding network, fully considered the correlation between data features, improved the stack noise reduction self-coding neural network model, introduced the truncated Karhunen lo è ve expansion as the noise input term, and eliminated the noise data in the financial credit risk data to obtain more effective evaluation results. The study in [14] proposed a financial credit risk assessment method based on xgbfs, which uses a series of data preprocessing methods and embedded feature selection method xgbfs (xgboost feature selection) to reduce the user’s credit data dimension, train the xgboost assessment model, and finally realize the user’s credit risk assessment. The work in [15] proposed that integration of supervised and unsupervised machine learning strategies will produce better results than using only one of them. They proposed a system for credit risk assessment by integrating the supervised and unsupervised learning strategies at the consensus stage and the dataset clustering stage. The study in [16] concluded that traditional approaches used for forecasting credit risks are not well suited to help the financial institutions and they need ML-based techniques for forecasting credit risk. They proposed a hybrid ensemble machine learning approach by incorporating two classic machine learning approaches, the RS (random subspace), and multiboosting. The work in [17] used the standard probit algorithm along with various machine learning algorithms like neural networks and KNN. They achieved a lower error rate with the machine learning techniques as compared to the classic methods used for credit risk assessment. The work in [18] used a loan dataset of a commercial bank to test five different machine learning algorithms including KNN, DT, RF, NB, and logistic regression for credit risk assessment. Their results show that the random forest algorithm performs better than the other algorithms tested.


## 3. Financial Credit Risk Control Based on Weighted Random Forest Algorithm

In order to effectively control the financial credit risk, it is necessary to accurately classify the financial credit risk level, classify the financial credit risk data by using the weighted random forest algorithm, and construct the credit risk evaluation model. Targeted control measures shall be taken for different financial credit risk levels.


### 3.1. Data Classification

Decision tree is a machine learning algorithm with tree structure, which is composed of root node, nonleaf node, and leaf node. Its structure is shown in Figure1.Figure 1
Structure diagram of the decision tree.The decision tree is a recursive structure. The root node carries out data training and prediction from top to bottom. According to different similarity calculation standards, subsets with certain similarity in the data are divided to generate multiple branches. When reaching the leaf node of the decision tree, the division is stopped. Leaf nodes are set according to the maximum tree depth or the minimum number of leaves. One leaf node represents one classification result of the data. The decision tree can be divided into decision trees based on information entropy, information gain, information gain rate, and Gini impurity according to the different basis of feature division. Assuming that the training sample setD with N financial credit data can be divided into K categories, it establishes the calculation formulas of information entropy, information gain, information gain rate, and Gini impurity of different decision trees as follows:(1)HD=−∑k=1KnkNlog2pnkN,where HD denotes information entropy, nk denotes the number of k_th category, and p represents the probability. Similarly, for information gain, we have(2)gD,a=HD−∑v=1VDvDHDv.For information gain rate, we have(3)gRD,a=gD,a−∑v=1VDv/Dlog2Dv/D.For Gini impurity,(4)GiniD=1−∑k=1KnkN2.Here,nk represents the number of kth category, v represents the number of subsets of the sample set divided according to feature a, and the value range is 1,V [19].Random forest is an integrated learning algorithm based on decision tree. It randomly generates multiple irrelevant decision trees. Each decision tree learns and predicts independently. These predictions are synthesized into single prediction by voting. The category with the most votes is the model prediction result, and its result is better than the decision tree.Suppose the input financial credit training dataset isD, the number of iterations of the decision tree is M, and the generation steps of the random forest are as follows:(1)
Conduct themth sampling on the sample training set, where m is an integer and the value range is 1,M. Randomly collect n times to obtain the training set Dm containing n samples.(2)
When the decision tree is divided into nodes, alln input variables do not fully participate in node splitting, but kk≤n random feature variables are randomly selected, the value of k is generally 2log2n+1, the best feature among the k features is split as a node, and the mth decision tree Gm generated by classification and regression tree CART algorithm is trained.(3)
The CART decision tree is divided into features based on Gini impurity. When the Gini impurity is smaller, the representative impurity is smaller, and its features are better. Finally,M CART decision trees are generated to form a random forest.(4)
Determine the type of data by calculating the number of votes. The flow of random forest algorithm is shown in Figure2.Figure 2
Flow chart of the random forest algorithm.The decision tree algorithm is fast and easy to understand, but it is easy to over fit, and when dealing with unbalanced data, the feature division tends to choose features with more values. Compared with the decision tree algorithm, random forest has high accuracy and is not easy to over fit, but in unbalanced datasets, the classification accuracy of a few classes is still not high. Aiming at the classification problem of unbalanced datasets, an accurate classification method based on weighted random forest lifting is proposed.In order to minimize the overall error rate, the machine learning algorithm will ignore the classification of classes with less data, and it is easy to form a model conducive to the classification of most classes during training [2]. In order to improve this situation, the weighted random forest follows the idea of cost sensitive learning, increases the influence of fewer classes by giving more weight to fewer classes, and balances the relationship between samples, which can make the generated model more suitable for unbalanced data and improve the accuracy of classification results of a few data.Class weight is mainly reflected in the following:(1) The growth process of decision tree, the reductionΔgi of weighted Gini impurity GI is used to find the optimal division feature. The larger the value, the smaller the representative impure, and the better the separation result. The calculation formula is(5)GIJ=∑i=1KniWi2∑i=1KniWi,Δgi=GIJ−GIJL−GIJR.Here,K represents the total number of categories, J represents the sample set at the nonseparated node, JL represents the separated left node sample set, JR represents the separated node sample set, ni represents the number of various samples in the node, and Wi represents the class weight value assigned to each class.(2) When determining the category at the leaf node, the final classification resultc is determined by combining the weighted voting of each decision tree. The calculation formula is(6)c=argmaxiniWi.Through the above calculation, the classification of financial credit data for subsequent financial credit risk assessment is completed.


### 3.2. Financial Credit Risk Assessment

#### 3.2.1. Construction of Financial Credit Risk Evaluation Index

(1) Principles for Construction of the Evaluation Index System.(1)
Principle of comprehensivenessThe evaluation index system of personal credit risk of commercial banks must cover all factors affecting credit risk control. On the one hand, the impact of personal factors on credit risk should be considered; on the other hand, the impact of social environmental factors of lenders should be considered. Only by ensuring the comprehensiveness of the evaluation index system we can ensure the accuracy of credit evaluation of borrowers [20, 21].(2)
System optimization principleEnsuring the comprehensiveness of the evaluation index system does not mean that the more indicators the better. The selection of the index system must take into account the system optimization principle, that is, select important indicators, and eliminate those redundant indicators with the same impact level, so that the whole index system can fully reflect the actual situation of the lender and form an interconnected unity.(3)
OperabilityThe selection of personal credit risk evaluation indicators must be combined with the actual situation, select those indicators that can obtain the actual data, and ensure the reliability and accuracy of these data. If some indicators cannot obtain the original data, or the obtained data are inaccurate, it has no practical significance in the evaluation process and may even cause deviation in the evaluation results.(4)
Dynamic principleAfter the completion of the personal credit risk evaluation index system, it is not invariable. It can change dynamically according to the actual situation. Specifically, the indicators can be adjusted according to the lender’s personal basic situation or changes in the economic environment.(5)
Principle of legality and fairnessLegitimacy means that the establishment of the index system must be consistent with the national macroeconomic policies and comply with the provisions of relevant laws and regulations; fairness means that the establishment of personal credit risk evaluation index system is objective and fair. It is based on objective facts, which can scientifically and accurately reflect the basic attributes of commercial banks and loan applicants and does not favor either party.The personal credit risk evaluation index system is selected by analyzing the evaluation index system established by relevant research institutes at home and abroad, drawing on the relevant experience of domestic and foreign experts on personal credit risk evaluation research and combining the possibility of obtaining correct data for each specific index, a set of evaluation index system including personal basic information. The second level index system of personal credit risk evaluation was based on three first level indexes of economic status and reputation status. The specific index system is shown in Table1.Table 1
Credit risk evaluation index system.
Serial numberPrimary indexSecondary indexRisk factor marker1Basic personal informationAgeu11Marital statusu12Genderu13Education levelu14Occupation typeu15Dutiesu162Economic situationMonthly incomeu21Ratio of average monthly repayment to monthly disposable incomeu22Loan termu23Loan amountu24Bank account recordsu253Personal honor statusHistory of loans, overdrafts, and guaranteesu31Personal judicial recordsu32Other bad reputation recordsu33(2) Basic Personal Information Indicators.(1)
AgeGenerally, the probability of default of the lender decreases with the increase in age. Borrowers under the age of 20 may have no fixed economic income, but there are very few borrowers in this age group, so the risk of default is not high; at the age of 35–55, the lender in this age group has generally made achievements in his career, and his income is relatively stable, and his ability to repay the loan is generally strong; after the age of 55, with the growth of age, the expenditure on medical treatment and life may gradually increase, and the default risk of this part of people may be relatively high.(2)
Marital statusStatistics show that there is not much difference in loan default rate between unmarried borrowers and married borrowers, and married borrowers are slightly lower.(3)
GenderCombining the two groups of statistical data on male and female loan default rates, it can be found that this group of statistical data shows that the male lender default rate is higher than the female lender default rate, and the difference in default rate of this group of data is about 6%.(4)
Education levelUsually, with the continuous improvement of the lender’s education, the probability of default will decrease. The personal quality of the lender is generally positively correlated with the level of education. The lender with a high level of education may have stronger self-restraint ability, so his personal reputation is relatively high.(5)
Occupation typeThe occupation type of the applicant is closely related to the bank’s decision whether to lend to him. The unemployed will not become the loan object of the commercial bank. Borrowers have different occupations, and their income also varies greatly. Borrowers with good career prospects and stable income will generally become potential customers of commercial banks.(6)
PositionThe loan default rate is also related to the position of the lender. The lender with relatively high position may pay more attention to personal reputation, so the probability of default may be low.(3) Economic Indicators. (1)
Monthly incomeIt is of great significance to judge the default risk of loan applicants. Generally speaking, it is considered that the higher the monthly income, the lower the default risk, otherwise the higher. When the loan applicant has the same willingness to repay, the higher the income level, the stronger the repayment ability. There is a positive correlation between the income and the borrower’s repayment ability.(2)
Proportion of monthly repayment in monthly disposable income.The proportion of monthly repayment in monthly disposable income is also an important indicator to measure the lender’s repayment ability. The monthly repayment amount refers to the amount of loan interest and principal repaid by the lender to the bank every month, and the monthly disposable income is the remaining income after the lender’s monthly income minus the amount of loan interest and principal repaid to the bank every month. Theoretically, the ratio value fluctuates between 0.1. The smaller the ratio value, the better the financial situation of the borrower.(3)
Loan termThe loan term refers to the time period from the time when the commercial bank issues the loan to the lender to the time when the lender pays off all the loan and interest. The length of the loan term is closely related to the loan interest rate. Generally, the longer the loan term, the higher the loan interest rate. The probability of default is relatively high for customers with long loan term than short loan term. The longer the loan term, the worse the liquidity and the higher the risk.(4)
Loan amountThe loan amount is closely related to the loan applicant’s application amount and the applicant’s credit rating. Generally, lenders with relatively small loan amount have relatively low probability of default, while customers with high probability of default are mainly concentrated in the range with relatively high loan amount. Therefore, including the loan amount in the personal credit risk evaluation index system is of great significance for commercial banks to adopt appropriate risk aversion measures according to the loan amount.(5)
Bank account recordsBank account records mainly refer to the records of customers opening accounts and handling bank cards in this commercial bank. Generally, the default risk of users who do not open an account in the loan application bank is higher than that of the lender who has opened an account.(4) Personal Reputation Indicators(1)
Historical credit historyHistorical credit records refer to the past loan repayment, credit card overdraft information, guarantee, and other information of the loan applicant. Through the review of the loan applicant’s historical credit records, we can preliminarily judge the credit situation of the loan applicant and the probability of default risk in the future.(2)
Personal judicial recordsThe review of personal judicial records is mainly to investigate whether the loan applicant has a criminal record in the past, which is only a supplementary indicator.(3)
Other records of reputation damage.This includes personal reputation indicators other than historical credit records and personal judicial records, including whether the lender has tax evasion, arrears of water, electricity costs, etc.


#### 3.2.2. Financial Credit Risk Assessment Based on Principal Component Analysis

The principal component analysis method is used for financial credit risk assessment. The principal component analysis method is the basic means of multivariable data analysis. Its main idea is map a group of multivariable information to several principal components, analyze and process the principal components as the overall information, and there is no linear correlation between the principal components; therefore, the dimension of the original data is reduced, the redundant information is effectively eliminated, and the noise in the original information is effectively suppressed. It is especially suitable for dealing with the situation that there are many and complex original data samples. It can effectively reduce the dimension and denoise and improve the convergence accuracy and risk assessment accuracy of financial and credit data.IfX is an m×n-dimensional data sample set, the input is Xn×m and the output is Yn×m. The kth principal component is Pk=P1k,P2k,...,PnkT,k=1,2,...,m; the principal component matrix (i.e., principal component score matrix) is the crossproduct of X and principal component load:(7)T=XP.Here, the single variable in the score matrix is Tij=∑kmPkjXik and the Tj=∑kmXkPkj variable is j.(1) Data Standardization Processing. The original financial loan risk data shall be processed as follows:(8)Xij′=Xij−MjSj,Mj=1n∑1nXij,Sj=1n−1∑1nXij−Mj2.Here,Xij′ represents the standardized new financial credit risk data, and Mj and Sj represent the arithmetic mean and standard deviation of a column of the original financial credit risk data, respectively.(2) Calculation of Characteristic Matrix D of the Original Matrix(9)D=XTX.The covariance is as follows:(10)D=d11d12⋯d1pd21d22⋯d2p⋮⋮⋮⋮dp1dp2⋯dpp,dij=∑k=1nxki−x¯ixkj−x¯j∑k=1nxki−x¯i2∑k=1nxkj−x¯j2.(3) Calculation of Eigenvector P and Eigenroot(11)DP=Pλ.When only thejth eigenvalue is considered, there is DPj=Pjλj, that is, D−λjI=0. Solving λ and arranging the periods in order of size, that is, λ1≥λ2≥,...,≥λp≥0. Then, the eigenvector P corresponding to each eigenvalue can be obtained, and the eigenequation can be solved.(4) Calculation of the Contribution Rate and Total Contribution Rate of Single Principal Component. The principal component contribution rate and total contribution rate are(12)λj∑i=1pλi,∑i=1mλi∑i=1pλi.(5) Selection of the Principal Components That Can Replace the Original Sample Data. The calculation formula of the principal component is(13)lij=pzi,xj=λipij,i,j=1,2,…,p.After the load of each principal component is obtained, the score matrix of financial credit risk evaluation is obtained:(14)Z=z11z12⋯z1mz21z22⋯z2m⋮⋮⋮⋮zn1zn2⋯znm.According to the calculation results of financial credit risk, the evaluation of financial credit risk can be completed, so as to formulate targeted financial credit risk control strategies.


## 3.1. Data Classification

Decision tree is a machine learning algorithm with tree structure, which is composed of root node, nonleaf node, and leaf node. Its structure is shown in Figure1.Figure 1
Structure diagram of the decision tree.The decision tree is a recursive structure. The root node carries out data training and prediction from top to bottom. According to different similarity calculation standards, subsets with certain similarity in the data are divided to generate multiple branches. When reaching the leaf node of the decision tree, the division is stopped. Leaf nodes are set according to the maximum tree depth or the minimum number of leaves. One leaf node represents one classification result of the data. The decision tree can be divided into decision trees based on information entropy, information gain, information gain rate, and Gini impurity according to the different basis of feature division. Assuming that the training sample setD with N financial credit data can be divided into K categories, it establishes the calculation formulas of information entropy, information gain, information gain rate, and Gini impurity of different decision trees as follows:(1)HD=−∑k=1KnkNlog2pnkN,where HD denotes information entropy, nk denotes the number of k_th category, and p represents the probability. Similarly, for information gain, we have(2)gD,a=HD−∑v=1VDvDHDv.For information gain rate, we have(3)gRD,a=gD,a−∑v=1VDv/Dlog2Dv/D.For Gini impurity,(4)GiniD=1−∑k=1KnkN2.Here,nk represents the number of kth category, v represents the number of subsets of the sample set divided according to feature a, and the value range is 1,V [19].Random forest is an integrated learning algorithm based on decision tree. It randomly generates multiple irrelevant decision trees. Each decision tree learns and predicts independently. These predictions are synthesized into single prediction by voting. The category with the most votes is the model prediction result, and its result is better than the decision tree.Suppose the input financial credit training dataset isD, the number of iterations of the decision tree is M, and the generation steps of the random forest are as follows:(1)
Conduct themth sampling on the sample training set, where m is an integer and the value range is 1,M. Randomly collect n times to obtain the training set Dm containing n samples.(2)
When the decision tree is divided into nodes, alln input variables do not fully participate in node splitting, but kk≤n random feature variables are randomly selected, the value of k is generally 2log2n+1, the best feature among the k features is split as a node, and the mth decision tree Gm generated by classification and regression tree CART algorithm is trained.(3)
The CART decision tree is divided into features based on Gini impurity. When the Gini impurity is smaller, the representative impurity is smaller, and its features are better. Finally,M CART decision trees are generated to form a random forest.(4)
Determine the type of data by calculating the number of votes. The flow of random forest algorithm is shown in Figure2.Figure 2
Flow chart of the random forest algorithm.The decision tree algorithm is fast and easy to understand, but it is easy to over fit, and when dealing with unbalanced data, the feature division tends to choose features with more values. Compared with the decision tree algorithm, random forest has high accuracy and is not easy to over fit, but in unbalanced datasets, the classification accuracy of a few classes is still not high. Aiming at the classification problem of unbalanced datasets, an accurate classification method based on weighted random forest lifting is proposed.In order to minimize the overall error rate, the machine learning algorithm will ignore the classification of classes with less data, and it is easy to form a model conducive to the classification of most classes during training [2]. In order to improve this situation, the weighted random forest follows the idea of cost sensitive learning, increases the influence of fewer classes by giving more weight to fewer classes, and balances the relationship between samples, which can make the generated model more suitable for unbalanced data and improve the accuracy of classification results of a few data.Class weight is mainly reflected in the following:(1) The growth process of decision tree, the reductionΔgi of weighted Gini impurity GI is used to find the optimal division feature. The larger the value, the smaller the representative impure, and the better the separation result. The calculation formula is(5)GIJ=∑i=1KniWi2∑i=1KniWi,Δgi=GIJ−GIJL−GIJR.Here,K represents the total number of categories, J represents the sample set at the nonseparated node, JL represents the separated left node sample set, JR represents the separated node sample set, ni represents the number of various samples in the node, and Wi represents the class weight value assigned to each class.(2) When determining the category at the leaf node, the final classification resultc is determined by combining the weighted voting of each decision tree. The calculation formula is(6)c=argmaxiniWi.Through the above calculation, the classification of financial credit data for subsequent financial credit risk assessment is completed.


## 3.2. Financial Credit Risk Assessment

### 3.2.1. Construction of Financial Credit Risk Evaluation Index

(1) Principles for Construction of the Evaluation Index System.(1)
Principle of comprehensivenessThe evaluation index system of personal credit risk of commercial banks must cover all factors affecting credit risk control. On the one hand, the impact of personal factors on credit risk should be considered; on the other hand, the impact of social environmental factors of lenders should be considered. Only by ensuring the comprehensiveness of the evaluation index system we can ensure the accuracy of credit evaluation of borrowers [20, 21].(2)
System optimization principleEnsuring the comprehensiveness of the evaluation index system does not mean that the more indicators the better. The selection of the index system must take into account the system optimization principle, that is, select important indicators, and eliminate those redundant indicators with the same impact level, so that the whole index system can fully reflect the actual situation of the lender and form an interconnected unity.(3)
OperabilityThe selection of personal credit risk evaluation indicators must be combined with the actual situation, select those indicators that can obtain the actual data, and ensure the reliability and accuracy of these data. If some indicators cannot obtain the original data, or the obtained data are inaccurate, it has no practical significance in the evaluation process and may even cause deviation in the evaluation results.(4)
Dynamic principleAfter the completion of the personal credit risk evaluation index system, it is not invariable. It can change dynamically according to the actual situation. Specifically, the indicators can be adjusted according to the lender’s personal basic situation or changes in the economic environment.(5)
Principle of legality and fairnessLegitimacy means that the establishment of the index system must be consistent with the national macroeconomic policies and comply with the provisions of relevant laws and regulations; fairness means that the establishment of personal credit risk evaluation index system is objective and fair. It is based on objective facts, which can scientifically and accurately reflect the basic attributes of commercial banks and loan applicants and does not favor either party.The personal credit risk evaluation index system is selected by analyzing the evaluation index system established by relevant research institutes at home and abroad, drawing on the relevant experience of domestic and foreign experts on personal credit risk evaluation research and combining the possibility of obtaining correct data for each specific index, a set of evaluation index system including personal basic information. The second level index system of personal credit risk evaluation was based on three first level indexes of economic status and reputation status. The specific index system is shown in Table1.Table 1
Credit risk evaluation index system.
Serial numberPrimary indexSecondary indexRisk factor marker1Basic personal informationAgeu11Marital statusu12Genderu13Education levelu14Occupation typeu15Dutiesu162Economic situationMonthly incomeu21Ratio of average monthly repayment to monthly disposable incomeu22Loan termu23Loan amountu24Bank account recordsu253Personal honor statusHistory of loans, overdrafts, and guaranteesu31Personal judicial recordsu32Other bad reputation recordsu33(2) Basic Personal Information Indicators.(1)
AgeGenerally, the probability of default of the lender decreases with the increase in age. Borrowers under the age of 20 may have no fixed economic income, but there are very few borrowers in this age group, so the risk of default is not high; at the age of 35–55, the lender in this age group has generally made achievements in his career, and his income is relatively stable, and his ability to repay the loan is generally strong; after the age of 55, with the growth of age, the expenditure on medical treatment and life may gradually increase, and the default risk of this part of people may be relatively high.(2)
Marital statusStatistics show that there is not much difference in loan default rate between unmarried borrowers and married borrowers, and married borrowers are slightly lower.(3)
GenderCombining the two groups of statistical data on male and female loan default rates, it can be found that this group of statistical data shows that the male lender default rate is higher than the female lender default rate, and the difference in default rate of this group of data is about 6%.(4)
Education levelUsually, with the continuous improvement of the lender’s education, the probability of default will decrease. The personal quality of the lender is generally positively correlated with the level of education. The lender with a high level of education may have stronger self-restraint ability, so his personal reputation is relatively high.(5)
Occupation typeThe occupation type of the applicant is closely related to the bank’s decision whether to lend to him. The unemployed will not become the loan object of the commercial bank. Borrowers have different occupations, and their income also varies greatly. Borrowers with good career prospects and stable income will generally become potential customers of commercial banks.(6)
PositionThe loan default rate is also related to the position of the lender. The lender with relatively high position may pay more attention to personal reputation, so the probability of default may be low.(3) Economic Indicators. (1)
Monthly incomeIt is of great significance to judge the default risk of loan applicants. Generally speaking, it is considered that the higher the monthly income, the lower the default risk, otherwise the higher. When the loan applicant has the same willingness to repay, the higher the income level, the stronger the repayment ability. There is a positive correlation between the income and the borrower’s repayment ability.(2)
Proportion of monthly repayment in monthly disposable income.The proportion of monthly repayment in monthly disposable income is also an important indicator to measure the lender’s repayment ability. The monthly repayment amount refers to the amount of loan interest and principal repaid by the lender to the bank every month, and the monthly disposable income is the remaining income after the lender’s monthly income minus the amount of loan interest and principal repaid to the bank every month. Theoretically, the ratio value fluctuates between 0.1. The smaller the ratio value, the better the financial situation of the borrower.(3)
Loan termThe loan term refers to the time period from the time when the commercial bank issues the loan to the lender to the time when the lender pays off all the loan and interest. The length of the loan term is closely related to the loan interest rate. Generally, the longer the loan term, the higher the loan interest rate. The probability of default is relatively high for customers with long loan term than short loan term. The longer the loan term, the worse the liquidity and the higher the risk.(4)
Loan amountThe loan amount is closely related to the loan applicant’s application amount and the applicant’s credit rating. Generally, lenders with relatively small loan amount have relatively low probability of default, while customers with high probability of default are mainly concentrated in the range with relatively high loan amount. Therefore, including the loan amount in the personal credit risk evaluation index system is of great significance for commercial banks to adopt appropriate risk aversion measures according to the loan amount.(5)
Bank account recordsBank account records mainly refer to the records of customers opening accounts and handling bank cards in this commercial bank. Generally, the default risk of users who do not open an account in the loan application bank is higher than that of the lender who has opened an account.(4) Personal Reputation Indicators(1)
Historical credit historyHistorical credit records refer to the past loan repayment, credit card overdraft information, guarantee, and other information of the loan applicant. Through the review of the loan applicant’s historical credit records, we can preliminarily judge the credit situation of the loan applicant and the probability of default risk in the future.(2)
Personal judicial recordsThe review of personal judicial records is mainly to investigate whether the loan applicant has a criminal record in the past, which is only a supplementary indicator.(3)
Other records of reputation damage.This includes personal reputation indicators other than historical credit records and personal judicial records, including whether the lender has tax evasion, arrears of water, electricity costs, etc.


### 3.2.2. Financial Credit Risk Assessment Based on Principal Component Analysis

The principal component analysis method is used for financial credit risk assessment. The principal component analysis method is the basic means of multivariable data analysis. Its main idea is map a group of multivariable information to several principal components, analyze and process the principal components as the overall information, and there is no linear correlation between the principal components; therefore, the dimension of the original data is reduced, the redundant information is effectively eliminated, and the noise in the original information is effectively suppressed. It is especially suitable for dealing with the situation that there are many and complex original data samples. It can effectively reduce the dimension and denoise and improve the convergence accuracy and risk assessment accuracy of financial and credit data.IfX is an m×n-dimensional data sample set, the input is Xn×m and the output is Yn×m. The kth principal component is Pk=P1k,P2k,...,PnkT,k=1,2,...,m; the principal component matrix (i.e., principal component score matrix) is the crossproduct of X and principal component load:(7)T=XP.Here, the single variable in the score matrix is Tij=∑kmPkjXik and the Tj=∑kmXkPkj variable is j.(1) Data Standardization Processing. The original financial loan risk data shall be processed as follows:(8)Xij′=Xij−MjSj,Mj=1n∑1nXij,Sj=1n−1∑1nXij−Mj2.Here,Xij′ represents the standardized new financial credit risk data, and Mj and Sj represent the arithmetic mean and standard deviation of a column of the original financial credit risk data, respectively.(2) Calculation of Characteristic Matrix D of the Original Matrix(9)D=XTX.The covariance is as follows:(10)D=d11d12⋯d1pd21d22⋯d2p⋮⋮⋮⋮dp1dp2⋯dpp,dij=∑k=1nxki−x¯ixkj−x¯j∑k=1nxki−x¯i2∑k=1nxkj−x¯j2.(3) Calculation of Eigenvector P and Eigenroot(11)DP=Pλ.When only thejth eigenvalue is considered, there is DPj=Pjλj, that is, D−λjI=0. Solving λ and arranging the periods in order of size, that is, λ1≥λ2≥,...,≥λp≥0. Then, the eigenvector P corresponding to each eigenvalue can be obtained, and the eigenequation can be solved.(4) Calculation of the Contribution Rate and Total Contribution Rate of Single Principal Component. The principal component contribution rate and total contribution rate are(12)λj∑i=1pλi,∑i=1mλi∑i=1pλi.(5) Selection of the Principal Components That Can Replace the Original Sample Data. The calculation formula of the principal component is(13)lij=pzi,xj=λipij,i,j=1,2,…,p.After the load of each principal component is obtained, the score matrix of financial credit risk evaluation is obtained:(14)Z=z11z12⋯z1mz21z22⋯z2m⋮⋮⋮⋮zn1zn2⋯znm.According to the calculation results of financial credit risk, the evaluation of financial credit risk can be completed, so as to formulate targeted financial credit risk control strategies.


## 3.2.1. Construction of Financial Credit Risk Evaluation Index

(1) Principles for Construction of the Evaluation Index System.(1)
Principle of comprehensivenessThe evaluation index system of personal credit risk of commercial banks must cover all factors affecting credit risk control. On the one hand, the impact of personal factors on credit risk should be considered; on the other hand, the impact of social environmental factors of lenders should be considered. Only by ensuring the comprehensiveness of the evaluation index system we can ensure the accuracy of credit evaluation of borrowers [20, 21].(2)
System optimization principleEnsuring the comprehensiveness of the evaluation index system does not mean that the more indicators the better. The selection of the index system must take into account the system optimization principle, that is, select important indicators, and eliminate those redundant indicators with the same impact level, so that the whole index system can fully reflect the actual situation of the lender and form an interconnected unity.(3)
OperabilityThe selection of personal credit risk evaluation indicators must be combined with the actual situation, select those indicators that can obtain the actual data, and ensure the reliability and accuracy of these data. If some indicators cannot obtain the original data, or the obtained data are inaccurate, it has no practical significance in the evaluation process and may even cause deviation in the evaluation results.(4)
Dynamic principleAfter the completion of the personal credit risk evaluation index system, it is not invariable. It can change dynamically according to the actual situation. Specifically, the indicators can be adjusted according to the lender’s personal basic situation or changes in the economic environment.(5)
Principle of legality and fairnessLegitimacy means that the establishment of the index system must be consistent with the national macroeconomic policies and comply with the provisions of relevant laws and regulations; fairness means that the establishment of personal credit risk evaluation index system is objective and fair. It is based on objective facts, which can scientifically and accurately reflect the basic attributes of commercial banks and loan applicants and does not favor either party.The personal credit risk evaluation index system is selected by analyzing the evaluation index system established by relevant research institutes at home and abroad, drawing on the relevant experience of domestic and foreign experts on personal credit risk evaluation research and combining the possibility of obtaining correct data for each specific index, a set of evaluation index system including personal basic information. The second level index system of personal credit risk evaluation was based on three first level indexes of economic status and reputation status. The specific index system is shown in Table1.Table 1
Credit risk evaluation index system.
Serial numberPrimary indexSecondary indexRisk factor marker1Basic personal informationAgeu11Marital statusu12Genderu13Education levelu14Occupation typeu15Dutiesu162Economic situationMonthly incomeu21Ratio of average monthly repayment to monthly disposable incomeu22Loan termu23Loan amountu24Bank account recordsu253Personal honor statusHistory of loans, overdrafts, and guaranteesu31Personal judicial recordsu32Other bad reputation recordsu33(2) Basic Personal Information Indicators.(1)
AgeGenerally, the probability of default of the lender decreases with the increase in age. Borrowers under the age of 20 may have no fixed economic income, but there are very few borrowers in this age group, so the risk of default is not high; at the age of 35–55, the lender in this age group has generally made achievements in his career, and his income is relatively stable, and his ability to repay the loan is generally strong; after the age of 55, with the growth of age, the expenditure on medical treatment and life may gradually increase, and the default risk of this part of people may be relatively high.(2)
Marital statusStatistics show that there is not much difference in loan default rate between unmarried borrowers and married borrowers, and married borrowers are slightly lower.(3)
GenderCombining the two groups of statistical data on male and female loan default rates, it can be found that this group of statistical data shows that the male lender default rate is higher than the female lender default rate, and the difference in default rate of this group of data is about 6%.(4)
Education levelUsually, with the continuous improvement of the lender’s education, the probability of default will decrease. The personal quality of the lender is generally positively correlated with the level of education. The lender with a high level of education may have stronger self-restraint ability, so his personal reputation is relatively high.(5)
Occupation typeThe occupation type of the applicant is closely related to the bank’s decision whether to lend to him. The unemployed will not become the loan object of the commercial bank. Borrowers have different occupations, and their income also varies greatly. Borrowers with good career prospects and stable income will generally become potential customers of commercial banks.(6)
PositionThe loan default rate is also related to the position of the lender. The lender with relatively high position may pay more attention to personal reputation, so the probability of default may be low.(3) Economic Indicators. (1)
Monthly incomeIt is of great significance to judge the default risk of loan applicants. Generally speaking, it is considered that the higher the monthly income, the lower the default risk, otherwise the higher. When the loan applicant has the same willingness to repay, the higher the income level, the stronger the repayment ability. There is a positive correlation between the income and the borrower’s repayment ability.(2)
Proportion of monthly repayment in monthly disposable income.The proportion of monthly repayment in monthly disposable income is also an important indicator to measure the lender’s repayment ability. The monthly repayment amount refers to the amount of loan interest and principal repaid by the lender to the bank every month, and the monthly disposable income is the remaining income after the lender’s monthly income minus the amount of loan interest and principal repaid to the bank every month. Theoretically, the ratio value fluctuates between 0.1. The smaller the ratio value, the better the financial situation of the borrower.(3)
Loan termThe loan term refers to the time period from the time when the commercial bank issues the loan to the lender to the time when the lender pays off all the loan and interest. The length of the loan term is closely related to the loan interest rate. Generally, the longer the loan term, the higher the loan interest rate. The probability of default is relatively high for customers with long loan term than short loan term. The longer the loan term, the worse the liquidity and the higher the risk.(4)
Loan amountThe loan amount is closely related to the loan applicant’s application amount and the applicant’s credit rating. Generally, lenders with relatively small loan amount have relatively low probability of default, while customers with high probability of default are mainly concentrated in the range with relatively high loan amount. Therefore, including the loan amount in the personal credit risk evaluation index system is of great significance for commercial banks to adopt appropriate risk aversion measures according to the loan amount.(5)
Bank account recordsBank account records mainly refer to the records of customers opening accounts and handling bank cards in this commercial bank. Generally, the default risk of users who do not open an account in the loan application bank is higher than that of the lender who has opened an account.(4) Personal Reputation Indicators(1)
Historical credit historyHistorical credit records refer to the past loan repayment, credit card overdraft information, guarantee, and other information of the loan applicant. Through the review of the loan applicant’s historical credit records, we can preliminarily judge the credit situation of the loan applicant and the probability of default risk in the future.(2)
Personal judicial recordsThe review of personal judicial records is mainly to investigate whether the loan applicant has a criminal record in the past, which is only a supplementary indicator.(3)
Other records of reputation damage.This includes personal reputation indicators other than historical credit records and personal judicial records, including whether the lender has tax evasion, arrears of water, electricity costs, etc.


## 3.2.2. Financial Credit Risk Assessment Based on Principal Component Analysis

The principal component analysis method is used for financial credit risk assessment. The principal component analysis method is the basic means of multivariable data analysis. Its main idea is map a group of multivariable information to several principal components, analyze and process the principal components as the overall information, and there is no linear correlation between the principal components; therefore, the dimension of the original data is reduced, the redundant information is effectively eliminated, and the noise in the original information is effectively suppressed. It is especially suitable for dealing with the situation that there are many and complex original data samples. It can effectively reduce the dimension and denoise and improve the convergence accuracy and risk assessment accuracy of financial and credit data.IfX is an m×n-dimensional data sample set, the input is Xn×m and the output is Yn×m. The kth principal component is Pk=P1k,P2k,...,PnkT,k=1,2,...,m; the principal component matrix (i.e., principal component score matrix) is the crossproduct of X and principal component load:(7)T=XP.Here, the single variable in the score matrix is Tij=∑kmPkjXik and the Tj=∑kmXkPkj variable is j.(1) Data Standardization Processing. The original financial loan risk data shall be processed as follows:(8)Xij′=Xij−MjSj,Mj=1n∑1nXij,Sj=1n−1∑1nXij−Mj2.Here,Xij′ represents the standardized new financial credit risk data, and Mj and Sj represent the arithmetic mean and standard deviation of a column of the original financial credit risk data, respectively.(2) Calculation of Characteristic Matrix D of the Original Matrix(9)D=XTX.The covariance is as follows:(10)D=d11d12⋯d1pd21d22⋯d2p⋮⋮⋮⋮dp1dp2⋯dpp,dij=∑k=1nxki−x¯ixkj−x¯j∑k=1nxki−x¯i2∑k=1nxkj−x¯j2.(3) Calculation of Eigenvector P and Eigenroot(11)DP=Pλ.When only thejth eigenvalue is considered, there is DPj=Pjλj, that is, D−λjI=0. Solving λ and arranging the periods in order of size, that is, λ1≥λ2≥,...,≥λp≥0. Then, the eigenvector P corresponding to each eigenvalue can be obtained, and the eigenequation can be solved.(4) Calculation of the Contribution Rate and Total Contribution Rate of Single Principal Component. The principal component contribution rate and total contribution rate are(12)λj∑i=1pλi,∑i=1mλi∑i=1pλi.(5) Selection of the Principal Components That Can Replace the Original Sample Data. The calculation formula of the principal component is(13)lij=pzi,xj=λipij,i,j=1,2,…,p.After the load of each principal component is obtained, the score matrix of financial credit risk evaluation is obtained:(14)Z=z11z12⋯z1mz21z22⋯z2m⋮⋮⋮⋮zn1zn2⋯znm.According to the calculation results of financial credit risk, the evaluation of financial credit risk can be completed, so as to formulate targeted financial credit risk control strategies.


## 4. Experimental Verification

### 4.1. Experimental Setup

We used Python’s machine learning library Scikit-learn [22] to do our experiments. Scikit-learn is an open source machine learning library written in Python that provides efficient implementations of various machine learning algorithms. It takes advantage of Python interactivity and modularity to supply fast and easy prototyping [22, 23]. The ML library is used in Windows environment, with a standalone system having specification of Intel® Core™ i3-4010U CPU @ 1.70 GHz, to simulate the credit risk assessment problem.


### 4.2. The Dataset

The sample data selected in this paper are the real data from the personal credit database of a branch of a commercial bank. In this paper, 75 data samples are randomly selected in the personal credit database. Among them, there are individual data missing or the data are obviously in line with the actual situation. After removing these invalid samples, 61 valid samples are determined. There are 40 learning samples and 21 test samples. The training samples are shown in Table2.Table 2
Training samples.
Serial numberAgeEducation levelOccupation typeMonthly incomeLoan termLoan amountHistorical credit historyOutput value124443001010000000240355500152000000033555600020250000104233325001510000031533343800151500000065013250010120000117323110000303000001182846330056000021949133200101300002110265445002030000000……30382438001520000010314223410020350000013227432000303000002133224617003020000000344041200005800000013525331900303500213625432100203000000037403543002033000000383854550030450000003921331600302500000140264322003040000031The quantitative table of qualitative indicators is shown in Table3.Table 3
Quantitative table of qualitative indicators.
IndexCharacteristicsQuantized valueQuantitative table of individual credit risk evaluation indicatorsEducational backgroundGraduate degree or above5Bachelor degree4College degree3High school/technical secondary school degree2Compulsory education and below1Occupation typeManagement personnel5Technician4Employee/worker3Farmer2Other1In order to fully verify the performance of the proposed method, comparative verification experiments are carried out. The experimental scheme is set as follows: taking the accuracy of financial credit risk data classification and risk assessment as the experimental comparison index, the proposed method is compared with the financial credit risk assessment method based on particle swarm optimization algorithm proposed in [12] and the financial credit risk assessment method based on stack noise reduction self-coding network proposed in [13].


### 4.3. Evaluation Criteria

To evaluate the weighted random forest algorithms on the selected dataset, accuracy is considered as the evaluation criterion, where accuracy is the rate of correct predictions made by the model:(15)accuracy=TP+TNTP+FP+FN+TN.


### 4.4. Classification Accuracy

We tested the algorithm on 40 test samples of the dataset. The samples contained 22 negative samples and 18 positive samples. Out of 40, 39 samples were classified correctly, achieving an accuracy rate of 97.5 for the particular dataset. Confusion matrix of the weighted RF algorithm for credit risk assessment is shown in Table4.Table 4
Confusion matrix of the weighted RF algorithm for credit risk assessment.
TN = 21FP = 1FN = 0TP = 18The comparison results of financial credit risk data classification accuracy of the three methods are shown in Figure3.Figure 3
Comparison of the proposed method with two other methods.From the comparison results of classification accuracy of financial and credit risk data shown in Figure3, it can be seen that the classification accuracy of the proposed method is always higher than the two traditional comparison methods, and the classification accuracy of the method in this paper is always maintained at about 95%.


### 4.5. Accuracy of Financial Credit Risk Assessment

The comparison results of financial credit risk assessment accuracy of the three methods are shown in Figure4.Figure 4
Comparison of the accuracy of the three methods.By observing the accuracy results of financial credit risk assessment shown in Figure4, it is not difficult to see that the risk threshold of the proposed method is basically consistent with the actual results, while the risk threshold of the two literature comparison methods is quite different from the actual value.


## 4.1. Experimental Setup

We used Python’s machine learning library Scikit-learn [22] to do our experiments. Scikit-learn is an open source machine learning library written in Python that provides efficient implementations of various machine learning algorithms. It takes advantage of Python interactivity and modularity to supply fast and easy prototyping [22, 23]. The ML library is used in Windows environment, with a standalone system having specification of Intel® Core™ i3-4010U CPU @ 1.70 GHz, to simulate the credit risk assessment problem.


## 4.2. The Dataset

The sample data selected in this paper are the real data from the personal credit database of a branch of a commercial bank. In this paper, 75 data samples are randomly selected in the personal credit database. Among them, there are individual data missing or the data are obviously in line with the actual situation. After removing these invalid samples, 61 valid samples are determined. There are 40 learning samples and 21 test samples. The training samples are shown in Table2.Table 2
Training samples.
Serial numberAgeEducation levelOccupation typeMonthly incomeLoan termLoan amountHistorical credit historyOutput value124443001010000000240355500152000000033555600020250000104233325001510000031533343800151500000065013250010120000117323110000303000001182846330056000021949133200101300002110265445002030000000……30382438001520000010314223410020350000013227432000303000002133224617003020000000344041200005800000013525331900303500213625432100203000000037403543002033000000383854550030450000003921331600302500000140264322003040000031The quantitative table of qualitative indicators is shown in Table3.Table 3
Quantitative table of qualitative indicators.
IndexCharacteristicsQuantized valueQuantitative table of individual credit risk evaluation indicatorsEducational backgroundGraduate degree or above5Bachelor degree4College degree3High school/technical secondary school degree2Compulsory education and below1Occupation typeManagement personnel5Technician4Employee/worker3Farmer2Other1In order to fully verify the performance of the proposed method, comparative verification experiments are carried out. The experimental scheme is set as follows: taking the accuracy of financial credit risk data classification and risk assessment as the experimental comparison index, the proposed method is compared with the financial credit risk assessment method based on particle swarm optimization algorithm proposed in [12] and the financial credit risk assessment method based on stack noise reduction self-coding network proposed in [13].


## 4.3. Evaluation Criteria

To evaluate the weighted random forest algorithms on the selected dataset, accuracy is considered as the evaluation criterion, where accuracy is the rate of correct predictions made by the model:(15)accuracy=TP+TNTP+FP+FN+TN.


## 4.4. Classification Accuracy

We tested the algorithm on 40 test samples of the dataset. The samples contained 22 negative samples and 18 positive samples. Out of 40, 39 samples were classified correctly, achieving an accuracy rate of 97.5 for the particular dataset. Confusion matrix of the weighted RF algorithm for credit risk assessment is shown in Table4.Table 4
Confusion matrix of the weighted RF algorithm for credit risk assessment.
TN = 21FP = 1FN = 0TP = 18The comparison results of financial credit risk data classification accuracy of the three methods are shown in Figure3.Figure 3
Comparison of the proposed method with two other methods.From the comparison results of classification accuracy of financial and credit risk data shown in Figure3, it can be seen that the classification accuracy of the proposed method is always higher than the two traditional comparison methods, and the classification accuracy of the method in this paper is always maintained at about 95%.


## 4.5. Accuracy of Financial Credit Risk Assessment

The comparison results of financial credit risk assessment accuracy of the three methods are shown in Figure4.Figure 4
Comparison of the accuracy of the three methods.By observing the accuracy results of financial credit risk assessment shown in Figure4, it is not difficult to see that the risk threshold of the proposed method is basically consistent with the actual results, while the risk threshold of the two literature comparison methods is quite different from the actual value.


## 5. Conclusion

The awareness of credit risk and virtuous asset cycle forces China’s commercial banks to establish an effective credit risk monitoring and control platform. From the perspective of the virtuous cycle of commercial bank loans, establishing a scientific and reasonable credit risk evaluation index system and realizing the credit risk evaluation model of commercial banks has a certain practical significance for the benign development of the financial industry, the healthy development of China’s national economy, and the prevention of the global credit crisis. Therefore, a financial credit risk control strategy based on the weighted random forest algorithm is proposed to verify the performance of the method from both theoretical and experimental aspects. This method has high accuracy in financial credit risk data classification and financial credit risk assessment. Specifically, compared with the method based on particle swarm optimization, the classification accuracy of financial and credit risk data is significantly improved and always maintained at more than 95%, and compared with the method based on stack noise reduction self-coding network, the risk threshold is consistent with the actual results.



---

*Source: 6276155-2021-10-19.xml*