Credit risk prediction method and system based on decision tree and recursive algorithm
By employing a credit risk prediction method based on decision trees and recursive algorithms, and through the collection and preprocessing of user data, constructing decision trees and combining variables, the method addresses the stability and interpretability issues of existing credit risk prediction technologies, achieving a more efficient and stable risk identification effect.
Patent Information
- Application Number
- CN202411712101.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2026-01-20
AI Technical Summary
Existing credit risk prediction methods suffer from poor stability, low efficiency, and low interpretability. In particular, during variable mining, the accuracy and dimensionality of univariate mining are limited, and the interpretability of variable combinations in decision trees is poor.
A credit risk prediction method based on decision trees and recursive algorithms is adopted. The method involves collecting a user base dataset for preprocessing and feature extraction, randomly selecting several variables to construct a decision tree, and repeating the operation with a recursive algorithm to traverse all decision trees to select the variable combination with the highest risk identification efficiency. Finally, the risk identification effect is evaluated.
It improves the stability, efficiency, and interpretability of credit risk prediction, enhances the dimensionality and information gain of data mining through variable combination, and ensures the interpretability and stability of decision trees.
Smart Images

Figure CN121366031A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of financial risk control, and particularly relates to a credit risk prediction method and system based on a decision tree and a recursive algorithm. BACKGROUND
[0002] Various internet financial service platforms mainly providing credit services often face a large amount of default and fraud risks from loan users. In order to reduce the default and fraud risks from loan users, various tools need to be used to predict the risks of loan users.
[0003] Traditional risk prediction mainly relies on manual judgment, and the prediction efficiency is low and the prediction effect has great instability. With the rapid development of machine learning, deep learning and other technologies and theories, related technologies have also been applied to financial risk prediction. Among them, variable mining is an important task, which aims to discover variables with potential correlation or prediction ability from a large amount of data, so as to better understand the data and build effective models, thereby assisting in judging the credit risk of users.
[0004] However, in the existing method, when performing variable mining, the variables are usually preliminarily screened through iv and other indicators, and then corresponding variables are obtained through comprehensive training of algorithms. This process is mainly single-variable mining, and the accuracy and dimension of data mining are limited. In addition, in the existing single-variable mining, there are often unstable factors affecting the stability of risk prediction. In addition, the existing variable mining based on decision trees often contains many variables, and the interpretability of variable combination is poor.
[0005] In summary, the existing risk prediction method has the problems of poor stability, low efficiency and low interpretability. SUMMARY
[0006] In order to solve the above problems in the prior art, the application provides a credit risk prediction method and system based on a decision tree and a recursive algorithm. The technical problems to be solved by the application are solved through the following technical solutions: In a first aspect, the application provides a credit risk prediction method based on a decision tree and a recursive algorithm, comprising: Step 1: Collecting a user basic data set based on user historical behaviors; the user basic data set includes user basic information, credit data and repayment behaviors; Step 2: Preprocessing the user basic data set to obtain feature data and storing it for later use; Step 3: Randomly selecting a plurality of variables, constructing a decision tree combining the selected plurality of variables and the feature data, and calculating the risk identification efficiency of the decision tree; Step 4: repeat the operation of step 3 using a recursive algorithm to perform variable mining until a preset number of recursive cycles is reached, traverse all decision trees, and select the decision tree with the highest risk identification efficiency as the optimal variable combination, and take the corresponding variable combination of the decision tree as the optimal variable combination; Step 5: based on the optimal variable combination, perform risk identification effect evaluation to obtain a risk prediction result.
[0007] In an embodiment of the present application, step 2 specifically comprises: 2a) cleaning the user base dataset to remove noise data to obtain an optimized dataset; 2b) performing feature extraction on the optimized dataset to obtain key features and patterns in the data to obtain feature data; 2c) storing the feature data in a preset storage system for standby.
[0008] In an embodiment of the present application, in step 2b), the method of performing feature extraction on the optimized dataset comprises principal component analysis, independent component analysis or linear discriminant analysis.
[0009] In an embodiment of the present application, in step 2c), the preset storage system is a distributed file system or a database.
[0010] In an embodiment of the present application, in step 3, the number of selected variables is 1-4, and correspondingly, the depth of the constructed decision tree is not more than 4.
[0011] In an embodiment of the present application, step 4 specifically comprises: 4a) the preset number of recursive cycles is 2000; 4b) repeat the operation of step 3 to obtain 2000 individual decision trees and their corresponding 2000 variable combinations; 4c) traverse all decision trees and select the decision tree with the highest risk identification efficiency, i.e. under the condition of the same risk identification ability, the variable combination with the highest hit sample proportion, as the optimal variable combination.
[0012] In an embodiment of the present application, after obtaining the optimal variable combination, it further comprises: Based on subsequent data samples, continuously observe the risk identification effect of the optimal variable combination to verify the stability of the risk identification effect of the optimal variable combination.
[0013] Secondly, the present application proposes a credit risk prediction system based on decision trees and recursive algorithms, which is used for the method proposed in the first aspect of the present application, and the system comprises: The data acquisition module is configured to collect a user basic data set based on a user historical behavior; the user basic data set comprises user basic information, credit data, and repayment behavior; The preprocessing module is configured to preprocess the user basic data set to obtain feature data and store the feature data for later use. The data mining module is configured to randomly select a plurality of variables, construct a decision tree based on the selected plurality of variables and the feature data, and calculate a risk identification efficiency of the decision tree. The data mining module is further configured to repeatedly perform variable selection and decision tree construction for variable mining until a preset recursive loop number is reached, all decision trees are traversed, and a decision tree with the highest risk identification efficiency is selected, and a variable combination corresponding to the decision tree is selected as an optimal variable combination. The evaluation module is configured to perform risk identification effect evaluation based on the optimal variable combination to obtain a risk prediction result.
[0014] In a third aspect, the present application provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus. The memory is configured to store a computer program. The processor is configured to execute the program stored on the memory to implement the method steps provided in the first aspect of the present application.
[0015] In a fourth aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method steps provided in the first aspect of the present application.
[0016] The present application has the following advantages: The credit risk prediction method based on the decision tree and the recursive algorithm provided by the present application firstly collects a user basic data set based on a user historical behavior and performs feature extraction preprocessing; then a decision tree is constructed based on a plurality of randomly selected variables and extracted feature data, and a risk identification efficiency of the decision tree is calculated; the process of variable selection and decision tree construction is repeated through a recursive algorithm, and finally an optimal variable combination is selected; and risk identification effect evaluation is performed based on the selected optimal variable combination. The method constructs a variable combination based on a decision tree, fully utilizes the information gain between the variable combinations, expands the dimension of data mining, provides an in-depth understanding of the data structure and features through traversal of different combinations, is beneficial to extraction of valuable information, supports more accurate decision and analysis; at the same time, the number of selected variables is limited to limit the depth of the decision tree, which greatly improves the interpretability of the variable combination; and the use of the variable combination also improves the stability, so that the method has the advantages of high stability, high efficiency and high interpretability.
[0017] The application will be described in further detail below with reference to the drawings and embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the drawings required to be used in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort.
[0019] Figure 1 The flowchart of the credit risk prediction method based on the decision tree and the recursive algorithm provided by the present application is shown in the figure. Figure 2 The structural block diagram of the credit risk prediction system based on the decision tree and the recursive algorithm provided by the present application is shown in the figure. DETAILED DESCRIPTION
[0020] In order to further illustrate the technical means and effects adopted by the present application to achieve the predetermined purpose, the specific implementation, structure, features and effects of the three-party multiplex data differentiation storage method according to the present application are described in detail below. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.
[0021] In the description of the embodiments of the present application, unless otherwise specified, " / " represents the meaning of or, for example, A / B can represent A or B: "and / or" in the text is only a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B, and B alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0022] Hereinafter, the terms "first" and "second" are used only for descriptive purposes and cannot be understood as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more features.
[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present application belongs.
[0024] Embodiment one The first aspect of the present application provides a credit risk prediction method based on a decision tree and a recursive algorithm. Please refer to Figure 1, Figure 1 The flowchart of the credit risk prediction method based on the decision tree and the recursive algorithm provided by the present application. The method mainly includes the following steps: Step 1: Collecting a user basic data set based on user historical behaviors; the user basic data set includes user basic information, credit data, and repayment behaviors.
[0025] It can be understood that when collecting data, a large amount of user historical data needs to be obtained, wherein the user basic information can include user's age, name, place of origin, working nature, income level, residence, consumption habit, travel habit, and various types of information. The credit data and repayment behavior of the user are the loan records, credit default records, and repayment overdue situation of the user on various banks, lending websites, and other platforms.
[0026] Step 2: Preprocessing the user basic data set to obtain feature data and storing for future use.
[0027] It can be understood that the amount of original data collected through step 1 is huge and the types are various, which needs to be preprocessed first to extract key features and patterns, so as to realize deeper understanding and efficient use of data, and reserve variables for the next step of data mining.
[0028] It should be noted that before feature extraction, the data needs to be cleaned to remove invalid data including noise data and handle missing data values.
[0029] Then, step 2 can be implemented according to the following steps: 2a) Cleaning the user basic data set to remove noise data and obtaining an optimized data set.
[0030] The specific method of removing noise data and handling missing values can be implemented according to the existing related technology, which is not limited in the present embodiment.
[0031] 2b) Feature extraction is performed on the optimized data set to obtain key features and patterns in the data, and feature data is obtained.
[0032] Optionally, as an implementation manner, the present embodiment can comprehensively use common feature extraction methods such as principal component analysis (PCA) method, independent component analysis (ICA) method, linear discriminant analysis (LDA), etc. to extract key features and patterns.
[0033] 2c) store the feature data in a preset storage system for backup.
[0034] Optionally, the preset storage system can be a distributed file system or a database.
[0035] Step 3: randomly select several variables, combine the selected several variables and the feature data to construct a decision tree, and calculate the risk identification efficiency of the decision tree.
[0036] Generally speaking, the following three points need to be considered when setting up a decision tree: First, the complexity of data: if the data features are more and the relationship is complex, the depth may need to be appropriately increased to better capture the pattern, but too deep may lead to overfitting.
[0037] Second, strong explanatory demand: to ensure the strong interpretability of the decision tree, too deep depth may make the decision tree difficult to interpret, so a balance needs to be struck between interpretability and accuracy.
[0038] Third, computing resources and time cost: the deeper the depth, the greater the computational load, the more computing resources and time required, which needs to be balanced according to actual circumstances.
[0039] Based on the above three considerations, in order to ensure the interpretability of the decision tree, the depth of the decision tree is set to no more than 4.
[0040] Specifically, the embodiment can control the number of selected variables to be 1-4, so as to control the depth of the decision tree to be no more than 4.
[0041] It can be understood that the selected variables can be any type of data in the constructed user base data set, for example, variable 1 can be income, variable 2 can be working conditions, variable 3 can be credit default records, etc.
[0042] After completing the variable selection, the decision tree can be constructed in combination with the feature data obtained in step 2 to perform data mining.
[0043] A decision tree is a supervised learning classification method. Supervised learning mainly gives a set of samples, each sample has a set of attributes and a class, and these classes are determined in advance. Then a classifier is learned, which can give the correct classification to the new object. Such machine learning is called supervised learning.
[0044] In machine learning, a decision tree is a tree-shaped predictive model; it represents a mapping between object attributes and object values. Each node in the tree represents an object, while each branching path represents a possible attribute value, and each leaf node corresponds to the value of the object represented by the path from the root node to the leaf node. Decision trees are a frequently used technique in data mining, which can be used for both analyzing data and making predictions.
[0045] After the decision tree is established, the leaf with the highest risk identification efficiency and the sample proportion are calculated for the current decision tree, and the risk identification efficiency of the current decision tree is obtained. The detailed calculation method can refer to the implementation of the related art.
[0046] Step 4: Repeat the operation of step 3 using a recursive algorithm to perform variable mining until a preset number of recursive loops is reached, traverse all decision trees, and select the decision tree with the highest risk identification efficiency, and the corresponding variable combination as the optimal variable combination.
[0047] Optionally, as an implementation manner, the embodiment can repeat the above variable random extraction and decision tree model construction process through recursive loop calling functions, record each decision tree and its risk performance, select the decision tree with the highest hit sample proportion under the condition of the same risk identification ability, and obtain the optimal variable combination for user risk identification efficiency according to the variables in the decision tree.
[0048] Specifically, step 4 can be implemented according to the following sub-steps: 4a) The number of recursive loops is preset to 2000; 4b) Repeat the operation of step 3 to obtain 2000 individual decision trees and their corresponding 2000 variable combinations.
[0049] 4c) Traverse all decision trees, select the decision tree with the highest risk identification efficiency, i.e. the variable combination with the highest hit sample proportion under the condition of the same risk identification ability, as the optimal variable combination.
[0050] The embodiment uses a recursive algorithm to construct a large number of decision trees in massive data and variables, and mines related variables on each decision tree to discover potential patterns and relationships, which can include the relationship between customer income level and credit risk, the relationship between customer job stability and repayment ability, the relationship between customer historical borrowing behavior and future default probability, etc. For example, it may be found that high-income and job-stable customers have a lower default probability, and customers with multiple overdue repayment records have a higher probability of future default.
[0051] The method can recursively traverse all decision trees by randomly extracting a small number of variable combinations each time through traversal, can deeply understand the data structure and characteristics, can identify important variables closely related to the target variable, and can perform more in-depth analysis, and the depth of each decision tree is not too deep, ensuring the strong interpretability of the decision tree.
[0052] Compared with existing variable mining methods, the variable mining method used in the embodiment has the following advantages: (1) Improve the accuracy and dimensionality of data mining in massive data: The previous method often performs initial screening of variables through iv and other indicators, and obtains corresponding variables through comprehensive training of algorithms. The present application constructs variable combinations based on decision trees, which can fully utilize the information gain between variable combinations to expand the dimensionality of data mining. (2) Improve the interpretability of variable combinations: The previous decision tree often contains many variables. The present application limits the number of selected variables to limit the depth of the decision tree. The variable combination with a limited number greatly improves the interpretability. (3) Enhance the stability of variable effect: In the previous single variable mining, there are often unstable factors. The use of variable combination can effectively improve the stability of the variable.
[0053] Step 5: Based on the optimal variable combination, the risk identification effect is evaluated, and a risk prediction result is obtained.
[0054] Specifically, after obtaining the optimal variable combination, the risk identification effect thereof can be evaluated outside the sample. For example, a user with low income, unstable job, and multiple default records in credit investigation has a high risk of default after loan.
[0055] In addition, after obtaining the optimal variable combination, the risk identification effect of the optimal variable combination can be continuously observed based on subsequent data samples to verify the stability of the risk identification effect of the optimal variable combination.
[0056] If the risk identification effect of the optimal variable combination is stable, it can be applied to the risk policy rule making in loan approval. If there is an unstable situation, the optimal variable combination can be adaptively reselected by increasing the sample data in the user basic data set.
[0057] To sum up, the credit risk prediction method based on the decision tree and the recursive algorithm provided by the application collects a user basic data set based on historical behaviors of a user, and performs feature extraction preprocessing; then a decision tree is constructed by combining a plurality of randomly selected variables and the extracted feature data, and the risk identification efficiency of the decision tree is calculated, the process of variable selection and decision tree construction is repeated by a recursive algorithm, and finally the optimal variable combination is selected, and the risk identification effect is evaluated based on the selected optimal variable combination. The method uses an efficient and adaptive variable mining method, constructs a variable combination based on a decision tree, fully utilizes the information gain between the variable combinations, expands the dimension of data mining, provides an in-depth understanding of the data structure and features through the traversal of different combinations, is beneficial to extracting valuable information, supports more accurate decision and analysis, and at the same time, the number of selected variables is limited to limit the depth of the decision tree, greatly improves the interpretability of the variable combination, and the use of the variable combination also improves the stability, so that the method has the advantages of high stability, high efficiency and high interpretability.
[0058] Embodiment two Based on the same inventive concept, a second aspect of the application also provides a credit risk prediction system based on a decision tree and a recursive algorithm. Please refer to Figure 2 , Figure 2 The structure diagram of the credit risk prediction system based on the decision tree and the recursive algorithm provided by the application is shown in the figure, and the system comprises: A data acquisition module is used to collect a user basic data set based on historical behaviors of a user; the user basic data set comprises user basic information, credit data and repayment behaviors; A preprocessing module is used to preprocess the user basic data set to obtain feature data and store it for future use; A data mining module is used to randomly select a plurality of variables, construct a decision tree in combination with the selected variables and the feature data, and calculate the risk identification efficiency of the decision tree; The data mining module is also used to repeatedly select variables and construct decision trees for variable mining until a preset recursive cycle number is reached, all decision trees are traversed, and the decision tree with the highest risk identification efficiency is selected as the optimal variable combination; An evaluation module is used to evaluate the risk identification effect based on the optimal variable combination, and obtain a risk prediction result.
[0059] Embodiment three The third aspect of the application also provides an electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; The memory is used to store a computer program; The processor is configured to execute the program stored in the memory to implement the method steps of the first embodiment.
[0060] The communication bus of the electronic device can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus can be divided into an address bus, a data bus, a control bus, and the like.
[0061] The communication interface is configured to communicate between the electronic device and other devices.
[0062] The memory can include a Random Access Memory (RAM) and can also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the processor.
[0063] The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; and can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0064] The method provided by the embodiments of the present application can be applied to an electronic device. Specifically, the electronic device can be a desktop computer, a portable computer, a smart mobile terminal, a server, and the like. Herein, any electronic device that can implement the present application belongs to the protection scope of the present application.
[0065] Embodiment Four The fourth aspect of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method steps of the first embodiment are implemented.
[0066] For the system / electronic device / storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts refer to the part of the method embodiments.
[0067] It should be noted that the system, electronic device and storage medium of the embodiments of the present application are respectively the system, electronic device and storage medium applying the credit risk prediction method based on the decision tree and recursive algorithm, and all the embodiments of the credit risk prediction method based on the decision tree and recursive algorithm are applicable to the system, electronic device and storage medium, and can achieve the same or similar beneficial effects.
[0068] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, system (device), or computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects, which are all referred to as "modules" here. Moreover, the present application can take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code. The computer program is stored / distributed in a suitable medium, provided with other hardware or as part of the hardware, and can also take other distribution forms, such as through the Internet or other wired or wireless telecommunication systems.
[0069] The above is a further detailed description of the present application in combination with specific preferred embodiments, and the specific implementation of the present application cannot be limited to these descriptions. For those of ordinary skill in the art to which the present application belongs, without departing from the concept of the present application, a number of simple deductions or substitutions can also be made, which should be considered to fall within the protection scope of the present application.
Claims
1. A credit risk prediction method based on decision tree and recursive algorithm, characterized in that, Comprising: Step 1: collecting a user basic data set based on user historical behavior; the user basic data set includes user basic information, credit data, and repayment behavior; Step 2: preprocessing the user basic data set to obtain feature data and storing for future use; Step 3: randomly selecting a number of variables, combining the selected variables with the feature data to construct a decision tree, and calculating the risk identification efficiency of the decision tree; Step 4: using a recursive algorithm to repeat the operation of step 3 to perform variable mining until a preset recursive loop number is reached, traverse all decision trees, and select the decision tree with the highest risk identification efficiency as the optimal variable combination; Step 5: based on the optimal variable combination, the risk identification effect is evaluated to obtain a risk prediction result. 2.The credit risk prediction method based on decision tree and recursive algorithm according to claim 1, characterized in that, Step 2 specifically includes: 2a) cleaning the user basic data set to remove noise data to obtain an optimized data set; 2b) feature extraction is performed on the optimized data set to obtain key features and patterns in the data to obtain feature data; 2c) storing the feature data in a preset storage system for future use. 3.The credit risk prediction method based on decision tree and recursive algorithm according to claim 2, characterized in that, In step 2b), the method of feature extraction on the optimized data set includes principal component analysis, independent component analysis, or linear discriminant analysis. 4.The credit risk prediction method based on decision tree and recursive algorithm according to claim 2, characterized in that, In step 2c), the preset storage system is a distributed file system or a database. 5.The credit risk prediction method based on decision tree and recursive algorithm according to claim 1, characterized in that, In step 3, the number of selected variables is 1-4, and the depth of the constructed decision tree is not more than 4. 6.The credit risk prediction method based on decision tree and recursive algorithm according to claim 1, characterized in that, Step 4 specifically includes: 4a) the preset recursive loop number is 2000; 4b) repeating the operation of step 3 to obtain 2000 individual decision trees and their corresponding 2000 variable combinations; 4c) traverse all decision trees and select the decision tree with the highest risk identification efficiency, i.e. the variable combination with the highest hit sample proportion under the same risk identification capability, as the optimal variable combination. 7.The credit risk prediction method based on decision tree and recursive algorithm according to claim 1, characterized in that, After obtaining the optimal variable combination, it also includes: Based on subsequent data samples, the risk identification effect of the optimal variable combination is continuously observed to verify the stability of the risk identification effect of the optimal variable combination.
8. A credit risk prediction system based on decision trees and recursive algorithms for implementing the method according to any one of claims 1 to 7, characterized in that, Comprising: A data acquisition module for collecting a user basic data set based on user historical behavior; the user basic data set includes user basic information, credit data, and repayment behavior; A preprocessing module for preprocessing the user basic data set to obtain feature data and storing for future use; A data mining module for randomly selecting a number of variables, combining the selected variables with the feature data to construct a decision tree, and calculating the risk identification efficiency of the decision tree; The data mining module is also used to repeat the variable selection and decision tree construction to perform variable mining until a preset recursive loop number is reached, traverse all decision trees, and select the decision tree with the highest risk identification efficiency as the optimal variable combination; An evaluation module for evaluating the risk identification effect based on the optimal variable combination to obtain a risk prediction result.
9. An electronic device, comprising: comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface, the memory complete mutual communication through the communication bus; the memory is used for depositing a computer program; the processor is used for executing the program deposited on the memory, and realizes the method steps in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, the computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the method steps in any one of claims 1-7.