Credit risk prediction method and device, electronic equipment and storage medium
By translating the decision tree model into an initial evaluation model of neural network structure, the problem of decision-making in credit risk control is solved, and the interpretability and prediction performance of decisions are improved.
Patent Information
- Application Number
- CN202411491297.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-02-14
AI Technical Summary
In the existing credit risk control technology, due to its "black box" nature, neural network models are difficult to explain decision logic and cannot meet the risk control field's demand for decision interpretability.
By translating the trained decision tree model into an initial evaluation model composed of multiple neurons, and initializing the parameters of the neural network using the model parameters of the decision tree model, the initial evaluation model can simulate the decision tree model during training and prediction. Decision paths to maintain interpretability of decisions while leveraging the learning ability of neural networks to improve prediction performance.
It realizes the construction of a risk assessment model with decision interpretability in credit risk control scenarios, and at the same time improves the prediction performance of the model, meeting the dual needs of interpretability and prediction accuracy in the risk control field.
Smart Images

Figure CN119444394A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of credit risk control, and in particular to a credit risk prediction method, device, electronic device and storage medium. Background Art
[0002] In the credit risk control scenario, it is often necessary to assess the user's credit overdue risk or credit risk. In related technologies, neural networks are modeled to learn the relationship between input data and output to predict the user's credit risk. However, neural networks are usually regarded as "black box" models, in which the complex hierarchy and a large number of nonlinear operations make it very difficult to explain the specific logic of each decision. In the field of risk control, the interpretability of decisions is a must. Therefore, how to build a model that meets the requirements of credit risk control scenarios for decision interpretability is an urgent problem to be solved. Summary of the invention
[0003] The present disclosure provides a credit risk prediction method, device, electronic device and storage medium. The technical solution is as follows:
[0004] According to one aspect of the present disclosure, a credit risk prediction method is provided, the method comprising:
[0005] Obtaining a trained decision tree model, wherein the decision tree model is used to predict the credit risk probability of a target object;
[0006] Translating the decision tree model to generate an initial evaluation model, wherein the initial evaluation model is composed of a plurality of neurons connected to each other, and initial model parameters of the initial evaluation model are determined by model parameters of the decision tree model;
[0007] Acquire sample object data of at least one sample object and a credit risk label of the sample object;
[0008] The initial assessment model is trained based on the at least one sample object data and the credit risk label to obtain a trained risk assessment model, and the risk assessment model is used to predict the credit risk probability of the target object.
[0009] According to another aspect of the present disclosure, there is provided a credit risk prediction device, the device comprising:
[0010] A first acquisition module is used to acquire a trained decision tree model, where the decision tree model is used to predict the credit risk probability of a target object;
[0011] A translation module, used for translating the decision tree model to generate an initial evaluation model, wherein the initial evaluation model is composed of a plurality of neurons connected to each other, and initial model parameters of the initial evaluation model are determined by model parameters of the decision tree model;
[0012] A second acquisition module, configured to acquire sample object data of at least one sample object and a credit risk label of the sample object;
[0013] A training module is used to train the initial assessment model based on the at least one sample object data and the credit risk label to obtain a trained risk assessment model, wherein the risk assessment model is used to predict the credit risk probability of the target object.
[0014] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor and a memory storing a program, wherein the program comprises instructions, and when the instructions are executed by the processor, the processor executes the credit risk prediction method as described above.
[0015] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the credit risk prediction method as described above.
[0016] According to another aspect of the present disclosure, a computer program product is provided, the computer program product comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned credit risk prediction method.
[0017] The beneficial effects brought by the technical solution provided by the embodiments of the present disclosure include at least:
[0018] The disclosed embodiment provides a credit risk prediction method: first, a trained decision tree model with a credit risk prediction function is obtained, and the trained decision tree model is translated into an initial evaluation model composed of multiple neurons, and the initial model parameters of the initial evaluation model are determined by the model parameters of the decision tree model; and then the initial evaluation model is trained to obtain a trained risk assessment model. By translating the trained decision tree model into an initial evaluation model of a neural network structure, the constructed initial evaluation model can maintain the decision-making intuitiveness and interpretability of the decision tree model when predicting credit risks, and at the same time, the learning ability and adaptability of the neural network can be used to improve the model prediction performance of the risk assessment model. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Further details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:
[0020] Figure 1A schematic diagram showing an example system in which various methods described herein may be implemented according to an exemplary embodiment of the present disclosure;
[0021] Figure 2 A flowchart of a credit risk prediction method according to an exemplary embodiment of the present disclosure is shown;
[0022] Figure 3 A flowchart showing another credit risk prediction method according to an exemplary embodiment of the present disclosure is shown;
[0023] Figure 4 is a model architecture diagram of a decision tree model provided by an exemplary embodiment of the present disclosure;
[0024] Figure 5 is a schematic diagram of an architecture of an initial evaluation model provided by an exemplary embodiment of the present disclosure;
[0025] Figure 6 It is a structural schematic diagram of a credit risk prediction device provided by an embodiment of the present disclosure;
[0026] Figure 7 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0027] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0028] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0029] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units. It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative and not restrictive. Those skilled in the art should understand that unless otherwise clearly stated in the context, it should be understood as "one or more". The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes, and are not used to limit the scope of these messages or information.
[0030] The solution of the present invention is described below with reference to the accompanying drawings, and the technical solution provided by the embodiment of the present invention is explained in detail through specific embodiments and their application scenarios.
[0031] Figure 1 Schematic diagram of an example system in which various methods described herein may be implemented according to an exemplary embodiment of the present disclosure. Figure 1 As shown, the system includes a first device 110 and a second device 120 .
[0032] The first device 110 is a training device for training a risk assessment model. After the risk assessment model training is completed, the first device 110 can send the trained risk assessment model 130 to the second device 120 so as to deploy the risk assessment model 130 in the second device 120. The second device 120 is a device that uses the risk assessment model 130 to predict credit risks.
[0033] In the model training stage: first, the decision tree model 111 is trained. After the training of the decision tree model 111 is completed, the decision tree model 111 is translated into an initial assessment model 112 composed of neurons, and the initial assessment model 112 is optimized using sample object data and credit risk labels to obtain a trained risk assessment model 130.
[0034] In the model application stage: the target object data of the target object is input into the trained risk assessment model 130, and the trained risk assessment model 130 performs credit risk prediction to obtain the credit risk probability of the target object.
[0035] Optionally, the first device 110 and the second device 120 may be computer devices with machine learning capabilities, for example, the computer device may be a terminal or a server.
[0036] Optionally, the first device 110 and the second device 120 may be the same computer device, or the first device 110 and the second device 120 may be different computer devices. Furthermore, when the first device 110 and the second device 120 are different devices, the first device 110 and the second device 120 may be devices of the same type, such as the first device 110 and the second device 120 may both be servers; or the first device 110 and the second device 120 may also be devices of different types. The server may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The terminal may be a smart phone, a vehicle-mounted terminal, a smart TV, a wearable device, a tablet computer, a laptop, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected via wired or wireless communication, and the present disclosure is not limited thereto.
[0037] Please refer to Figure 2 , which shows a flow chart of a credit risk prediction method according to an exemplary embodiment of the present disclosure. Figure 1 The first device 110 shown in the figure is used as an example for explanation. Figure 2 As shown, the method includes:
[0038] Step 201, obtaining a trained decision tree model, where the decision tree model is used to predict the credit risk probability of the target object.
[0039] In order to improve the decision interpretability of the risk assessment model in the credit scenario when predicting credit risk, the risk assessment model of the neural network structure is transformed by introducing the characteristics of the decision tree. In a corresponding possible implementation, a trained decision tree model with a credit risk prediction function is first obtained, and then the network structure and model parameters of the initial assessment model are designed based on the trained decision tree model, so that the initial assessment model can simulate the decision path of the decision tree model during training and prediction, thereby utilizing the decision interpretability of the decision tree model to construct an initial assessment model (or risk assessment model) with decision interpretability.
[0040] The training process of the decision tree model may include the following steps:
[0041] 1. Obtain training samples for the decision tree model, where the training samples include sample object data and a credit risk label of at least one sample object.
[0042] 2. Input the sample object data into the decision tree model to obtain the predicted probability value output by the decision tree model.
[0043] 3. Train the decision tree model based on the loss value between the predicted probability value and the credit risk label.
[0044] The sample object data may specifically be financial data related to the sample object's credit. For example, the sample object's historical loan record information, historical repayment record information, historical consumption record, historical transfer record, etc. The credit risk label may be a numerical value that is manually marked to indicate the credit risk level of the sample object. Optionally, the credit risk label may also be determined by whether the sample object has any credit overdue behavior. For example, if the sample object has any credit overdue behavior, its corresponding credit risk label may be set to 1; if the sample object does not have any credit overdue behavior, its corresponding credit risk label may be set to 0.
[0045] When training a decision tree model, the sample object data can be input into the initialized decision tree model to obtain its predicted probability value, and then based on the loss value between the predicted probability value and the standard value (ie, the credit risk label), the decision tree model is updated until the loss value is less than the preset value, thereby obtaining a trained decision tree model.
[0046] Step 202, translating the decision tree model to generate an initial evaluation model, the initial evaluation model is composed of a plurality of neurons connected to each other, and the initial model parameters of the initial evaluation model are determined by the model parameters of the decision tree model.
[0047] Among them, the initial evaluation model is a neural network model composed of multiple neurons connected to each other.
[0048] In one possible implementation, the trained decision tree model is translated into an initial evaluation model composed of multiple neurons. The translation process is to convert each node in the decision tree model into a neuron in the neural network structure, and the initial parameters of each neuron are determined by the model parameters of the corresponding node, and the connection relationship between the nodes is converted into the connection relationship between the corresponding neurons, and each decision result corresponds to an output neuron. In other words, the initial model parameters of the initial evaluation model are determined by the model parameters of the decision tree model. This translation process maintains the intuitiveness and explainability of the decision tree model when predicting credit risk, and can also use the learning ability and adaptability of the neural network to improve the model prediction performance.
[0049] Step 203: Obtain sample object data of at least one sample object and a credit risk label of the sample object.
[0050] After the trained decision tree model is translated into an initial assessment model of a neural network structure, in order to further improve the accuracy of credit risk prediction, the initial assessment model needs to be further optimized and trained to utilize the learning characteristics of the neural network to improve the accuracy of credit risk prediction. In a possible implementation, a training sample of the initial assessment model is obtained, and the training sample includes sample object data of at least one sample object and its corresponding credit risk label.
[0051] Optionally, the training samples of the initial evaluation model can be the same as those of the decision tree model; or different from those of the decision tree model. For example, after collecting a number of training data, the training data can be randomly divided into two parts, one part as the training samples of the decision tree model, and the other part as the training samples of the initial evaluation model.
[0052] Step 204: train an initial assessment model based on at least one sample object data and a credit risk label to obtain a trained risk assessment model, which is used to predict the credit risk probability of the target object.
[0053] Furthermore, the initial assessment model is trained using multiple sample object data and credit risk labels until the loss value of the initial assessment model is less than a preset value, and the model training is determined to be completed, thereby obtaining a trained risk assessment model. In the model application stage, if it is necessary to predict the credit risk of the target object, the target object data related to the target object (specifically, the financial data related to the target object) can be input into the risk assessment model, and the risk assessment model will make a prediction based on the target object data and output the credit risk probability of the target object.
[0054] For example, a greater credit risk probability indicates that the target object has a higher credit overdue risk; a smaller credit risk probability indicates that the target object has a lower credit overdue risk.
[0055] In summary, the disclosed embodiment provides a credit risk prediction method: first, a trained decision tree model with a credit risk prediction function is obtained, and the trained decision tree model is translated into an initial evaluation model composed of multiple neurons, and the initial model parameters of the initial evaluation model are determined by the model parameters of the decision tree model; and then the initial evaluation model is trained to obtain a trained risk assessment model. By translating the trained decision tree model into an initial evaluation model of a neural network structure, the initial evaluation model can maintain the decision-making intuitiveness and explainability of the decision tree model when predicting credit risks, and at the same time, the learning ability and adaptability of the neural network can be used to improve the model prediction performance of the risk assessment model.
[0056] The model translation process mainly involves the conversion of some model parameters. For example, certain specific parameters in the decision tree model need to be configured as processing parameters of specific neurons in the initial evaluation model.
[0057] Please refer to Figure 3 , which shows a flowchart of another credit risk prediction method according to an exemplary embodiment of the present disclosure. Figure 1 The computer device 110 shown in the figure is used as an example for explanation. Figure 3 As shown, the method includes:
[0058] Step 301, obtaining a trained decision tree model, where the decision tree model is used to predict the credit risk probability of the target object.
[0059] The implementation of step 301 may refer to step 101 , and this embodiment will not be described in detail here.
[0060] Step 302, parse the decision tree model to obtain the feature segmentation threshold and feature index corresponding to each internal node, the node weight corresponding to each leaf node, and the path node set and path direction set corresponding to at least one decision path.
[0061] Among them, the decision tree model is composed of at least one internal node and at least one leaf node; when the decision tree model includes at least two internal nodes, the initial internal node in the decision tree model can be called a root node, and the internal nodes other than the initial internal node can be called intermediate nodes; the leaf node is the decision result of the decision tree model; it corresponds to the path between the root node and the leaf node of the decision path, and the number of decision paths contained in the decision tree model is the same as the number of leaf nodes contained in the decision tree model.
[0062] For example, please refer to Figure 4 , which is a model architecture diagram of a decision tree model provided by an exemplary embodiment of the present disclosure. Figure 4As shown, the decision tree model 401 is composed of node A, node B, node C, node Z and node Y, wherein node Y and node Z can be called internal nodes, and node Y is the root node, node Z is the intermediate node, and node A, node B and node C can be called leaf nodes. Moreover, the decision tree model 401 includes three decision paths: decision path 1 ~ (node Y-node Z-node A), decision path 2 ~ (node Y-node Z-node B), decision path 3 ~ (node Y-node C).
[0063] Since the translation principle of the decision tree model into the initial evaluation model is: each node in the decision tree model is converted into a neuron in the neural network structure, and the initial parameters of each neuron are determined by the model parameters of the corresponding node, and the connection relationship between the nodes is converted into the connection relationship between the corresponding neurons, and each decision result corresponds to an output neuron. When translating the decision tree model, first, according to the nodes contained in the decision tree model and the connection relationship between the nodes, the corresponding neuron connection structure is constructed, that is, the neural network architecture of the initial evaluation model is obtained, and then the model parameters are parsed from the decision tree model to configure the model parameters of each neuron in the initial evaluation model. Specifically, after parsing the decision tree model in the embodiment of the present disclosure, the feature segmentation threshold corresponding to each internal node (which can be expressed as θ I :) and the feature index (which can be represented as j I ), the node weight corresponding to each leaf node (which can be expressed as W L ), as well as model parameters such as a path node set (which can be expressed as Path(L)) and a path direction set (which can be expressed as Dir(L)) corresponding to at least one decision path, for configuring the initial evaluation model.
[0064] According to the connection relationship between each node in the decision tree model, the connection structure of the neurons in the initial evaluation model is constructed; each neuron only receives input from a specific neuron in the previous layer, without receiving the output of all neurons in the previous layer as input, simulating the splitting process of the decision tree, thereby reducing the total number of connections in the initial evaluation model and increasing the sparsity of the network; it can also reduce the computational complexity of the initial evaluation model, thereby improving the training speed and prediction efficiency of the model, which is more suitable for rapid response scenarios in the risk control field.
[0065] Moreover, the parameters of each node in the decision tree model are used to configure the initial parameters of each neuron in the initial evaluation model. On the one hand, the initial evaluation model does not need to be trained from scratch, which improves the training efficiency. On the other hand, since each parameter in the decision tree model has a certain explanatory meaning, configuring it to the initial evaluation model can make the decision process of the initial evaluation model explainable.
[0066] Wherein, on the basis that the decision path is a path from the root node to the leaf node, the path node set corresponding to the decision path is a sequence composed of the corresponding identifiers of each node included in the decision path. Figure 4 For example, if the unique identifiers corresponding to the nodes in the decision tree model 401 are: node A-Y1, node B-Y2, node C-Y3, node Y-X1, node Z-X2, then the path node set corresponding to decision path 1 is {X1, X2, Y1}; the path node set corresponding to decision path 2 is {X1, X2, Y2}; and the path node set corresponding to decision path 3 is {X1, Y3}.
[0067] When the decision tree model makes a decision at each internal node, the internal node corresponds to a feature segmentation threshold. If it is greater than the feature segmentation threshold, it flows to the yes branch, and if it is less than the feature segmentation threshold, it flows to the no branch. In order to make the initial evaluation model inherit this decision-making method, the path direction set is also parsed from the decision tree model based on the yes branch and the no branch. The path direction set is the set of segmentation directions on the path from the root node to the leaf node. The segmentation direction includes two segmentation directions, corresponding to the yes branch and the no branch respectively.
[0068] In an illustrative example, the process of parsing the decision tree model to obtain a path direction set corresponding to at least one decision path may include steps 302A to 302C.
[0069] Step 302A, for each child node in each decision path, if the child node is a branch, the path direction value corresponding to the child node is determined as the first direction value, and the child nodes include intermediate nodes and leaf nodes in the decision path. The intermediate nodes are internal nodes in the internal nodes except the initial internal nodes.
[0070] Step 302B: if the child node has a negative score, the path direction value corresponding to the child node is determined as the second direction value.
[0071] Step 302C: determine the set of path direction values corresponding to each sub-node on the decision path as the path direction set corresponding to the decision path.
[0072] In the decision tree model, all nodes except the root node can be matched to the corresponding path direction. For each child node in each decision path, if the child node belongs to the yes branch, that is, the identifier of the child node matches the identifier of the "yes" branch, then the path direction value corresponding to the child node is determined to be the first direction value; if the child node belongs to the no branch, that is, the identifier of the child node does not match the identifier of the "yes" branch, then the path direction value corresponding to the child node is determined to be the second direction value; and then the set of path direction values corresponding to each child node on the decision path is determined as the path direction set corresponding to the decision path.
[0073] For example, the first direction value may be 1, and the second direction value may be -1. Figure 4 As shown, if the decision tree model splits to the right corresponding to the first direction value and splits to the left corresponding to the second direction value, then the path direction set corresponding to decision path 1 is {-1, -1}; the path direction set corresponding to decision path 2 is {-1, 1}; and the path direction set corresponding to decision path 3 is {1}.
[0074] Step 303, generating an initial evaluation model based on the feature segmentation threshold, feature index, node weight, path node set and path direction set.
[0075] After parsing and obtaining model parameters such as feature segmentation threshold, feature index, node weight, path node set, and path direction set, the initial model parameters of the initial evaluation model can be configured based on the above parameters.
[0076] In an illustrative example, the process of configuring the initial evaluation model may include the following steps (ie, step 303 may include steps 303A to 303C).
[0077] Step 303A, based on the feature segmentation threshold and feature index corresponding to the internal node, determine the weight matrix and bias vector of the internal neuron in the initial evaluation model.
[0078] Step 303B, based on the node weights of the leaf nodes, determine the output weights of the output neurons in the initial evaluation model.
[0079] Step 303C: Determine the decision direction parameters of the initial evaluation model based on the path direction set and the path node set.
[0080] Among them, the neurons in the initial evaluation model can be divided into three categories according to their functions: input neurons, internal neurons and output neurons. Input neurons are used to map input information to vector space to obtain input feature vectors, internal neurons are used to process and make decisions on input feature vectors, and output neurons are used to output decision results. Based on the functional categories, the internal neurons in the initial evaluation model correspond to the internal nodes in the decision tree model, and the output neurons correspond to the leaf nodes in the decision tree model.
[0081] Please refer to Figure 5, which is a schematic diagram of the architecture of an initial evaluation model provided by an exemplary embodiment of the present disclosure. The initial evaluation model 520 can be translated from the decision tree model 510, wherein the node Y in the decision tree model 510 corresponds to the neuron 522 in the initial evaluation model 520; the node Z in the decision tree model 510 corresponds to the neuron 524 in the initial evaluation model 520; the node C in the decision tree model 510 corresponds to the neuron 523 in the initial evaluation model 520; the node A in the decision tree model 510 corresponds to the neuron 526 in the initial evaluation model 520, and the node B in the decision tree model 510 corresponds to the neuron 525 in the initial evaluation model 520; and, the neuron 521 is an input neuron, the neuron 522 and the neuron 524 are internal neurons, and the neuron 523, the neuron 525 and the neuron 526 are output neurons.
[0082] Since each neuron in the initial evaluation model corresponds one-to-one to a node in the decision tree model, when configuring the model parameters, it is also necessary to configure the corresponding model parameters according to the correspondence between the nodes and the neurons. In a possible implementation, the feature segmentation threshold and feature index corresponding to the internal node are determined as the weight matrix and bias vector of the internal neuron corresponding to the internal node in the initial evaluation model, and the node weight of the leaf node is determined as the output weight of the output neuron corresponding to the node in the initial evaluation model; and the decision direction parameters of the initial evaluation model are determined based on the path direction set and the path node set.
[0083] The decision direction parameter is in matrix form, and its dimension is the number of leaf nodes multiplied by the number of internal nodes. Specifically, when generating the decision direction parameter, firstly, a table is constructed with internal nodes as rows and leaf nodes as columns, and then based on the path direction set and the path node set, the path direction values in the path direction set are filled into the table, so as to construct the decision direction parameter in matrix form.
[0084] For example, Figure 4 The decision direction parameters based on can be shown in Table 1.
[0085] Table 1
[0086] Y Z A -1 -1 B -1 1 C 1 0
[0087] Among them, node A corresponds to decision path 1, and the path direction set corresponding to decision path 1 is {-1, -1}, so the parameters filled in on the row corresponding to node A are -1 and -1; node B corresponds to decision path 2, and the path direction set corresponding to decision path 2 is {-1, 1}, so the parameters filled in on the row corresponding to node B are -1 and 1; node C corresponds to decision path 3, and the path direction set corresponding to decision path 3 is {1}, and from the path node set corresponding to decision path 3, it can be seen that node C has no relationship with node Z, so 0 is filled in at node C and node Z.
[0088] Step 304: Obtain sample object data of at least one sample object and a credit risk label of the sample object.
[0089] The implementation of step 304 may refer to step 203 , and this embodiment will not be described in detail here.
[0090] Step 305: input the sample object data into the initial assessment model to obtain the predicted risk probability output by the initial assessment model.
[0091] When training the initial assessment model, the sample object data is first input into the initial assessment model, and the initial assessment model makes a decision output based on the sample object data to obtain the predicted risk probability output by the initial assessment model.
[0092] On the basis that the initial assessment model is composed of input neurons, internal neurons and output neurons, when performing credit risk prediction, the processing functions performed by each neuron are different. Correspondingly, in an exemplary example, step 305 may include steps 305A to 305D.
[0093] Step 305A: input the sample object data into the input neurons in the initial evaluation model to obtain an input feature vector.
[0094] The input neurons are used to process the sample object data in text form into vector features. The sample object data is input into the input neurons in the initial evaluation model, and the input neurons map it to the vector space to obtain the input feature vector.
[0095] Step 305B, inputting the input feature vector into the internal neuron, processing the input feature vector through the weight matrix and bias vector of the internal neuron, and obtaining the node calculation result.
[0096] The internal neuron is used to process and make decisions on the input features according to the model parameters to obtain the processing results. The input feature vector is input into the internal neuron according to the connection relationship, and the input feature is first processed by the weight matrix and bias vector of the internal neuron to obtain the node calculation result. Exemplarily, the process of generating the node calculation result can be shown as formula (1).
[0097] z=WX T +b(1)
[0098] Among them, Z represents the node calculation result, W represents the weight matrix of the current internal neuron, b represents the bias vector of the current internal neuron, and X represents the input feature vector.
[0099] Step 305C, processing the node calculation result through the activation function of the internal neuron to obtain the node decision result of the internal neuron.
[0100] The node calculation result is further processed by the activation function of the internal neuron to obtain the node decision result output by the internal neuron. Exemplarily, the process of generating the node decision result can be shown as formula (2).
[0101] D = tanh(10×z)(2)
[0102] Among them, D represents the node decision result output by the current internal neuron, and z represents the node calculation result.
[0103] Step 305D, determine the predicted risk probability based on the decision direction parameter, the node decision result, and the output weight of the output neuron.
[0104] Furthermore, the predicted risk probability is determined according to the decision direction parameter, the node decision result, and the output weight of the output neuron. Specifically, step 305D may also include steps 305D1 to 305D3.
[0105] Step 305D1, determining a matching result matrix based on the decision direction parameter and the node decision result.
[0106] In order to simulate the decision-making method of the decision tree, before outputting the final predicted risk probability, it is necessary to perform pattern matching based on the decision direction parameters, that is, it is necessary to determine the matching result matrix based on the decision direction parameters and the node decision results. Exemplarily, the pattern matching process can be shown as formula (3).
[0107] P′=D·P T (3)
[0108] Among them, P′ represents the matching result matrix, D represents the node decision result, and P represents the decision direction parameter. The form of the matching result matrix generated based on formula (3) is similar to the decision direction parameter, that is, each leaf node or output neuron row corresponds to multiple inner product values.
[0109] Step 305D2, determining the sub-probability value output by each output neuron from the matching result matrix.
[0110] The output value of each neuron is the maximum value among the multiple inner product values corresponding to the neuron. That is, the maximum inner product value of each row is selected from the matching result matrix to determine the sub-probability value output by each output neuron.
[0111] Exemplarily, the matching result matrix is shown in Table II.
[0112] Table 2
[0113] Y Z A 0.4 0.3 B 0.5 0.6 C 0.5 0.2
[0114] As shown in Table 2, the sub-probability value of the output neuron corresponding to node A is 0.4; the sub-probability value of the output neuron corresponding to node B is 0.6; and the sub-probability value of the output neuron corresponding to node C is 0.5.
[0115] Step 305D3, determining the predicted risk probability based on the output weights and sub-probability values corresponding to each output neuron.
[0116] Since the decision tree model corresponds to multiple leaf nodes, after being translated into a neural network, the initial evaluation model also corresponds to multiple output neural networks, and the final predicted risk probability is a value, it is also necessary to combine the output weights corresponding to each output neuron to comprehensively determine the final predicted risk probability. In a possible implementation, the predicted risk probability is determined based on the output weights and sub-probability values corresponding to each output neuron.
[0117] Exemplarily, the process of determining the predicted risk probability may be as shown in formula (4).
[0118] output=gather(W L ,argmax(P′))(4)
[0119] Among them, output represents the predicted risk probability output by the initial evaluation model, W L represents the output weight of the output neuron, and P′ represents the matching result matrix.
[0120] Step 306: Based on the predicted risk probability and the loss between the credit risk label, an initial assessment model is trained to obtain a trained risk assessment model.
[0121] In an illustrative example, step 306 may also include step 306A and step 306B.
[0122] Step 306A, determining a predicted loss value based on the difference between the predicted risk probability and the credit risk label.
[0123] In order to improve the credit risk prediction accuracy of the initial assessment model, the predicted loss value of the initial assessment model can be determined based on the difference between the predicted value (i.e., predicted risk probability) output by the initial assessment model and the standard value (credit risk label), and then the initial model parameters of the initial assessment model can be updated based on the predicted loss value.
[0124] Exemplarily, the predicted loss value may be obtained by calculating the cross entropy loss between the predicted risk probability and the credit risk label.
[0125] Step 306B, based on the predicted loss value, update the bias vector of each internal neuron in the initial evaluation model.
[0126] When updating the initial evaluation model, not all model parameters of the initial evaluation model are updated, but only the bias vector parameter of the internal neuron is updated; that is, in each round of model training, after the prediction loss value is determined, other model parameters in the initial evaluation model (for example, the weight matrix of the internal neuron, the output weight of the output neuron, the decision direction parameter, etc.) are fixed, and the back propagation algorithm is used to update the model parameter of the bias vector of each internal neuron in the initial evaluation model; after multiple rounds of training, when the prediction loss value between the prediction value output by the initial evaluation model and the standard value is less than the preset value, it is determined that the initial evaluation model training is completed and the risk assessment model is obtained.
[0127] In this embodiment, the parameters such as the feature segmentation threshold, feature index, node weight of each leaf node, path node set and path direction set of the decision tree model at each internal node are obtained to configure the initial evaluation model; so that the connection of each neuron has a clear decision-making meaning, which improves the intuitiveness and decision interpretability of the initial evaluation model when predicting risk probability; and, the connection relationship of each neuron in the initial evaluation model is constructed according to the relationship between each node in the decision tree model. Compared with the full connection method of upper-layer neurons and lower-layer neurons in traditional neural networks, unnecessary neuron connections can be removed, the network connection method is optimized, and the complexity and training cost of the model are reduced.
[0128] In a possible application scenario, the exemplary embodiment of the present disclosure further provides a method for training a risk assessment model, the method comprising the following steps:
[0129] Step 1: Obtain a trained decision tree model, which is used to predict the target risk probability of the target object.
[0130] Step 2: Translate the decision tree model to generate an initial evaluation model. The initial evaluation model is composed of a plurality of neurons connected to each other, and the initial model parameters of the initial evaluation model are determined by the model parameters of the decision tree model.
[0131] Step 3: Obtain sample text data of at least one sample object and a target risk label of the sample object.
[0132] The sample text data and target risk labels used to train the initial evaluation model can be similar to the data used to train the decision tree model.
[0133] Step 4: Train an initial assessment model based on at least one sample text data and a target risk label to obtain a trained risk assessment model, which is used to predict the target risk probability of the target object.
[0134] The target risk probability may be the probability of abnormal behavior of the target object, and the abnormal behavior may be credit overdue behavior (corresponding to credit risk probability), abnormal consumption behavior, abnormal access behavior, abnormal operation behavior, abnormal social behavior, etc. Business personnel can train the risk assessment model required by the business according to business needs to predict different target risk probabilities of the target object.
[0135] Optionally, when training a decision tree model and a risk assessment model, there are differences in the sample text data required to predict different target risk probabilities. Exemplarily, if the abnormal behavior is credit overdue behavior, the sample text data (i.e., the sample object data in the above embodiment) can be historical financial data or historical credit-related data related to the target object; if the abnormal behavior is abnormal access behavior, the sample text data can be access data such as the access time and access address of the target object to the target application or target webpage; if the abnormal behavior is abnormal consumption behavior, the sample text data can be the target object's historical purchase record; if the abnormal behavior is abnormal operation behavior, the sample text data can be the target object's historical operation data on the target application; if the abnormal behavior is abnormal social behavior, the sample text data can be the target object's historical chat records, historical comment records, historical browsing records, etc.
[0136] It should be noted that the specific training process of the risk assessment model in this embodiment can refer to the above embodiment, and this embodiment will not be repeated here. That is to say, the above embodiment only uses the risk assessment model to predict the credit risk probability as an example for explanation. Regardless of which target risk probability the risk assessment model is used to predict, there is only a difference in the sample data required for training. The method of translating the decision tree model to generate the initial assessment model and training the initial assessment model to obtain the risk assessment model is the same.
[0137] After the risk assessment model is trained, the target text data of the target object can be obtained and input into the risk assessment model to obtain the target risk probability of the target object. For example, if the risk assessment model is used to predict the probability of abnormal access behavior of the target object, the historical access data of the target object can be input into the risk assessment model to obtain the target risk probability output by the risk assessment model, so as to determine whether to authorize the user's access request based on the target risk probability.
[0138] Please refer to Figure 6 , which is a schematic diagram of the structure of a credit risk prediction device provided by an embodiment of the present disclosure. For example, Figure 6 As shown, the device 600 includes:
[0139] A first acquisition module 601 is used to acquire a trained decision tree model, where the decision tree model is used to predict the credit risk probability of a target object;
[0140] A translation module 602 is used to translate the decision tree model to generate an initial evaluation model, wherein the initial evaluation model is composed of a plurality of neurons connected to each other, and initial model parameters of the initial evaluation model are determined by model parameters of the decision tree model;
[0141] A second acquisition module 603 is used to acquire sample object data of at least one sample object and a credit risk label of the sample object;
[0142] The training module 604 is used to train the initial assessment model based on the at least one sample object data and the credit risk label to obtain a trained risk assessment model, and the risk assessment model is used to predict the credit risk probability of the target object.
[0143] Optionally, the decision tree model consists of at least one internal node and at least one leaf node;
[0144] The translation module 602 is further used for:
[0145] Parsing the decision tree model to obtain a feature segmentation threshold and a feature index corresponding to each of the internal nodes, a node weight corresponding to each of the leaf nodes, and a path node set and a path direction set corresponding to at least one decision path, wherein the decision path is a path from the root node to the leaf node, and the root node is an initial internal node of the decision tree model;
[0146] The initial evaluation model is generated based on the feature segmentation threshold, the feature index, the node weight, the path node set, and the path direction set.
[0147] Optionally, the initial evaluation model is composed of input neurons, internal neurons and output neurons;
[0148] The translation module 602 is further used for:
[0149] Determining a weight matrix and a bias vector of the internal neuron in the initial evaluation model based on the feature segmentation threshold and the feature index corresponding to the internal node;
[0150] Determining the output weight of the output neuron in the initial evaluation model based on the node weight of the leaf node;
[0151] Based on the path direction set and the path node set, a decision direction parameter of the initial evaluation model is determined.
[0152] Optionally, the training module 604 is further used to:
[0153] Inputting the sample object data into the initial assessment model to obtain the predicted risk probability output by the initial assessment model;
[0154] The initial assessment model is trained based on the loss between the predicted risk probability and the credit risk label.
[0155] Optionally, the training module 604 is further used to:
[0156] Inputting the sample object data into the input neuron in the initial evaluation model to obtain an input feature vector;
[0157] Inputting the input feature vector into the internal neuron, processing the input feature vector through the weight matrix and the bias vector of the internal neuron, and obtaining a node calculation result;
[0158] Processing the node calculation result by the activation function of the internal neuron to obtain the node decision result of the internal neuron;
[0159] The predicted risk probability is determined based on the decision direction parameter, the node decision result, and the output weight of the output neuron.
[0160] Optionally, the training module 604 is further used to:
[0161] Determining a matching result matrix based on the decision direction parameter and the node decision result;
[0162] Determine the sub-probability value output by each of the output neurons from the matching result matrix;
[0163] The predicted risk probability is determined based on the output weights and the sub-probability values corresponding to each of the output neurons.
[0164] Optionally, the training module 604 is further used to:
[0165] determining a predicted loss value based on a difference between the predicted risk probability and the credit risk label;
[0166] Based on the predicted loss value, the bias vector of each of the internal neurons in the initial evaluation model is updated.
[0167] The disclosed embodiment provides a credit risk prediction method: first, a trained decision tree model with a credit risk prediction function is obtained, and the trained decision tree model is translated into an initial evaluation model composed of multiple neurons, and the initial model parameters of the initial evaluation model are determined by the model parameters of the decision tree model; and then the initial evaluation model is trained to obtain a trained risk assessment model. By translating the trained decision tree model into an initial evaluation model of a neural network structure, the constructed initial evaluation model can maintain the decision-making intuitiveness and interpretability of the decision tree model when predicting credit risks, and at the same time, the learning ability and adaptability of the neural network can be used to improve the model prediction performance of the risk assessment model.
[0168] The exemplary embodiment of the present disclosure also provides an electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication. The memory stores a computer program that can be executed by the at least one processor, and the computer program is used to cause the electronic device to perform the method according to the embodiment of the present disclosure when executed by the at least one processor.
[0169] The exemplary embodiments of the present disclosure also provide a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to perform the method according to the embodiments of the present disclosure.
[0170] The exemplary embodiments of the present disclosure further provide a computer program product, including a computer program, wherein when the computer program is executed by a processor of a computer, the computer is used to enable the computer to perform the method according to the embodiments of the present disclosure.
[0171] refer to Figure 7, a block diagram of an electronic device 700 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0172] like Figure 7 As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0173] A plurality of components in the electronic device 700 are connected to the I / O interface 705, including: an input unit 706, an output unit 707, a storage unit 708, and a communication unit 709. The input unit 706 may be any type of device capable of inputting information to the electronic device 700, and the input unit 706 may receive input digital or character information, and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 707 may be any type of device capable of presenting information, and may include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 708 may include but is not limited to a disk, an optical disk. The communication unit 709 allows the electronic device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and may include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0174] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above. For example, in some embodiments, Figure 2 , Figure 3 The method shown may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 700 via ROM 702 and / or communication unit 709. In some embodiments, computing unit 701 may be configured to execute the computer program by any other suitable means (e.g., by means of firmware). Figure 2 , Figure 3 The method shown.
[0175] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0176] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0177] As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0178] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0179] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0180] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.
Claims
1. A credit risk prediction method, characterized in that: The method comprises: Obtaining a trained decision tree model, wherein the decision tree model is used to predict the credit risk probability of a target object; Translating the decision tree model to generate an initial evaluation model, wherein the initial evaluation model is composed of a plurality of neurons connected to each other, and initial model parameters of the initial evaluation model are determined by model parameters of the decision tree model; Acquire sample object data of at least one sample object and a credit risk label of the sample object; The initial assessment model is trained based on the at least one sample object data and the credit risk label to obtain a trained risk assessment model, and the risk assessment model is used to predict the credit risk probability of the target object.
2. The method according to claim 1, characterized in that The decision tree model is composed of at least one internal node and at least one leaf node; The step of translating the decision tree model to generate an initial evaluation model includes: The decision tree model is parsed to obtain a feature segmentation threshold and a feature index corresponding to each of the internal nodes, a node weight corresponding to each of the leaf nodes, and a path node set and a path direction set corresponding to at least one decision path, wherein the decision path is a path from a root node to the leaf node, and the root node is an initial internal node of the decision tree model; The initial evaluation model is generated based on the feature segmentation threshold, the feature index, the node weight, the path node set, and the path direction set.
3. The method according to claim 2, characterized in that The initial evaluation model is composed of input neurons, internal neurons and output neurons; The generating the initial evaluation model based on the feature segmentation threshold, the feature index, the node weight, the path node set and the path direction set includes: Determining a weight matrix and a bias vector of the internal neuron in the initial evaluation model based on the feature segmentation threshold and the feature index corresponding to the internal node; Determining the output weight of the output neuron in the initial evaluation model based on the node weight of the leaf node; Based on the path direction set and the path node set, a decision direction parameter of the initial evaluation model is determined.
4. The method according to claim 3, characterized in that The training of the initial assessment model based on the at least one sample object data and the credit risk label comprises: Inputting the sample object data into the initial assessment model to obtain the predicted risk probability output by the initial assessment model; The initial assessment model is trained based on the loss between the predicted risk probability and the credit risk label.
5. The method according to claim 4, characterized in that The step of inputting the sample object data into the initial assessment model to obtain the predicted risk probability output by the initial assessment model includes: Inputting the sample object data into the input neuron in the initial evaluation model to obtain an input feature vector; Inputting the input feature vector into the internal neuron, processing the input feature vector through the weight matrix and the bias vector of the internal neuron, and obtaining a node calculation result; Processing the node calculation result by the activation function of the internal neuron to obtain the node decision result of the internal neuron; The predicted risk probability is determined based on the decision direction parameter, the node decision result, and the output weight of the output neuron.
6. The method according to claim 5, characterized in that The step of determining the predicted risk probability based on the decision direction parameter, the node decision result, and the output weight of the output neuron includes: Determining a matching result matrix based on the decision direction parameter and the node decision result; Determine the sub-probability value output by each of the output neurons from the matching result matrix; The predicted risk probability is determined based on the output weights and the sub-probability values corresponding to each of the output neurons.
7. The method according to claim 4, characterized in that The training of the initial assessment model based on the loss between the predicted risk probability and the credit risk label comprises: determining a predicted loss value based on a difference between the predicted risk probability and the credit risk label; Based on the predicted loss value, the bias vector of each of the internal neurons in the initial evaluation model is updated.
8. A credit risk prediction device, characterized in that: The device comprises: A first acquisition module is used to acquire a trained decision tree model, where the decision tree model is used to predict the credit risk probability of a target object; A translation module, used for translating the decision tree model to generate an initial evaluation model, wherein the initial evaluation model is composed of a plurality of neurons connected to each other, and initial model parameters of the initial evaluation model are determined by model parameters of the decision tree model; A second acquisition module, configured to acquire sample object data of at least one sample object and a credit risk label of the sample object; A training module is used to train the initial assessment model based on the at least one sample object data and the credit risk label to obtain a trained risk assessment model, wherein the risk assessment model is used to predict the credit risk probability of the target object.
9. An electronic device, comprising: processor; as well as Memory for storing programs, The program includes instructions, which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.