User sample processing method, device and electronic equipment
Through adaptive sample processing methods, new overdue user samples are generated and clustered to optimize the sample proportion of the financial business risk control model, solving the problem of reduced model generalization ability caused by sample imbalance in the existing technology, and achieving More accurate risk control predictions.
Patent Information
- Application Number
- CN202210105659.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-28
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-01-28
AI Technical Summary
In financial business risk control scenarios, due to the small number of overdue user samples, the model tends to learn a high proportion of non-overdue user samples during the modeling process, resulting in a decline in generalization capabilities. Existing technologies such as undersampling and oversampling methods can lead to information loss or overfitting.
By obtaining the user sample set, determine the number of non-overdue and overdue users, calculate the number of new overdue user samples, generate adjacent sample sets and new overdue user samples, perform clustering processing and sample combination, and form training and test sample sets. AUC and KS evaluation indicators optimize the model.
Adaptive sample expansion is achieved to avoid information loss and information weight increase, balance the sample proportion, and improve the generalization ability of the model.
Smart Images

Figure CN114511409B
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a user sample processing method, device and electronic device. Background Art
[0002] In the business scenario of financial business risk control, the core goal is to effectively identify users with high overdue risks and take risk control measures. At the same time, due to the characteristics of this business scenario, the number of overdue users is much smaller than the number of low non-overdue users. This leads to too few samples of overdue users in the modeling process, insufficient feature information that can be extracted, and ultimately the model tends to learn samples of non-overdue users with a high proportion, that is, the results of model prediction will be biased towards non-overdue samples with a high proportion, which will lead to a decrease in the generalization ability of the model and fail to identify users with high overdue risks in the actual production environment, which is contrary to our risk control goal.
[0003] In order to solve the problem of data sample imbalance, some existing technologies use undersampling and oversampling to expand the sample. Undersampling refers to random sampling without replacement of non-overdue user samples with a high proportion, and discarding the samples that are not selected, so as to achieve a balance between the number of overdue samples and non-overdue samples. However, this method will cause loss of sample information, especially when the total sample size is not large, it may lose important information and cause the model to underfit. Oversampling refers to randomly extracting and copying overdue samples with a low proportion to increase the number of samples with a low proportion, but this direct copying method will increase the weight of certain information, and ultimately lead to overfitting of the model. Summary of the invention
[0004] In order to overcome the above-mentioned deficiencies in the prior art, the purpose of this application is to provide a user sample processing method, the method comprising:
[0005] Acquire a first user sample set, wherein the first user sample set includes a plurality of user samples, and the user samples include a plurality of user feature data representing user feature information;
[0006] Determine a first number of existing non-overdue user samples and a second number of existing overdue user samples in the first user sample set; wherein the existing non-overdue user samples are user samples without loan overdue sample labels, and the existing overdue user samples are user samples with loan overdue sample labels;
[0007] Calculate a third number of newly added overdue user samples that need to be generated according to the first number and the second number;
[0008] For each of the overdue user samples, determine a neighboring sample set of the overdue user sample; the neighboring sample set includes a fourth number of user samples having the shortest feature distance to the overdue user sample;
[0009] For each adjacent sample set of the overdue user sample, determine first percentage data of the overdue user samples in the adjacent sample set;
[0010] Standardize the first percentage data corresponding to each of the overdue user samples to obtain second percentage data;
[0011] Calculate, according to the third number and the second proportion data, a fifth number of newly added overdue user samples that need to be generated corresponding to each of the existing overdue user samples;
[0012] For each of the existing overdue user samples, a corresponding fifth number of newly added overdue user samples is generated; wherein each of the newly added overdue user samples is calculated from the existing overdue user sample and another existing overdue user sample randomly determined from a set of adjacent samples of the existing overdue user sample;
[0013] Performing clustering processing on each of the existing non-overdue user samples, wherein the number of clusters is the second number;
[0014] Sampling from the center of each of the clusters to obtain a second user sample set, and combining the second user sample set with the existing overdue user samples to obtain a training sample set;
[0015] Segmenting the newly added overdue user samples to obtain the second number of third user sample sets, and combining each of the third user sample sets with the second user sample set to obtain the second number of test sample sets;
[0016] The model is trained by the training sample set, the model is tested by the test sample set, and the AUC evaluation index value and the KS evaluation index value of the training sample set and the test sample set are calculated;
[0017] If the difference between the AUC evaluation index value and the KS evaluation index value of the training sample set and the test sample set is within a set range, the newly added overdue user sample and the first user sample set are combined to obtain a modeling data set.
[0018] In a possible implementation, the step of calculating a third number of newly added overdue user samples to be generated according to the first number and the second number includes:
[0019] The third quantity G is calculated by the following formula:
[0020] G=(m1-m2)*β,
[0021] Wherein, m1 is the first number, m2 is the second number, and β belongs to (0,1].
[0022] In a possible implementation, the step of normalizing the first proportion data corresponding to each of the overdue user samples to obtain the second proportion data includes:
[0023] The first percentage data r corresponding to the i-th overdue user sample i , calculate the corresponding second proportion data through the following formula
[0024]
[0025] Wherein, n is the second number of the overdue user samples.
[0026] In a possible implementation, the step of generating the corresponding fifth number of newly added overdue user samples for each of the existing overdue user samples includes:
[0027] For the i-th overdue user sample x i Repeat the fifth number of times to select the overdue user sample x i A sample of other overdue users x randomly determined from the adjacent sample set zi , and calculate the corresponding newly added overdue user sample s by the following formula i :
[0028] s i =x i +(x zi -x i )×λ
[0029] Where λ is a natural number belonging to (0,1].
[0030] In a possible implementation, the step of determining, for each of the overdue user samples, a set of adjacent samples of the overdue user sample includes:
[0031] For each of the overdue user samples, calculating a characteristic distance of the user characteristic data between the overdue user sample and other user samples, wherein the characteristic distance includes a Euclidean distance or a Manhattan distance;
[0032] A fourth number of user samples that are closest to the feature of the overdue user sample are obtained as a neighboring sample set of the overdue user sample.
[0033] In a possible implementation, the step of calculating, according to the third number and the second proportion data, a fifth number of newly added overdue user samples that need to be generated corresponding to each of the existing overdue user samples includes:
[0034] The fifth quantity g is calculated by the following formula i :
[0035]
[0036] Wherein, G is the third quantity, This is the second percentage data.
[0037] In a possible implementation, the step of obtaining the first user sample set includes:
[0038] Acquire a total sample set, and divide the total sample set into the first user sample set and the fourth user sample set;
[0039] The method further comprises:
[0040] Using the models trained by the first user sample set, the training sample set, and the modeling data set respectively to perform classification prediction on the fourth user sample set, and obtaining corresponding AUC evaluation index values and KS evaluation index values according to the prediction results;
[0041] If the AUC evaluation index value and the KS evaluation index value corresponding to the modeling data set are improved to a preset threshold compared with the AUC evaluation index value and the KS evaluation index value corresponding to the first user sample set and the training sample set, it is determined that the modeling data set meets the sample expansion requirements.
[0042] Another object of the present application is to provide a user sample processing device, the user sample processing device comprising:
[0043] A data acquisition module, configured to acquire a first user sample set, wherein the first user sample set includes a plurality of user samples, and the user samples include a plurality of user feature data representing user feature information;
[0044] A first data processing module is used to determine a first number of existing non-overdue user samples and a second number of existing overdue user samples in the first user sample set; wherein the existing non-overdue user samples are user samples without loan overdue sample labels, and the existing overdue user samples are user samples with loan overdue sample labels;
[0045] A second data processing module, configured to calculate a third number of newly added overdue user samples to be generated according to the first number and the second number;
[0046] A third data processing module is used to determine, for each of the overdue user samples, a neighboring sample set of the overdue user sample; the neighboring sample set includes a fourth number of user samples with the shortest feature distance to the overdue user sample;
[0047] A fourth data processing module is used to determine, for each adjacent sample set of the overdue user samples, first percentage data of the overdue user samples in the adjacent sample set;
[0048] A fifth data processing module, configured to normalize the first proportion data corresponding to each of the overdue user samples to obtain second proportion data;
[0049] a sixth data processing module, configured to calculate, according to the third number and the second proportion data, a fifth number of newly added overdue user samples that need to be generated corresponding to each of the existing overdue user samples;
[0050] A seventh data processing module is used to generate the corresponding fifth number of newly added overdue user samples for each of the existing overdue user samples; wherein each of the newly added overdue user samples is calculated from the existing overdue user sample and another existing overdue user sample randomly determined from a sample set adjacent to the existing overdue user sample;
[0051] an eighth data processing module, configured to perform clustering processing on each of the existing non-overdue user samples, wherein the number of clusters is the second number;
[0052] A ninth data processing module, configured to obtain a second user sample set by sampling from the center of each of the clusters, and to combine the second user sample set with the existing overdue user samples to obtain a training sample set;
[0053] a tenth data processing module, configured to segment the newly added overdue user samples to obtain the second number of third user sample sets, and respectively combine each of the third user sample sets with the second user sample set to obtain the second number of test sample sets;
[0054] A model training module, used to train the model through the training sample set, test the model through the test sample set, and calculate the AUC evaluation index value and KS evaluation index value of the training sample set and the test sample set;
[0055] The sample combination module is used to combine the newly added overdue user sample with the first user sample set to obtain a modeling data set if the difference between the AUC evaluation index value and the KS evaluation index value of the training sample set and the test sample set is within a set range.
[0056] Another object of the present application is to provide an electronic device, including a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are executed by the processor, the user sample processing method provided in the present application is implemented.
[0057] Another object of the present application is to provide a machine-readable storage medium, characterized in that the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are executed by one or more processors, the user sample processing method provided by the present application is implemented.
[0058] Compared with the prior art, this application has the following beneficial effects:
[0059] The embodiments of the present application provide a user sample processing method, device and electronic device, which expand the overdue user samples with a low proportion through an adaptive comprehensive oversampling method, thereby avoiding the interference to the model caused by information loss and increase in information weight, and at the same time meeting the need to balance the sample proportion. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0061] Figure 1 A schematic diagram of an electronic device provided in an embodiment of the present application;
[0062] Figure 2 A flowchart of a user sample processing method provided in an embodiment of the present application;
[0063] Figure 3 A schematic diagram of the functional modules of the user sample processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0065] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0066] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0067] In the description of the present application, it should be noted that the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0068] In the description of this application, it should also be noted that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0069] Please refer to Figure 1 , Figure 1 The electronic device 100 provided in the embodiment of the present application can be, but is not limited to, a server, a desktop personal computer, a laptop computer, a workstation or other device with digital processing capabilities. The electronic device 100 includes a user sample processing device 110, a machine-readable storage medium 120 and a processor 130.
[0070] The machine-readable storage medium 120 and the processor 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The user sample processing device 110 includes at least one software function module that can be stored in the machine-readable storage medium 120 in the form of software or firmware or solidified in the operating system (OS) of the electronic device 100. The processor 130 is used to execute the executable modules stored in the machine-readable storage medium 120, such as the software function modules and computer programs included in the user sample processing device 110.
[0071] The machine-readable storage medium 120 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The machine-readable storage medium 120 is used to store a program, and the processor 130 executes the program after receiving an execution instruction.
[0072] The processor 130 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0073] Please refer to Figure 2 , Figure 2 For application Figure 1 A flowchart of a user sample processing method of the electronic device 100 is shown, and the various steps of the method will be described in detail below.
[0074] Step S101: Acquire a first user sample set, where the first user sample set includes a plurality of user samples, and the user samples include a plurality of user feature data representing user feature information.
[0075] In this embodiment, the user characteristic data may include the user's age, job type, personal income, education level, historical loan situation, family income, property status, social network and other data.
[0076] Step S102, determining a first number of existing non-overdue user samples and a second number of existing overdue user samples in the first user sample set, wherein the existing non-overdue user samples are user samples without loan overdue sample labels, and the existing overdue user samples are user samples with loan overdue sample labels.
[0077] Step S103: Calculate a third number of newly added overdue user samples that need to be generated based on the first number and the second number.
[0078] Step S104: for each of the overdue user samples, determine a neighboring sample set of the overdue user sample, wherein the neighboring sample set includes a fourth number of user samples having the shortest feature distance to the overdue user sample.
[0079] Step S105: for each adjacent sample set of the overdue user sample, determine first percentage data of the overdue user samples in the adjacent sample set.
[0080] Step S106, normalizing the first proportion data corresponding to each of the overdue user samples to obtain second proportion data.
[0081] Step S107: Calculate, based on the third number and the second proportion data, the fifth number of newly added overdue user samples that need to be generated corresponding to each of the existing overdue user samples.
[0082] Step S108: Generate the corresponding fifth number of newly added overdue user samples for each of the existing overdue user samples, wherein each of the newly added overdue user samples is calculated from the existing overdue user sample and another existing overdue user sample randomly determined from a sample set adjacent to the existing overdue user sample.
[0083] Step S109: clustering the existing non-overdue user samples, wherein the number of clusters is the second number.
[0084] Step S110: sampling from the center of each cluster to obtain a second user sample set, and combining the second user sample set with the existing overdue user samples to obtain a training sample set.
[0085] Step S111, dividing the newly added overdue user samples to obtain the second number of third user sample sets, and combining each of the third user sample sets with the second user sample set to obtain the second number of test sample sets.
[0086] Step S112: training the model using the training sample set, testing the model using the test sample set, and calculating the AUC evaluation index value and the KS evaluation index value of the training sample set and the test sample set.
[0087] Step S113: If the difference between the AUC evaluation index value and the KS evaluation index value of the training sample set and the test sample set is within a set range, the newly added overdue user sample and the first user sample set are combined to obtain a modeling data set.
[0088] In a possible implementation, in step S103, the third quantity G may be calculated by the following formula:
[0089] G=(m1-m2)*β,
[0090] Where m1 is the first number, m2 is the second number, and β belongs to (0,1). When β is equal to 1, the number of non-overdue samples and overdue samples in the final new sample set is the same.
[0091] In a possible implementation, in step S104, for each of the overdue user samples, a characteristic distance of the user characteristic data between the overdue user sample and other user samples may be calculated, where the characteristic distance includes Euclidean distance or Manhattan distance.
[0092] A fourth number of user samples that are closest to the feature of the overdue user sample are obtained as a neighboring sample set of the overdue user sample.
[0093] In a possible implementation, step S106 may be to calculate the first proportion data r corresponding to the i-th overdue user sample. i , calculate the corresponding second proportion data through the following formula
[0094]
[0095] Wherein, n is the second number of the overdue user samples.
[0096] In a possible implementation, in step S107, the fifth quantity g may be calculated by the following formula: i :
[0097]
[0098] Wherein, G is the third quantity, This is the second percentage data.
[0099] In a possible implementation, in step S108, for the i-th overdue user sample x i Repeat the fifth number of times to select the overdue user sample x i A sample of other overdue users x randomly determined from the adjacent sample set zi , and calculate the corresponding newly added overdue user sample s by the following formula i :
[0100] s i =x i +(x zi -x i )×λ
[0101] Where λ is a natural number belonging to (0,1].
[0102] In a possible implementation manner, in step S101, a total sample set may be obtained, and the total sample set may be divided into the first user sample set and the fourth user sample set.
[0103] After step S112, the method further includes:
[0104] Step S113, using the first user sample set, the training sample set and the model trained by the modeling data set to perform classification prediction on the fourth user sample set, and obtaining corresponding AUC evaluation index values and KS evaluation index values according to the prediction results.
[0105] Step S114: If the AUC evaluation index value and the KS evaluation index value corresponding to the modeling data set are improved to a preset threshold compared with the AUC evaluation index value and the KS evaluation index value corresponding to the first user sample set and the training sample set, it is determined that the modeling data set meets the sample expansion requirements.
[0106] Please refer to Figure 3 This embodiment further provides a user sample processing device 110, which includes at least one functional module that can be stored in a machine-readable storage medium 120 in the form of software. Functionally, the user sample processing device 110 may include a data acquisition module 101, a first data processing module 102, a second data processing module 103, a third data processing module 104, a fourth data processing module 105, a fifth data processing module 106, a sixth data processing module 107, a seventh data processing module 108, an eighth data processing module 109, a ninth data processing module 110, a tenth data processing module 111, a model training module 112, and a sample combination module 113.
[0107] The data acquisition module 101 is used to acquire a first user sample set, where the first user sample set includes a plurality of user samples, and the user samples include a plurality of user feature data representing user feature information.
[0108] In this embodiment, the data acquisition module 101 can be used to execute Figure 1 As shown in step S101, for a detailed description of the data acquisition module 101, please refer to the description of step S101.
[0109] The first data processing module 102 is used to determine a first number of existing non-overdue user samples and a second number of existing overdue user samples in the first user sample set, wherein the existing non-overdue user samples are user samples without a loan overdue sample label, and the existing overdue user samples are user samples with a loan overdue sample label.
[0110] In this embodiment, the first data processing module 102 can be used to perform Figure 1 As shown in step S102, for a detailed description of the first data processing module 102, please refer to the description of step S102.
[0111] The second data processing module 103 is used to calculate a third number of newly added overdue user samples that need to be generated according to the first number and the second number.
[0112] In this embodiment, the second data processing module 103 can be used to execute Figure 1 As shown in step S103, for the detailed description of the second data processing module 103, please refer to the description of step S103.
[0113] The third data processing module 104 is configured to determine, for each of the overdue user samples, a neighboring sample set of the overdue user sample, wherein the neighboring sample set includes a fourth number of user samples having the shortest feature distance to the overdue user sample.
[0114] In this embodiment, the third data processing module 104 can be used to execute Figure 1 As shown in step S104, for the detailed description of the third data processing module 104, please refer to the description of step S104.
[0115] The fourth data processing module 105 is used to determine, for each adjacent sample set of the overdue user samples, first percentage data of the overdue user samples in the adjacent sample set.
[0116] In this embodiment, the fourth data processing module 105 can be used to execute Figure 1As shown in step S105, for the specific description of the fourth data processing module 105, please refer to the description of step S105.
[0117] The fifth data processing module 106 is used to standardize the first proportion data corresponding to each of the overdue user samples to obtain second proportion data.
[0118] In this embodiment, the fifth data processing module 106 can be used to execute Figure 1 As shown in step S106, for a detailed description of the fifth data processing module 106, please refer to the description of step S106.
[0119] The sixth data processing module 107 is used to calculate the fifth number of newly added overdue user samples that need to be generated corresponding to each of the existing overdue user samples according to the third number and the second proportion data.
[0120] In this embodiment, the sixth data processing module 107 can be used to execute Figure 1 As shown in step S107, for the specific description of the sixth data processing module 107, please refer to the description of step S107.
[0121] The seventh data processing module 108 is used to generate the corresponding fifth number of newly added overdue user samples for each of the existing overdue user samples, wherein each newly added overdue user sample is calculated from the existing overdue user sample and another existing overdue user sample randomly determined from a sample set adjacent to the existing overdue user sample.
[0122] In this embodiment, the seventh data processing module 108 can be used to perform Figure 1 As shown in step S108, for the detailed description of the seventh data processing module 108, please refer to the description of step S108.
[0123] The eighth data processing module 109 is used to perform clustering processing on each of the existing non-overdue user samples, wherein the number of clusters is the second number.
[0124] In this embodiment, the eighth data processing module 109 can be used to execute Figure 1 As shown in step S109, for the specific description of the eighth data processing module 109, please refer to the description of step S109.
[0125] The ninth data processing module 110 is configured to obtain a second user sample set by sampling from the center of each cluster, and to combine the second user sample set with the existing overdue user samples to obtain a training sample set.
[0126] In this embodiment, the ninth data processing module 110 can be used to execute Figure 1 As shown in step S110, for a detailed description of the ninth data processing module 110, please refer to the description of step S110.
[0127] The tenth data processing module 111 is used to divide the newly added overdue user samples to obtain the second number of third user sample sets, and respectively combine each of the third user sample sets with the second user sample set to obtain the second number of test sample sets.
[0128] In this embodiment, the tenth data processing module 111 can be used to execute Figure 1 As shown in step S111, for the detailed description of the tenth data processing module 111, please refer to the description of step S111.
[0129] The model training module 112 is used to train the model through the training sample set, test the model through the test sample set, and calculate the AUC evaluation index value and the KS evaluation index value of the training sample set and the test sample set.
[0130] In this embodiment, the model training module 112 can be used to perform Figure 1 As shown in step S112, for the specific description of the model training module 112, please refer to the description of step S112.
[0131] The sample combination module 113 is used to combine the newly added overdue user sample with the first user sample set to obtain a modeling data set if the difference between the AUC evaluation index value and the KS evaluation index value of the training sample set and the test sample set is within a set range.
[0132] In this embodiment, the sample combination module 113 can be used to perform Figure 1 As shown in step S113, for the specific description of the sample combination module 113, please refer to the description of step S113.
[0133] To sum up, the method of this patent is to expand the overdue user samples with a low proportion through an adaptive comprehensive oversampling method, which can avoid the interference to the model caused by information loss and increase in information weight, and at the same time meet the need to balance the sample proportion.
[0134] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0135] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0136] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0137] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0138] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A user sample processing method, characterized in that: The method comprises: Acquire a first user sample set, wherein the first user sample set includes a plurality of user samples, and the user samples include a plurality of user feature data representing user feature information; Determine a first number of existing non-overdue user samples and a second number of existing overdue user samples in the first user sample set; wherein the existing non-overdue user samples are user samples without loan overdue sample labels, and the existing overdue user samples are user samples with loan overdue sample labels; Calculate a third number of newly added overdue user samples that need to be generated according to the first number and the second number; For each of the overdue user samples, determine a neighboring sample set of the overdue user sample; the neighboring sample set includes a fourth number of user samples having the shortest feature distance to the overdue user sample; For each adjacent sample set of the overdue user sample, determine first percentage data of the overdue user samples in the adjacent sample set; Standardize the first percentage data corresponding to each of the overdue user samples to obtain second percentage data; Calculate, according to the third number and the second proportion data, a fifth number of newly added overdue user samples that need to be generated corresponding to each of the existing overdue user samples; For each of the existing overdue user samples, a corresponding fifth number of newly added overdue user samples is generated; wherein each of the newly added overdue user samples is calculated from the existing overdue user sample and another existing overdue user sample randomly determined from a set of adjacent samples of the existing overdue user sample; Performing clustering processing on each of the existing non-overdue user samples, wherein the number of clusters is the second number; Sampling from the center of each of the clusters to obtain a second user sample set, and combining the second user sample set with the existing overdue user samples to obtain a training sample set; Segmenting the newly added overdue user samples to obtain the second number of third user sample sets, and combining each of the third user sample sets with the second user sample set to obtain the second number of test sample sets; The model is trained by the training sample set, the model is tested by the test sample set, and the AUC evaluation index value and the KS evaluation index value of the training sample set and the test sample set are calculated; If the difference between the AUC evaluation index value and the KS evaluation index value of the training sample set and the test sample set is within a set range, the newly added overdue user sample and the first user sample set are combined to obtain a modeling data set.
2. The method according to claim 1, characterized in that The step of calculating a third number of newly added overdue user samples to be generated according to the first number and the second number includes: The third quantity G is calculated by the following formula: G = (m1-m2)*β, Wherein, m1 is the first number, m2 is the second number, and β belongs to (0,1].
3. The method according to claim 1, characterized in that The step of normalizing the first proportion data corresponding to each of the overdue user samples to obtain the second proportion data includes: The first percentage data r corresponding to the i-th overdue user sample i , calculate the corresponding second proportion data through the following formula Wherein, n is the second number of the overdue user samples.
4. The method according to claim 1, characterized in that The step of generating the corresponding fifth number of newly added overdue user samples for each of the existing overdue user samples includes: For the i-th overdue user sample x i Repeat the fifth number of times to select the overdue user sample x i A sample of other overdue users x randomly determined from the adjacent sample set zi , and calculate the corresponding newly added overdue user sample s by the following formula i : s i =x i +(x zi -x i )×λ Where λ is a natural number belonging to (0,1].
5. The method according to claim 1, characterized in that The step of determining, for each of the overdue user samples, a set of adjacent samples of the overdue user sample comprises: For each of the overdue user samples, calculating a characteristic distance of the user characteristic data between the overdue user sample and other user samples, wherein the characteristic distance includes a Euclidean distance or a Manhattan distance; A fourth number of user samples that are closest to the feature of the overdue user sample are obtained as a neighboring sample set of the overdue user sample.
6. The method according to claim 1, characterized in that The step of calculating the fifth number of newly added overdue user samples that need to be generated corresponding to each of the existing overdue user samples according to the third number and the second proportion data includes: The fifth quantity g is calculated by the following formula i : Wherein, G is the third quantity, This is the second percentage data.
7. The method according to claim 1, characterized in that The step of obtaining the first user sample set includes: Acquire a total sample set, and divide the total sample set into the first user sample set and the fourth user sample set; The method further comprises: Using the models trained by the first user sample set, the training sample set, and the modeling data set respectively to perform classification prediction on the fourth user sample set, and obtaining corresponding AUC evaluation index values and KS evaluation index values according to the prediction results; If the AUC evaluation index value and the KS evaluation index value corresponding to the modeling data set are improved to a preset threshold compared with the AUC evaluation index value and the KS evaluation index value corresponding to the first user sample set and the training sample set, it is determined that the modeling data set meets the sample expansion requirements.
8. A user sample processing device, characterized in that: The user sample processing device comprises: A data acquisition module, configured to acquire a first user sample set, wherein the first user sample set includes a plurality of user samples, and the user samples include a plurality of user feature data representing user feature information; A first data processing module is used to determine a first number of existing non-overdue user samples and a second number of existing overdue user samples in the first user sample set; wherein the existing non-overdue user samples are user samples without loan overdue sample labels, and the existing overdue user samples are user samples with loan overdue sample labels; A second data processing module, configured to calculate a third number of newly added overdue user samples to be generated according to the first number and the second number; A third data processing module is used to determine, for each of the overdue user samples, a neighboring sample set of the overdue user sample; the neighboring sample set includes a fourth number of user samples with the shortest feature distance to the overdue user sample; A fourth data processing module is used to determine, for each adjacent sample set of the overdue user samples, first percentage data of the overdue user samples in the adjacent sample set; A fifth data processing module, configured to normalize the first proportion data corresponding to each of the overdue user samples to obtain second proportion data; a sixth data processing module, configured to calculate, according to the third number and the second proportion data, a fifth number of newly added overdue user samples that need to be generated corresponding to each of the existing overdue user samples; A seventh data processing module is used to generate the corresponding fifth number of newly added overdue user samples for each of the existing overdue user samples; wherein each of the newly added overdue user samples is calculated from the existing overdue user sample and another existing overdue user sample randomly determined from a sample set adjacent to the existing overdue user sample; an eighth data processing module, configured to perform clustering processing on each of the existing non-overdue user samples, wherein the number of clusters is the second number; A ninth data processing module, configured to obtain a second user sample set by sampling from the center of each of the clusters, and to combine the second user sample set with the existing overdue user samples to obtain a training sample set; a tenth data processing module, configured to segment the newly added overdue user samples to obtain the second number of third user sample sets, and respectively combine each of the third user sample sets with the second user sample set to obtain the second number of test sample sets; A model training module, used to train the model through the training sample set, test the model through the test sample set, and calculate the AUC evaluation index value and KS evaluation index value of the training sample set and the test sample set; The sample combination module is used to combine the newly added overdue user sample with the first user sample set to obtain a modeling data set if the difference between the AUC evaluation index value and the KS evaluation index value of the training sample set and the test sample set is within a set range.
9. An electronic device, characterized in that: The method comprises a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are executed by the processor, the method according to any one of claims 1 to 7 is implemented.
10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are executed by one or more processors, the method according to any one of claims 1 to 7 is implemented.
