Bank data analysis method based on XGBoost model local interpretable rule set construction
By adopting the local interpretable rule set construction method of the XGBoost model in bank loan business, the problem of lack of interpretability of existing models is solved, and decision-making paths are provided, which improves the credibility of the model and the user's decision-making dependence.
Patent Information
- Application Number
- CN202411023283.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-11-15
AI Technical Summary
The lack of interpretability in existing machine learning models in bank loan business has led to practitioners being unable to determine the basis for model decisions, which in turn affects trust and decision-making dependence.
The local interpretable rule set construction method based on the XGBoost model is adopted, and the decision path is generated by extracting and merging the rule sets, providing the basis and reference for model decisions.
The classification performance of the XGBoost model is maintained, while providing users with decision-making paths, which improves the trust and importance of personal loan personnel in the predicted results of machine learning models, and enhances the interpretability and credibility of the results.
Smart Images

Figure CN118967299A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of bank loan business, and in particular to a bank data analysis method based on a local interpretable rule set of an XGBoost model. Background Art
[0002] In recent years, commercial banks have continuously developed personal loan business and expanded their credit scale. At the same time, credit risks have gradually become apparent. Bank employees have introduced machine learning to mine useful information from massive data and use historical data to provide reference for current decisions. Personal loan personnel can refer to the prediction results of machine learning when making decisions, but most of the existing machine learning models are not interpretable, that is, users can get the decisions made by the model, but cannot know the basis for the model to make the decision. Therefore, personal loan personnel are not sure whether they can trust the prediction results of the machine learning model when using it in practice.
[0003] At present, commercial banks still cannot fully trust the conclusions drawn by machine learning models in actual work, because practitioners have no way of understanding the basis on which the model makes decisions. Therefore, most of the time, judgments are made based on the experience of practitioners, and the model's prediction results are only considered as a small factor. Summary of the invention
[0004] The present invention proposes a bank data analysis method based on a local interpretable rule set of the XGBoost model. The local interpretable rule set for the XGBoost classification model can retain the classification performance of the XGBoost model while providing users with a decision path as a reference. The specific technical solution is as follows.
[0005] The bank data analysis method based on the local interpretable rule set of the XGBoost model includes the following steps:
[0006] Step S1: The bank inputs historical personal loan data and trains the XGBoost classification model based on a local interpretable rule set. The XGBoost classification model predicts the class probability of the sample data.
[0007] Step S2: When a customer needs to apply for a personal loan and submits materials to the bank to apply for a personal loan, the customer information is input into the trained XGBoost classification model;
[0008] Step S3: The XGBoost classification model identifies the customer type and obtains the source of the model's conclusion by constructing a local interpretable rule set. If the user has any questions about the final conclusion, the decision path can be provided to the customer as part of the basis.
[0009] Specifically, the acquisition of the local interpretable rule set includes:
[0010] For an input data sample x, extract a rule set from the XGBoost classification model, which contains n_estimators rule sets, and each rule set corresponding to the n_estimators rule sets contains num_class rule sets;
[0011] After the data sample is input, traverse the rule sets from conjunction_set[0][0] to conjunction_set[n-1][num_class-1], and filter out the rules that can contain the data sample x from each rule set;
[0012] After filtering, n_estimators*num_class rules can be obtained, and the rules are expressed as follows:
[0013]
[0014] 0≤i <n estimators ;
[0015] 0≤j <num_class;
[0016] Merge the rules with the same subscript j and finally output a local interpretable rule set with num_class as the number of rules.
[0017] Specifically, the training of the XGBoost classification model includes: inputting a local interpretable rule set with a rule number of num_class into the decision path inside the XGBoost classification model, and calculating the prediction probability of each category of the sample by the XGBoost classification model according to the value of the leaf node in each rule finally obtained.
[0018] Specifically, the prediction probability calculation formula for each category of the sample is:
[0019]
[0020] Among them, i represents the i-th category.
[0021] Specifically, the number of rules is num_class, and the local interpretable rule set is a set of rules, each of which represents the decision basis of the XGBoost classification model for determining whether the data sample belongs to the i-th category, and the probability of the XGBoost classification model determining that the data sample belongs to the i-th category.
[0022] Specifically, the step S3 discriminates the customer types, including: loan-eligible customers, customers who need to provide more materials, and rejected customers.
[0023] Beneficial effects of the present invention: The present invention proposes a bank data analysis method based on a local interpretable rule set of the XGBoost model. The local interpretable rule set for the XGBoost classification model can retain the classification performance of the XGBoost model while providing users with a decision path as a reference, so that personal loan personnel can use their own business experience to judge the correctness of the results after obtaining the results, so that the importance of the machine learning model prediction results considered in the final judgment process is improved. Personal loan personnel can also use it as a basis for display when explaining the judgment results to customers. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a flow chart of the bank data analysis method constructed based on the local interpretable rule set of the XGBoost model in the present invention;
[0025] Figure 2 It is a schematic diagram of obtaining a local interpretable rule set in an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described with reference to the accompanying drawings.
[0027] The present invention proposes a bank data analysis method based on the construction of a local interpretable rule set of the XGBoost model. When a customer needs to apply for a personal loan and submits materials to the bank to apply for a personal loan, the bank can train the XGBo ost classification model through historical data. The XGBoost classification model can be used to distinguish new applicants into customers who are eligible for a loan, users who provide more materials, and rejected customers. By constructing a local interpretable rule set, it can be obtained that the model is based on the conditions under which the conclusion is drawn. If the user has any questions about the final conclusion, the decision path can be provided to the customer as part of the basis. Whether it is in the decision-making of bank employees or in the emotional soothing of customers, the local interpretable rule set has a positive effect. In this embodiment, if Figure 1 As shown, the following steps are included:
[0028] Step S1: The bank inputs historical personal loan data and trains the XGBoost classification model based on a local interpretable rule set. The XGBoost classification model predicts the class probability of the sample data.
[0029] Step S2: When a customer needs to apply for a personal loan and submits materials to the bank to apply for a personal loan, the customer information is input into the trained XGBoost classification model;
[0030] Step S3: The XGBoost classification model identifies the customer type and obtains the source of the model's conclusion by constructing a local interpretable rule set. If the user has any questions about the final conclusion, the decision path can be provided to the customer as part of the basis.
[0031] In this embodiment, obtaining the local interpretable rule set specifically includes:
[0032] For an input data sample x, extract a rule set from the XGBoost classification model, which contains n_estimators rule sets, and each rule set corresponding to the n_estimators rule sets contains num_class rule sets;
[0033] After the data sample is input, traverse the rule sets from conjunction_set[0][0] to conjunction_set[n-1][num_class-1], and filter out the rules that can contain the data sample x from each rule set;
[0034] After filtering, n_estimators*num_class rules can be obtained, and the rules are expressed as follows:
[0035]
[0036] 0≤i <n estimators ;
[0037] 0≤j <num_class;
[0038] Merge the rules with the same subscript j and finally output a local interpretable rule set with num_class as the number of rules.
[0039] In this embodiment, training the XGBoost classification model includes: inputting a local interpretable rule set with a rule number of num_class into the decision path inside the XGBoost classification model, and calculating the prediction probability of each category of the sample by the XGBoost classification model based on the value of the leaf node in each rule finally obtained.
[0040] In this embodiment, the prediction probability calculation formula for each category of the sample is:
[0041]
[0042] Among them, i represents the i-th category.
[0043] In this embodiment, the number of rules is num_class, and the local interpretable rule set is used, wherein each rule represents the decision basis of the XGBoost classification model for determining whether the data sample belongs to the i-th category, and the probability of the XGBoost classification model determining that the data sample belongs to the i-th category.
[0044] In this embodiment, step S3 discriminates the customer type, and the discriminated types include: loan-eligible customers, customers who need to provide more materials, and rejected customers.
[0045] In one embodiment, the local interpretable rule set for the XGBoost classification model proposed by the present invention can retain the classification performance of the XGBoost model while providing users with a decision path as a reference, so that personal loan personnel can use their own business experience to judge the correctness of the results after obtaining the results, so that the importance of the machine learning model prediction results in the final judgment process is improved. Personal loan personnel can also use it as a basis for display when explaining the judgment results to customers.
[0046] When a data sample is input into the XGBoost model, it will traverse all the underlying base learners, which is why XGBoost is a black box model. Because it will traverse all the base learners in the XGBoost model, the user cannot understand the internal working mechanism of the XGBoost model, nor can they know the basis on which the model makes decisions. The rules have good interpretability, which enables users to have a more intuitive understanding of the discrimination process, and the decision tree can be conveniently represented as a set of IF-THEN rules. The XG Boost model is an integrated learning model with the CART regression tree as the base learner, so XGBoost can be converted into a set of multiple rule sets. The present invention proposes a local interpretable rule set generation scheme for the XGBoost classification model, and outputs the decision path within the XGBoost model for an input data sample. The process of obtaining a local interpretable rule set for an input data sample x is as follows. Figure 2 shown.
[0047] A set of rules extracted from the XGBoost model, which contains n_estimators rule sets. Figure 2In the example, n refers to n_estimators. Each rule set corresponding to n_estimators rule sets contains num_class rule sets. After the data sample is input, the rule sets from conjunction_set[0][0] to conjunction_set[n-1][num_class-1] are traversed, and the rules that can contain the data sample x are filtered out from each rule set. After filtering, n_estimators*num_class rules can be obtained, and the rules are expressed as:
[0048]
[0049] Merge the rules with the same subscript j and finally output a local interpretable rule set with num_class as the number of rules.
[0050] After the above steps, the decision path inside the XGBoost model is obtained after the data sample is input into the model. The prediction probability of each category of the sample by XGBoost can be calculated based on the leaf node values of each rule obtained at the end. The prediction probability calculation formula for the data sample being the i-th category is:
[0051]
[0052] The local interpretable method ultimately results in a rule set that includes num_class rules, each of which represents the decision basis for the XGBoost model to determine whether the data sample belongs to the i-th class and the probability that the XGBoost model determines that the data sample belongs to the i-th class.
[0053] The output of the local interpretable rule set is the decision path of a data sample in the XGBoost classification model, which presents the path of the data sample in the XGBoost classification model to the user in the form of a rule set. The local interpretable rule set can maintain the classification performance consistent with the XGBoost classification model.
[0054] The present invention has shown and described the basic principles and main features of the present invention and the advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A bank data analysis method based on a local interpretable rule set of the XGBoost model, characterized in that: The following steps are involved: Step S1: The bank inputs historical personal loan data and trains the XGBoost classification model based on a local interpretable rule set. The XGBoost classification model predicts the class probability of the sample data. Step S2: When a customer needs to apply for a personal loan and submits materials to the bank to apply for a personal loan, the customer information is input into the trained XGBoost classification model; Step S3: The XGBoost classification model identifies the customer type and obtains the source of the model's conclusion by constructing a local interpretable rule set. If the user has any questions about the final conclusion, the decision path can be provided to the customer as part of the basis.
2. The bank data analysis method based on the XGBoost model local interpretable rule set construction according to claim 1 is characterized in that: The acquisition of the local interpretable rule set specifically includes: For an input data sample x, extract a rule set from the XGBoost classification model, which contains n_estimators rule sets, and each rule set corresponding to the n_estimators rule sets contains num_class rule sets; After the data sample is input, traverse the rule sets from conjunction_set[0][0] to conjunction_set[n-1][num_class-1], and filter out the rules that can contain the data sample x from each rule set; After filtering, n_estimators*num_class rules can be obtained, and the rules are expressed as follows: 0≤i<n estimators ; 0≤j<num_class; Merge the rules with the same subscript j and finally output a local interpretable rule set with num_class as the number of rules.
3. The bank data analysis method based on the XGBoost model local interpretable rule set construction according to claim 2 is characterized in that: The training of the XGBoost classification model includes: inputting a local interpretable rule set with a rule number of num_class into the decision path inside the XGBoost classification model, and calculating the prediction probability of each category of the sample by the XGBoost classification model according to the value of the leaf node in each rule finally obtained.
4. The bank data analysis method based on the XGBoost model local interpretable rule set construction according to claim 3 is characterized in that: The prediction probability calculation formula for each category of samples is: Among them, i represents the i-th category.
5. The bank data analysis method based on the XGBoost model local interpretable rule set construction according to claim 4 is characterized in that: The number of rules is num_class of local interpretable rule sets, where each rule represents XGBo o The st classification model determines whether the data sample is the decision basis for the i-th category, and XGB oo The st classification model determines the probability that the data sample belongs to the i-th category.
6. The XGB-based method according to claim 1 oo The bank data analysis method based on the st model local interpretable rule set is characterized by: The step S3 is to identify the customer type, including: loan-eligible customers, customers who need to provide more materials, and rejected customers.
Citation Information
Cited By
Vehicle experiment data impurity cleaning method and device based on working condition clustering and rule model
CN119622204A
