Risk prediction methods, devices, electronic devices, and storage media for credit cards
By integrating multiple models and processing heterogeneous graph data, the problem of low accuracy in credit card risk prediction models has been solved, resulting in more accurate expression and prediction of group risk characteristics.
Patent Information
- Application Number
- CN202210082244.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-24
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2042-01-24
AI Technical Summary
Existing credit card risk prediction models have low accuracy, especially in expressing the risk characteristics of a group, which leads to inaccurate prediction results.
A multi-model fusion approach is adopted, including GBDT model, GraphSage model and Logistic regression model. Heterogeneous graph data is constructed to express group attributes, and the vector representation of nodes is used to reflect group risk characteristics. The results are fused by combining feature data.
It significantly improves the accuracy of credit card risk prediction. Through multi-model fusion and heterogeneous graph data processing, it accurately reflects the risk characteristics of groups and improves the overall accuracy of prediction results.
Smart Images

Figure CN114565446B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine learning technology, and in particular to risk prediction methods, devices, electronic devices, and storage media for credit cards. Background Technology
[0002] In recent years, with the booming economic development and the popularization of credit consumption among the younger generation, the issuance and transaction volume of credit cards in my country have been increasing. Along with this comes the risk issue of credit cards. Therefore, banks need to conduct risk prediction for the application scenarios of their credit cards.
[0003] On the one hand, traditional prediction methods generally identify risks using a single model. Because the principle of a single model is simple and it uses less effective data, the accuracy of the prediction results is relatively low. On the other hand, in the context of bank credit card risk control, risk characteristics often have group attributes, and traditional single-model prediction methods cannot effectively express group risk characteristics. This results in a lack of feature expression, which further affects the accuracy of the final prediction results. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, and storage medium for predicting credit card risks, in order to at least address the problem of low accuracy in credit card risk prediction results in related technologies.
[0005] In a first aspect, embodiments of this application provide a method for credit card risk prediction, comprising: reading raw credit card data, cleaning the raw data to obtain cleaned data; performing feature engineering on the cleaned data to obtain feature data, inputting the feature data into a pre-trained first GBDT model, and outputting a first result; constructing a heterogeneous graph based on the cleaned data to obtain heterogeneous graph data, transforming the heterogeneous graph data through a GraphSage model to obtain vector representations of nodes, inputting the vector representations of nodes into the classification layer of the GraphSage model, and outputting a second result; concatenating the feature data and the vector representations of nodes, inputting the concatenated features into a pre-trained second GBDT model, and outputting a third result; and fusing the first result, the second result, and the third result to obtain a prediction result.
[0006] In some embodiments, fusing the first result, the second result, and the third result to obtain a prediction result includes: inputting the first result, the second result, and the third result into a Stacking model for fusion and outputting the fused result; inputting the fused result into a pre-trained Logistic regression model and outputting the prediction result.
[0007] In some embodiments, constructing a heterogeneous graph based on the cleaned data to obtain heterogeneous graph data includes: constructing a heterogeneous graph according to a schema to obtain node data and edge data, wherein the nodes are used to represent entities and the edges are used to represent relationships between entities.
[0008] In some embodiments, the step of transforming the heterogeneous graph data through the GraphSage model to obtain the vector representation of the nodes includes: normalizing the vector representation of each type of entity according to attribute features, and sampling neighboring nodes; grouping the sampled data according to entity type, stacking the grouping results into a matrix through the GraphSage model; and inputting the matrix into the fully connected layer of the GraphSage model to output the vector representation of the nodes.
[0009] In some embodiments, the training method of the GraphSage model is as follows: For each type of entity, a normalized vector representation is performed based on attribute features, and neighboring nodes are sampled to obtain a set of nodes to be aggregated; nodes of the same type in the set of nodes to be aggregated are aggregated through the max pooling layer of the GraphSage model to obtain multiple aggregated vectors, and the multiple vectors are stacked to obtain a matrix; the matrix is input into the fully connected layer of the GraphSage model to obtain the vector representation of the node; the vector representation of the node is input into the classification layer of the GraphSage model to output the predicted value; the loss is calculated based on the predicted value and the true value, and the parameters are updated; when the loss converges, training stops.
[0010] In some embodiments, the training method of the GraphSage model further includes: sampling neighbor nodes of two adjacent hops according to the MiniBatch method of the GraphSage model to obtain the set of nodes to be aggregated, and training based on the set of nodes to be aggregated, wherein the neighbor nodes of two adjacent hops include first-degree related nodes and second-degree related nodes.
[0011] In some embodiments, reading the raw data of the credit card includes reading the raw data of the credit card stored in the source layer via Hive.
[0012] Secondly, embodiments of this application provide a credit card risk prediction device, comprising: a preprocessing module, a first calculation module, a second calculation module, a third calculation module, and a fusion module. The preprocessing module reads the original data of the credit card, cleans the original data to obtain cleaned data; the first calculation module performs feature engineering on the cleaned data to obtain feature data, inputs the feature data into a pre-trained first GBDT model, and outputs a first result; the second calculation module constructs a heterogeneous graph based on the cleaned data to obtain heterogeneous graph data, modifies the heterogeneous graph data using a GraphSage model to obtain vector representations of the nodes, inputs the vector representations of the nodes into the classification layer of the GraphSage model, and outputs a second result; the third calculation module concatenates the feature data and the vector representations of the nodes, inputs the concatenated features into a pre-trained second GBDT model, and outputs a third result; the fusion module fuses the first result, the second result, and the third result to obtain a prediction result.
[0013] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the method described in any of the above-mentioned embodiments.
[0014] Fourthly, embodiments of this application provide a storage medium storing a computer program, wherein the computer program is configured to execute the method described in any of the above-mentioned methods at runtime.
[0015] Compared to related technologies, the embodiments of this application predict a first result using a first GBDT model, a second result using a GraphSage model, and a third result using a GraphSage model and a second GBDT model, and then fuse the results. This not only achieves multi-model fusion, but also, in the process of obtaining the second result, constructs a heterogeneous graph based on credit card data, expresses group attributes through the heterogeneous graph data, and reflects group risk characteristics through the vector representation of nodes, making the second and third results more accurate. Therefore, the embodiments of this application fuse the first, second, and third results to obtain the final prediction result, which greatly improves the accuracy of the prediction result. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0017] Figure 1This is a flowchart of a credit card risk prediction method provided according to an embodiment of this application;
[0018] Figure 2 This is a flowchart illustrating an example of a credit card risk prediction method according to an embodiment of this application;
[0019] Figure 3 This is a partial schematic diagram of a heterogeneous diagram provided according to an embodiment of this application;
[0020] Figure 4 This is a schematic diagram illustrating the range representation of sampling neighbor nodes according to an embodiment of this application;
[0021] Figure 5 This is a schematic diagram illustrating the number of sampled neighbor nodes according to an embodiment of this application;
[0022] Figure 6 This is a structural block diagram of a credit card risk prediction device provided according to an embodiment of this application;
[0023] Figure 7 This is a schematic diagram of the internal structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this application clearer, the application is described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the application. All other embodiments obtained by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application. Furthermore, it is understood that although the efforts made in such a development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this application, modifications to design, manufacturing, or production based on the technical content disclosed in this application are merely conventional technical means and should not be construed as insufficient disclosure of the content of this application.
[0025] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment that is mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0026] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms “a,” “an,” “an,” “the,” and similar words used in this application do not indicate quantity limitation and may indicate singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to these processes, methods, products, or devices. The terms “connected,” “linked,” “coupled,” and similar words used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. “Multiple” used in this application means two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. The terms “first,” “second,” “third,” etc., used in this application are merely to distinguish similar objects and do not represent a specific ordering of the objects.
[0027] This application provides a method for predicting the risk of credit cards, aiming to improve the accuracy of credit card risk prediction results. Figure 1 This is a flowchart of a credit card risk prediction method provided according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:
[0028] S101: Read the raw data of the credit card, clean the raw data, and obtain the cleaned data;
[0029] S102: The cleaned data is processed through feature engineering to obtain feature data. The feature data is then input into the pre-trained first GBDT model to output the first result.
[0030] S103: Construct a heterogeneous graph based on the cleaned data to obtain heterogeneous graph data. Transform the heterogeneous graph data through the GraphSage model to obtain the vector representation of the nodes. Input the vector representation of the nodes into the classification layer of the GraphSage model to output the second result.
[0031] S104: Concatenate the feature data and the vector representation of the nodes, input the concatenated features into the pre-trained second GBDT model, and output the third result;
[0032] S105: Combine the first result, the second result, and the third result to obtain the prediction result.
[0033] Based on the above, this application embodiment predicts a first result using a first GBDT model, a second result using a GraphSage model, and a third result using a GraphSage model and a second GBDT model. The results are then fused. This not only achieves multi-model fusion but also, when outputting the results, constructs a heterogeneous graph based on credit card data. This heterogeneous graph data fully expresses group attributes, and the vector representation of nodes accurately reflects group risk characteristics, making the second and third results more precise. Therefore, this application embodiment fuses the first, second, and third results to obtain the final prediction result, greatly improving the accuracy of the prediction results.
[0034] It should be noted that the execution order of the above steps is only an example. In practice, the order of the steps can be adjusted according to the actual situation.
[0035] To more clearly illustrate the embodiments of this application, detailed examples are provided below.
[0036] Figure 2 This is a flowchart illustrating an example of a credit card risk prediction method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps:
[0037] ① Read raw credit card data, for example, by reading the raw credit card data stored in the source layer using Hive. Since the source layer is the centralized storage location for bank data, it doesn't perform excessive cleaning or processing of business data, except for structuring unstructured data and integrating similar data. Instead, it preserves the original state of the data as much as possible. Therefore, reading the raw data from the source layer, rather than processed data, can more accurately reflect the original information of the entities, thus laying the foundation for improving the accuracy of subsequent predictions. Furthermore, using Hive to read large-scale data has certain advantages, such as: simplicity and ease of use, reducing the learning cost for developers; scalability; providing unified metadata management; extensibility; and good fault tolerance.
[0038] ② Perform data cleaning on the original data, such as deleting duplicate information, removing invalid values, and imputing missing values.
[0039] ③ The cleaned data is then subjected to feature engineering to obtain feature data.
[0040] ④ Input the feature data into the pre-trained first GBDT model and output the first result. The GBDT model is an ensemble learning model that learns from the residuals of the previous training stage, updating parameters in the direction of decreasing residuals until a certain fitting accuracy is achieved, at which point training stops. In this embodiment, inputting the feature data into the pre-trained first GBDT model yields a classification result, i.e., the aforementioned first result, which indicates whether there is risk. For example, a classification result of "0" indicates no risk, and a classification result of "1" indicates risk.
[0041] ⑤ Construct a heterogeneous graph based on the cleaned data to obtain heterogeneous graph data. It is worth noting that a homogeneous graph, in graph data, refers to a graph where there is only one type of node and one type of edge; while the heterogeneous graph used in this embodiment refers to a graph where there are multiple types of nodes and edges. Preferably, constructing a heterogeneous graph based on the schema results in a graph composed of several given nodes and edges connecting two nodes. In the graph, nodes represent things, and edges connecting two nodes represent the relationship between the two things. This type of graph can be used to describe a specific relationship between certain things.
[0042] Therefore, the heterogeneous graph data obtained in this application embodiment includes node data and edge data, wherein nodes are used to represent entities and edges are used to represent relationships between entities. The entities mentioned in this application embodiment refer to the things contained in the credit card data.
[0043] for example, Figure 3 This is a partial schematic diagram of a heterogeneous diagram provided according to an embodiment of this application, such as... Figure 3 As shown, the node (i.e. Figure 3 Circles in the diagram represent entities; the lines connecting nodes indicate a relationship between two entities, called edges. The entities mentioned include: natural persons, telephone numbers, IP addresses, devices, addresses (including home addresses, work addresses, and shipping addresses), credit cards, and email addresses. Let's assume... Figure 3 The intermediate node serves as the target node, representing entity 2 (natural person 1). Edges include: relationships between natural person 1 and natural person 2, such as contact person, repayment, financial transactions, colleagues, relatives, and credit card referrals; natural person 2's phone number; natural person 2's IP login; natural person 2's associated devices; natural person 2's home address, work address, and delivery address; natural person 2's credit card number; and natural person 2's email address. Once all entities and edge relationships are constructed, and each entity has its own type of metric, called attribute features, such as the credit card entity having attributes like account opening time, opening bank, and account holder; and the natural person entity having attributes like gender, age, and occupation.
[0044] ⑥ The heterogeneous graph data is transformed using the GraphSage model to obtain the vector representation of the nodes. This step includes: a. Transforming the nodes; b. Sampling neighbor nodes; c. Embedding (vector) stacking; d. Scaling using fully connected layers (FC); e. Classifying the results using a classification layer. Each step is detailed below:
[0045] a. Transform Nodes: As mentioned above, heterogeneous graph data includes node data and edge data. Node data represents the attribute characteristics of each type of entity, and edge data represents the relationships between entities. For each type of entity, a normalized vector representation is performed based on its attribute characteristics; that is, it is converted into a vector with a uniform format and size. For example, according to the above... Figure 3 As shown, there are 7 different types of entities, each with different attribute characteristics. For example, each credit card entity has 23 attribute characteristics, and each telephone entity has 10 attribute characteristics. To ensure consistency, the entity with the most attribute characteristics (such as the credit card entity) is selected as the basis, and other types of entities are padded with 0 if they do not have enough attribute characteristics.
[0046] For example, suppose a credit card entity 1 is represented by a one-dimensional vector [1,2,3,4,5,6.....23], and a telephone entity 1 is represented by a one-dimensional vector [1,2,3,4.....10]. For standardization and uniformity, a normalization process is performed: telephone entity 1 is padded with 13 zero values, resulting in a one-dimensional vector [1,2,3...10,0,0...0]. Therefore, after normalization, all entities can be represented by vectors of a uniform size, with a vector shape (i.e., size) of (1,23). Furthermore, assuming the final generated node's vector representation has a shape of (1,128), then matrix transformations are needed to initialize the entity representation, i.e., (1,23)*(23,128)=(1,128).
[0047] b. Sampling neighbor nodes: Since there are edges connecting related nodes, for a target node, the neighbor nodes related to the target node can be found according to the connection relationship, so that the neighbor nodes can be sampled. The number of neighbor nodes sampled can be preset with a threshold.
[0048] c. Embedding (vector) stacking: The sampled data is grouped according to entity type, and the grouping results are stacked using the GraphSage model to form a matrix. Specifically, the vectors of different entity types (with a shape of (1,128)) are concatenated vertically to obtain the matrix. Since the representation of a node is obtained by combining the vectors of multiple sampled neighbor nodes, the shape of the stacked matrix is, for example, (7,128).
[0049] d. FC (fully connected layers) scaling: The matrix input to the fully connected layers of the GraphSage model is scaled to obtain the final vector representation of the nodes.
[0050] e. Classify the results through a classification layer: Input the vector representation of the node into the classification layer of the GraphSage model. This classification layer can be a fully connected layer or a softmax layer. Therefore, a second result can be obtained through classification mapping. This second result is used to indicate whether there is a risk. For example, a classification result of "0" indicates no risk, and a classification result of "1" indicates risk.
[0051] As an example, the training method of the above GraphSage model includes: normalizing vector representations of entities of each type according to attribute features, and sampling neighboring nodes to obtain a set of nodes to be aggregated; aggregating nodes of the same type in the set of nodes to be aggregated through the max pooling layer of the GraphSage model to obtain multiple aggregated vectors, and stacking multiple vectors to obtain a matrix; inputting the matrix into the fully connected layer of the GraphSage model to obtain the vector representation of the nodes; inputting the vector representation of the nodes into the classification layer of the GraphSage model to output the predicted value; calculating the loss based on the predicted value and the true value, and updating the parameters; stopping training when the loss converges.
[0052] Preferably, the above training method is based on the MiniBatch approach of the GraphSage model. All training data can be divided into N (N>1) subsets. Gradient descent is performed once for each subset to update the model parameters. Then, gradient descent is continued based on the next subset. The process of traversing all samples once is called an epoch, or one generation. After traversing all samples, it is equivalent to performing N iterations of gradient descent. Thus, the training data is no longer all samples, but rather subsets. Therefore, performing N gradient descent iterations within one epoch can significantly improve the model's running speed.
[0053] For example, each time the neighboring nodes of two adjacent hops are sampled, the neighboring nodes of the two adjacent hops include first-degree associated nodes and second-degree associated nodes. Figure 4 This is a schematic diagram illustrating the range representation of sampling neighbor nodes according to an embodiment of this application, such as... Figure 4 As shown, assuming the middle node is the target node, the nodes in the K=1 ring are directly connected to the target node and are first-degree related nodes; the nodes in the K=2 ring are indirectly connected to the target node and are second-degree related nodes.
[0054] After sampling, a set of nodes to be aggregated is obtained, containing nodes of various types. For example, the first-degree related nodes of the target node (e.g., credit card entity 1) are address entity 1 and telephone entity 1, and the second-degree related nodes of credit card entity 1 are device entity 2 and telephone entity 2. Next, the nodes are grouped according to type; for example, after grouping, they form address entities: 1; telephone entities: 1 and 2; and device entities: 2. Then, the grouping results are stacked into vectors to form a matrix; the matrix is then input into the fully connected layer of the GraphSage model, outputting the vector representation of the nodes; the vector representation of the nodes is then input into the classification layer of the GraphSage model, outputting the predicted values.
[0055] It is worth noting that the core of the GraphSage model is to optimize the sampling of the entire graph down to the sampling of neighboring nodes. When training using the MiniBatch method, it generally requires three steps to obtain the predicted value. Figure 5 This is a schematic diagram illustrating the number of sampled neighbor nodes according to an embodiment of this application. A training phase includes the following steps: Step 1: Randomly sample the neighbor nodes of node 1. The number of neighbor nodes sampled in each hop does not exceed a corresponding preset value. As shown in Figure 5, the first hop samples 3 neighbor nodes (including nodes 2-4), and the second hop samples 5 neighbor nodes (including nodes 5-9). Step 2: Generate the vector representation of node 1. That is, first aggregate the attribute features of the two-hop neighbor nodes to generate the vector representation of the one-hop neighbor nodes, and then aggregate the vector representations of the one-hop neighbor nodes to generate the vector representation of node 1. Step 3: Input the vector representation of node 1 into a fully connected layer to obtain the predicted value of node 1. Therefore, in multiple training phases, the loss is calculated based on the predicted value and the true value, and the parameters are updated. When the loss converges, training stops.
[0056] ⑦ Feature concatenation: This involves concatenating the feature data and the vector representation of the nodes. As mentioned above, since step ③ yields the feature data and step ⑥ yields the vector representation of the nodes, concatenating the two results in the concatenated feature. For example, if the feature data is [1,2,3,4,....128] and the vector representation of the nodes is [129,130], then concatenating them results in the concatenated feature [1,2,3,4...130].
[0057] ⑧ The concatenated features are input into the pre-trained second GBDT model to obtain the classification result, i.e., the third result mentioned above, which is used to indicate whether there is risk. For example, a classification result of "0" indicates no risk, and a classification result of "1" indicates risk. It should be noted that the pre-trained first GBDT model and the pre-trained second GBDT model described in this application embodiment are different. Although both the first GBDT model and the second GBDT model are GBDT models with the same initial model parameters, the input of the first GBDT model is feature data, while the input of the second GBDT model is the concatenated features. Therefore, the first GBDT model and the second GBDT model are trained based on different input data, and each updates its model parameters during the training process. Therefore, when the first GBDT model and the second GBDT model finish training, the final model parameters obtained are different. Thus, the pre-trained first GBDT model and the pre-trained second GBDT model are different.
[0058] ⑨ The first, second, and third results are fused to obtain the prediction result. For example, the first, second, and third results can be assigned different weights, such as 0.3, 0.3, and 0.4, and then the final prediction result is calculated by weighted averaging. Preferably, to improve the accuracy of the prediction result, the first, second, and third results are input into a fusion model, such as a Stacking model, to obtain a fused result; then, the fused result is input into a pre-trained Logistic Regression model to obtain the final prediction result, which can further improve the accuracy of the final prediction result. It should be noted that, given that the input data is clear, the training methods of the GBDT model, Stacking model, and Logistic Regression model are known to those skilled in the art, and therefore will not be elaborated here.
[0059] In this embodiment of the application, step S101 specifically includes steps ①-②; step S102 specifically includes steps ③-④; step S103 specifically includes steps ⑤-⑥; step S104 specifically includes steps ⑦-⑧; and step S105 specifically includes step ⑨.
[0060] Based on the above, this application embodiment predicts a first result using a first GBDT model, a second result using a GraphSage model, and a third result using a GraphSage model and a second GBDT model. The results are then fused. This not only achieves multi-model fusion but also constructs a heterogeneous graph based on credit card data. The heterogeneous graph data fully expresses group attributes, and the vector representation of the target node is calculated by sampling neighbor nodes, accurately reflecting group risk characteristics. This makes the second and third results more precise. Therefore, this application embodiment fuses the first, second, and third results to obtain the final prediction result, significantly improving the overall accuracy of the prediction results.
[0061] This application also provides a risk prediction device for credit cards. Figure 6 This is a structural block diagram of a credit card risk prediction device according to an embodiment of this application, such as... Figure 6 As shown, the device includes: a preprocessing module 1, a first calculation module 2, a third calculation module 3, and a fusion module 4.
[0062] Preprocessing module 1 is used to read the raw data of the credit card, clean the raw data, and obtain the cleaned data;
[0063] The first calculation module 2 is used to obtain feature data from the cleaned data through feature engineering, input the feature data into the pre-trained first GBDT model, and output the first result.
[0064] The second calculation module 3 is used to construct a heterogeneous graph based on the cleaned data, obtain heterogeneous graph data, transform the heterogeneous graph data through the GraphSage model to obtain the vector representation of the nodes, input the vector representation of the nodes into the classification layer of the GraphSage model, and output the second result.
[0065] The third calculation module 4 is used to concatenate the feature data and the vector representation of the nodes, input the concatenated features into the pre-trained second GBDT model, and output the third result.
[0066] The fusion module 5 is used to fuse the first result, the second result, and the third result to obtain the prediction result.
[0067] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.
[0068] Specific examples in this embodiment can be found in the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0069] Furthermore, in conjunction with the credit card risk prediction method in the above embodiments, this application embodiment can provide a storage medium for implementation. This storage medium stores a computer program; when executed by a processor, the computer program implements any of the credit card risk prediction methods in the above embodiments.
[0070] One embodiment of this application also provides an electronic device, which can be a terminal. The electronic device includes a processor, a memory, a network interface, a display screen, and an input device connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a credit card risk prediction method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input device can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.
[0071] In one embodiment, Figure 7 This is a schematic diagram of the internal structure of an electronic device according to an embodiment of this application, such as... Figure 7 As shown, an electronic device is provided, which can be a server, and its internal structure diagram can be as follows. Figure 7 As shown, the electronic device includes a processor, a network interface, internal memory, and non-volatile memory connected via an internal bus. The non-volatile memory stores an operating system, computer programs, and a database. The processor provides computing and control capabilities, the network interface communicates with external terminals via a network connection, the internal memory provides an environment for the operation of the operating system and computer programs, the computer programs are executed by the processor to implement a credit card risk prediction method, and the database stores data.
[0072] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0073] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0074] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0075] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for predicting the risk of a credit card, characterized in that, include: Read the raw data from the credit card, clean the raw data, and obtain the cleaned data; The cleaned data is subjected to feature engineering to obtain feature data, and the feature data is input into a pre-trained first GBDT model to output a first result, which is used to indicate whether there is a risk. Heterogeneous graphs are constructed based on the cleaned data to obtain heterogeneous graph data, which includes node data and edge data. The node data represents the attribute characteristics of various types of entities, and the edge data represents the relationships between entities. The entities represent the items contained in the credit card data. The heterogeneous graph data is transformed through the GraphSage model to obtain the vector representation of the nodes. The vector representation of the nodes is input into the classification layer of the GraphSage model to output a second result, which is used to indicate whether there is a risk. The feature data and the vector representation of the node are concatenated, and the concatenated features are input into a pre-trained second GBDT model to output a third result, which is used to indicate whether there is a risk. The first result, the second result, and the third result are fused together to obtain the prediction result.
2. The method according to claim 1, characterized in that, The step of fusing the first result, the second result, and the third result to obtain the prediction result includes: The first result, the second result, and the third result are input into the Stacking model for fusion, and the fused result is output. The fused result is input into a pre-trained Logistic regression model, which outputs the prediction result.
3. The method according to claim 1, characterized in that, The process of constructing a heterogeneous graph based on the cleaned data to obtain heterogeneous graph data includes: A heterogeneous graph is constructed based on the schema to obtain node data and edge data, wherein the nodes are used to represent entities and the edges are used to represent the relationships between entities.
4. The method according to claim 3, characterized in that, The process of transforming the heterogeneous graph data using the GraphSage model to obtain the vector representation of the nodes includes: For each type of entity, a normalized vector representation is performed based on attribute features, and neighboring nodes are sampled. The sampled data is grouped according to entity type, and the grouping results are stacked into a matrix using the GraphSage model. The matrix is input into the fully connected layer of the GraphSage model, and the vector representation of the node is output.
5. The method according to any one of claims 1-4, characterized in that, The GraphSage model is trained as follows: For each type of entity, a normalized vector representation is performed based on attribute features, and neighboring nodes are sampled to obtain a set of nodes to be aggregated; Nodes of the same type in the set of nodes to be aggregated are aggregated through the max pooling layer of the GraphSage model to obtain multiple aggregated vectors, and the multiple vectors are stacked to obtain a matrix; The matrix is input into the fully connected layer of the GraphSage model to obtain the vector representation of the node; The vector representation of the node is input into the classification layer of the GraphSage model, and the predicted value is output. The loss is calculated based on the predicted and actual values, and the parameters are updated. Training stops when the loss converges.
6. The method according to claim 5, characterized in that, The training methods for the GraphSage model also include: According to the MiniBatch method of the GraphSage model, the neighbor nodes of two adjacent hops are sampled to obtain the set of nodes to be aggregated. Training is performed based on the set of nodes to be aggregated. The neighbor nodes of two adjacent hops include first-degree related nodes and second-degree related nodes.
7. The method according to claim 1, characterized in that, The process of reading the raw data from the credit card includes: Read the raw credit card data stored in the source layer using Hive.
8. A risk prediction device for credit cards, characterized in that, include: The preprocessing module is used to read the raw data of the credit card, clean the raw data, and obtain cleaned data. The first calculation module is used to obtain feature data by performing feature engineering on the cleaned data, input the feature data into a pre-trained first GBDT model, and output a first result, which is used to indicate whether there is a risk. The second calculation module is used to construct a heterogeneous graph based on the cleaned data to obtain heterogeneous graph data. The heterogeneous graph data includes node data and edge data, wherein the node data represents the attribute characteristics of various types of entities, the edge data represents the relationship between entities, and the entities represent the items contained in the credit card data. The heterogeneous graph data is transformed through the GraphSage model to obtain the vector representation of the nodes. The vector representation of the nodes is input into the classification layer of the GraphSage model to output a second result, which is used to indicate whether there is a risk. The third calculation module is used to concatenate the feature data and the vector representation of the node, input the concatenated features into the pre-trained second GBDT model, and output a third result, which is used to indicate whether there is a risk. The fusion module is used to fuse the first result, the second result, and the third result to obtain the prediction result.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method of any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the method of any one of claims 1 to 7 when it is run.
Citation Information
Patent Citations
Credit card transaction risk prediction method based on federated learning
CN112418520A
Risk prediction method and device based on relationship network tagging and graph neural network
CN112508691A