Model training method and device, electronic equipment and storage medium
By amplifying the first type of data in credit card user data, the problem of unbalanced positive and negative samples in the financial data prediction model is solved, and the model training effect and fitting quality are improved.
Patent Information
- Application Number
- CN202411763936.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-04-04
AI Technical Summary
When training financial data prediction models, due to the uneven number of positive and negative samples, the model training effect is poor and the model fitting quality is low.
By acquiring credit card user data, when the number of first type of data (data with overdue repayment behavior) is detected that the number of first type of data (data with overdue repayment behavior) is less than the second type of data (data with no overdue repayment behavior) and the quantity difference is greater than the preset threshold, the first type of data is amplified to generate the target number of first type data to ensure the equilibrium of the number of positive and negative samples.
By amplifying the first type of data, the relative balance of the number of positive and negative samples when training the neural network model is ensured, avoiding the problem of overfitting or insufficient fitting in model training, and improving the model training effect and model fitting quality.
Smart Images

Figure CN119760424A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and specifically, to a model training method, device, electronic device and storage medium. Background Art
[0002] In the prior art, user data can be analyzed and prediction tasks can be established by training a neural network model. For example, in the financial field, a neural network model can be trained based on the user's financial data (such as credit opening user data), and then the trained neural network model can be used to perform related prediction tasks.
[0003] However, it should be noted that the fitting effect of the neural network model depends to a large extent on the number of positive and negative samples and the balance of the number of positive and negative samples. However, due to factors such as protecting user privacy data, in fact, in the financial field, positive sample data is usually easier to obtain, but negative sample data is usually difficult to obtain. This leads to an imbalance in the number of positive and negative samples required for model training, which in turn affects the final model training effect and model fitting quality.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a model training method, device, electronic device and storage medium to at least solve the technical problems in the prior art of poor model training effect and low model fitting quality caused by the imbalance in the number of positive and negative samples when training a financial data prediction model.
[0006] According to one aspect of an embodiment of the present application, a model training method is provided, including: with user authorization, obtaining first type data and second type data, wherein the first type data belongs to credit card user data with overdue repayment behavior, and the second type data belongs to credit card user data without overdue repayment behavior; when it is detected that the amount of first type data is less than the amount of second type data, and the difference in the amount of first type data and second type data is greater than a preset threshold, performing an amplification operation on the first type data, wherein the amplification operation is used to generate a target amount of first type data based on the amount of first type data, the multiple of the amount of first type data to be increased, and the number of K neighboring data of the first type data; wherein K is an integer greater than 1, and the difference in the amount of first type data and second type data after the amplification operation is less than or equal to the preset threshold; and iteratively training a neural network based on the first type data and the second type data to obtain a target neural network model.
[0007] Optionally, obtaining the first type of data and the second type of data includes: with user authorization, obtaining N credit card user data, wherein N is an integer greater than 1; preprocessing the N credit card user data, wherein the preprocessing is used to select mathematical statistical values of numerical data in the N credit card user data to fill the missing values when it is detected that any credit card user data has missing values; using the data with overdue repayment behavior in the N credit card user data after the preprocessing as the first type of data; and using the data without overdue repayment behavior in the N credit card user data after the preprocessing as the second type of data.
[0008] Optionally, before performing an amplification operation on the first type of data, the model training method also includes: determining a quantity multiple by which the first type of data needs to be increased based on a difference between the quantity of the first type of data and the quantity of the second type of data; and determining a target quantity of the first type of data that needs to be newly added based on the quantity multiple and the quantity of the first type of data.
[0009] Optionally, an amplification operation is performed on the first type of data, including: forming a data set with the currently acquired first type of data and second type of data; performing multiple target operations on the data set until a target number of first type of data is newly generated, wherein each target operation is used to randomly select a first type of data from the data set, and generate new first type of data based on the K nearest neighbor data of the selected first type of data in the data set.
[0010] Optionally, the target operation includes the following steps: taking the K nearest neighbor data of the Ith first type data in the data set as a neighbor sample set corresponding to the Ith first type data, wherein the Ith first type data is a first type data randomly selected from the data set; randomly selecting a data from the neighbor sample set, and calculating the vector difference between the data and the Ith first type data; calculating the product of the vector difference and a random value to obtain a product result, wherein the random value is a value greater than 0 and less than 1; summing the product result and the Ith first type data to obtain newly generated first type data.
[0011] Optionally, after summing the product result and the Ith first type data to obtain the newly generated first type data, the model training method also includes: detecting the similarity between the newly generated first type data and the K nearest neighbor data; when the similarity is greater than a preset similarity, retaining the newly generated first type data; when the similarity is less than or equal to the preset similarity, deleting the newly generated first type data.
[0012] Optionally, a neural network is iteratively trained according to the first type of data and the second type of data to obtain a target neural network model, including: using the first type of data and the second type of data as model training data; performing feature encoding processing on the model training data, wherein the feature encoding processing is used to one-hot encode discrete variable information in the model training data, and convert non-numeric data in the model training data into numerical feature data by encoding; performing feature extraction on the model training data that has completed the feature encoding processing to obtain training features; normalizing the training features to obtain target features; and iteratively training the neural network according to the target features to obtain a target neural network model.
[0013] Optionally, the neural network is iteratively trained according to the target feature to obtain a target neural network model, including: calculating the variance of the target feature and the discrete target variable, wherein the discrete target variable is a preset credit card user data characteristic value; calculating the ratio of the variance to the discrete target variable to obtain a correlation score between the target feature and the discrete target variable; determining a weight value corresponding to the target feature according to the correlation score; and iteratively training the neural network according to the target feature and the weight value corresponding to the target feature to obtain the target neural network model.
[0014] Optionally, after iteratively training the neural network based on the first type of data and the second type of data to obtain the target neural network model, the model training method also includes: obtaining the credit card user data of the target user; performing feature extraction on the credit card user data of the target user to obtain the credit card data features of the target user; inputting the credit card data features of the target user into the target neural network model, and determining the probability value of the target user's overdue repayment behavior based on the credit card data features of the target user according to the prior knowledge learned by the target neural network model in the model training phase.
[0015] According to another aspect of the present application, a model training device is also provided, which includes: an acquisition unit, which is used to acquire first type data and second type data with user authorization, wherein the first type data belongs to credit card user data with overdue repayment behavior, and the second type data belongs to credit card user data without overdue repayment behavior; a processing unit, which is used to perform an amplification operation on the first type data when it is detected that the amount of the first type data is less than the amount of the second type data, and the difference in the amount of the first type data and the second type data is greater than a preset threshold, wherein the amplification operation is used to generate a target amount of first type data based on the amount of the first type data, the multiple of the amount of the first type data to be increased, and the number of K neighboring data of the first type data; wherein K is an integer greater than 1, and the difference in the amount of the first type data and the second type data after the amplification operation is less than or equal to the preset threshold; a training unit, which is used to iteratively train the neural network based on the first type data and the second type data to obtain a target neural network model.
[0016] Optionally, the acquisition unit includes: a first acquisition subunit, a preprocessing subunit, a first processing subunit, and a second processing subunit. The first acquisition subunit is used to acquire N credit card user data with the authorization of the user, wherein N is an integer greater than 1; the preprocessing subunit is used to preprocess the N credit card user data, wherein the preprocessing is used to select mathematical statistics of numerical data in the N credit card user data to fill the missing value when any credit card user data is detected to have missing values; the first processing subunit is used to take the data with overdue repayment behavior in the N credit card user data after the preprocessing as the first type of data; the second processing subunit is used to take the data with no overdue repayment behavior in the N credit card user data after the preprocessing as the second type of data.
[0017] Optionally, the model training device includes: a first determining subunit and a second determining subunit. The first determining subunit is used to determine the number multiple of the first type of data that needs to be increased according to the difference between the number of the first type of data and the number of the second type of data; the second determining subunit is used to determine the target number of the first type of data that needs to be added according to the number multiple and the number of the first type of data.
[0018] Optionally, the processing unit includes: a first processing subunit and a second processing subunit. The first processing subunit is used to form a data set with the currently acquired first type data and second type data; the second processing subunit is used to perform multiple target operations on the data set until a target number of first type data is newly generated, wherein each target operation is used to randomly select a first type data from the data set, and generate new first type data according to the K nearest neighbor data of the selected first type data in the data set.
[0019] Optionally, the second processing subunit includes: a first processing module, a second processing module, a third processing module, and a fourth processing module, the first processing module being used to use the K nearest neighbor data of the Ith first type data in the data set as a neighbor sample set corresponding to the Ith first type data, wherein the Ith first type data is a first type data randomly selected from the data set; the second processing module being used to randomly select a data from the neighbor sample set, and calculate the vector difference between the data and the Ith first type data; the third processing module being used to calculate the product of the vector difference and a random value to obtain a product result, wherein the random value is a value greater than 0 and less than 1; the fourth processing module being used to sum the product result and the Ith first type data to obtain newly generated first type data.
[0020] Optionally, the model training device includes: a detection unit, a first processing unit, and a second processing unit. The detection unit is used to detect the similarity between the newly generated first type data and the K nearest neighbor data; the first processing unit is used to retain the newly generated first type data when the similarity is greater than a preset similarity; and the second processing unit is used to delete the newly generated first type data when the similarity is less than or equal to the preset similarity.
[0021] Optionally, the training unit includes: a third processing subunit, a fourth processing subunit, a fifth processing subunit, a sixth processing subunit, and a training subunit. The third processing subunit is used to use the first type of data and the second type of data as model training data; the fourth processing subunit is used to perform feature encoding processing on the model training data, wherein the feature encoding processing is used to perform one-hot encoding on the discrete variable information in the model training data, and to convert the non-numeric data in the model training data into numerical feature data by encoding; the fifth processing subunit is used to perform feature extraction on the model training data that has completed the feature encoding processing to obtain training features; the sixth processing subunit is used to perform normalization processing on the training features to obtain target features; the training subunit is used to iteratively train the neural network according to the target features to obtain a target neural network model.
[0022] Optionally, the training subunit includes: a first calculation module, a second calculation module, a first determination module, and a training module, wherein the first calculation module is used to calculate the variance of the target feature and the discrete target variable, wherein the discrete target variable is a preset credit card user data feature value; the second calculation module is used to calculate the ratio of the variance to the discrete target variable to obtain a correlation score between the target feature and the discrete target variable; the first determination module is used to determine the weight value corresponding to the target feature according to the correlation score; and the training module is used to iteratively train the neural network according to the target feature and the weight value corresponding to the target feature to obtain a target neural network model.
[0023] Optionally, the model training device includes: a first acquisition unit, a feature extraction unit, and a determination unit. The first acquisition unit is used to acquire the credit card user data of the target user; the feature extraction unit is used to extract features from the credit card user data of the target user to obtain the credit card data features of the target user; the determination unit is used to input the credit card data features of the target user into the target neural network model, and determine the probability value of the target user's overdue repayment behavior based on the credit card data features of the target user according to the prior knowledge learned by the target neural network model in the model training stage.
[0024] According to another aspect of the present application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, wherein when the computer program runs, the device where the computer-readable storage medium is located executes the above-mentioned model training method.
[0025] According to another aspect of the present application, an electronic device is also provided, wherein the electronic device includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors execute the above-mentioned model training method.
[0026] In the present application, with the authorization of the user, the first type of data and the second type of data are obtained, wherein the first type of data belongs to the credit card user data with overdue repayment behavior, and the second type of data belongs to the credit card user data without overdue repayment behavior. Then, when it is detected that the amount of the first type of data is less than the amount of the second type of data, and the difference in the amount of the first type of data and the second type of data is greater than a preset threshold, the first type of data is amplified, wherein the amplification operation is used to generate a target amount of the first type of data according to the amount of the first type of data, the multiple of the amount of the first type of data to be increased, and the number of K neighboring data of the first type of data; wherein K is an integer greater than 1, and the difference in the amount of the first type of data and the second type of data after the amplification operation is less than or equal to the preset threshold. Finally, the neural network is iteratively trained according to the first type of data and the second type of data to obtain the target neural network model.
[0027] It can be seen from the above content that the present application generates a sufficient number of first type data by performing an amplification operation on the first type of data, utilizing the number of first type data, the multiple of the number of first type data that needs to be increased, and the number of K neighboring data of the first type data, thereby achieving the purpose of controlling the difference in the number of first type data and second type data to be less than or equal to a preset threshold, thereby ensuring that the number of positive and negative samples is relatively balanced when training the target neural network model, avoiding the problem of overfitting or insufficient fitting in model training, thereby improving the model training effect and model fitting quality, and solving the technical problems in the prior art of poor model training effect and low model fitting quality caused by the imbalance in the number of positive and negative samples when training financial data prediction models. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0029] Figure 1 A hardware structure block diagram of a computer terminal for implementing the model training method of an embodiment of the present application is shown;
[0030] Figure 2 is a flowchart of an optional model training method according to an embodiment of the present application;
[0031] Figure 3 is an optional target operation flow chart according to an embodiment of the present application;
[0032] Figure 4 is a schematic diagram of an optional model training device according to an embodiment of the present application;
[0033] Figure 5 It is a structural diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to enable those skilled in the art to better understand the solution of the present application, 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 only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0036] It should also be noted that the collected information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with relevant laws, regulations and standards, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions to provide users with corresponding operation entrances for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process will be entered.
[0037] According to an embodiment of the present application, an embodiment of a model training method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0038] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing the model training method of an embodiment of the present application. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0039] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuit may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be fully or partially integrated into any of the other components in the computer terminal 10 (or mobile device). As in the model training method involved in the embodiments of the present application, the data processing circuit serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0040] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the model training method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned model training method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0041] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0042] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0043] Under the above operating environment, this application provides Figure 2 The model training method shown. Figure 2 FIG. 1 is a flow chart of an optional model training method according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0044] Step S201: Acquire first type data and second type data with user authorization.
[0045] In step S201, the first type of data belongs to the credit card user data with overdue repayment behavior, and the second type of data belongs to the credit card user data without overdue repayment behavior.
[0046] Optionally, a credit card data processing system can be used as the execution subject of the model training method of the embodiment of the present application, wherein the credit card data processing system can be a software system or an embedded system combining software and hardware. In addition, in addition to using credit card data processing as the execution subject, any other type of equipment, device, or system can be used as the execution subject of the model training method of the embodiment of the present application. Those skilled in the art can understand that the present application does not specifically limit the form of the execution subject.
[0047] For the convenience of description, the following description will be made using the credit card data processing system as the execution entity.
[0048] Optionally, with the authorization of the user, the credit card data processing system can collect and organize credit card user data through the bank's internal system, credit institutions and third-party data providers. The credit card user data includes categorical data and numerical data.
[0049] Optionally, the acquired credit card user data may be labeled, including: labeling the credit card user data with overdue repayment as first type data; and labeling the credit card user data without overdue repayment as second type data.
[0050] Step S202: when it is detected that the amount of the first type of data is less than the amount of the second type of data and the difference between the amount of the first type of data and the amount of the second type of data is greater than a preset threshold, perform an amplification operation on the first type of data.
[0051] In step S202, an amplification operation is used to generate a target number of first type data based on the number of first type data, the multiple by which the first type data needs to be increased, and the number of K neighboring data of the first type data; wherein K is an integer greater than 1, and the difference in the number of the first type data and the second type data after the amplification operation is less than or equal to a preset threshold.
[0052] Optionally, in the financial field, especially in the field of credit card consumption, it is often easier to obtain data on credit card users who do not have overdue repayments, but it is difficult to obtain data on credit card users who have overdue repayments. Therefore, generally speaking, the amount of the first type of data is much less than the second type of data. However, for model training, if the number of positive samples (second type of data) is much higher than the number of negative samples (first type of data), it is easy to cause poor fitting effect. At the same time, in the process of model training, the more training samples there are, the better the training effect of the model. Therefore, this application adopts the method of amplifying the first type of data to solve the problem of imbalance between the amount of the first type of data and the second type of data.
[0053] It should be noted that this application proposes for the first time a new sample amplification method, namely, generating a target number of first-type data based on the number of first-type data, the multiple of the number by which the first-type data needs to be increased, and the number of K neighboring data of the first-type data, so as to combine the characteristics of the neighboring data of the first-type data to generate new first-type data with similar characteristics to the neighboring data.
[0054] Step S203, iteratively training the neural network according to the first type of data and the second type of data to obtain a target neural network model.
[0055] Optionally, the neural network can be a deep neural network or a logistic regression model. In the present application, the first type of data and the second type of data are used as training data for the neural network, and the label of the first type of data (there is overdue repayment behavior) and the label of the second type of data (there is no overdue repayment behavior) are used as training labels for the neural network. The neural network is trained iteratively for multiple times, and finally the target neural network model is trained.
[0056] Based on the contents of the above steps S201 to S203, it can be known that in this application, with the authorization of the user, the first type of data and the second type of data are obtained, wherein the first type of data belongs to the credit card user data with overdue repayment behavior, and the second type of data belongs to the credit card user data without overdue repayment behavior. Then, when it is detected that the amount of the first type of data is less than the amount of the second type of data, and the difference in the amount of the first type of data and the second type of data is greater than the preset threshold, the first type of data is amplified, wherein the amplification operation is used to generate a target amount of the first type of data according to the amount of the first type of data, the multiple of the amount of the first type of data to be increased, and the number of K neighboring data of the first type of data; wherein K is an integer greater than 1, and the difference in the amount of the first type of data and the second type of data after the amplification operation is less than or equal to the preset threshold. Finally, the neural network is iteratively trained according to the first type of data and the second type of data to obtain the target neural network model.
[0057] It can be seen from the above content that the present application generates a sufficient number of first type data by performing an amplification operation on the first type of data, utilizing the number of first type data, the multiple of the number of first type data that needs to be increased, and the number of K neighboring data of the first type data, thereby achieving the purpose of controlling the difference in the number of first type data and second type data to be less than or equal to a preset threshold, thereby ensuring that the number of positive and negative samples is relatively balanced when training the target neural network model, avoiding the problem of overfitting or insufficient fitting in model training, thereby improving the model training effect and model fitting quality, and solving the technical problems in the prior art of poor model training effect and low model fitting quality caused by the imbalance in the number of positive and negative samples when training financial data prediction models.
[0058] In an optional embodiment, when obtaining the first type of data and the second type of data, first, with the authorization of the user, N credit card user data are obtained, where N is an integer greater than 1. Then, the N credit card user data are preprocessed, wherein the preprocessing is used to select mathematical statistics of numerical data in the N credit card user data to fill the missing values when it is detected that any credit card user data has missing values. Subsequently, the data with overdue repayment behavior in the N credit card user data after the preprocessing is taken as the first type of data; the data without overdue repayment behavior in the N credit card user data after the preprocessing is taken as the second type of data.
[0059] Optionally, the above-mentioned mathematical statistical values include: mean, median, mode and other numerical values.
[0060] Optionally, in the preprocessing stage, in addition to selecting mathematical statistical values of numerical data in N credit card user data to fill missing values, data statistical values can also be used to replace abnormal values such as duplicate values, invalid values, etc. in the credit card user data.
[0061] In an optional embodiment, before performing an amplification operation on the first type of data, the model training method further includes: determining a multiple by which the first type of data needs to be increased based on a difference between the number of the first type of data and the number of the second type of data; and determining a target number of first type of data that needs to be added based on the multiple and the number of the first type of data.
[0062] Optionally, the credit card data processing system first calculates the difference between the amount of the first type of data collected and the amount of the second type of data, and then determines the amount multiple (e.g., R%) of the first type of data that needs to be increased based on the difference, and then determines the target amount of the first type of data that needs to be added based on the amount multiple and the current amount of the first type of data. For example, assuming that the current amount of the first type of data is T, the target amount is T*R%.
[0063] In an optional embodiment, an amplification operation is performed on the first type of data, including: forming a data set with the currently acquired first type of data and second type of data; performing multiple target operations on the data set until a target number of first type of data is newly generated, wherein each target operation is used to randomly select a first type of data from the data set, and generate new first type of data based on the K nearest neighbor data of the selected first type of data in the data set.
[0064] Optionally, all the first type data and second type data currently acquired can be combined into a data set X, and then multiple target operations are performed on the data set X, wherein each target operation is used to generate a new first type data, specifically including: randomly selecting a first type data (which can be recorded as Xicd) from the data set X, and generating a new first type data from the K nearest neighbor data in the data set X based on the selected first type data Xicd.
[0065] In an optional embodiment, Figure 3 is an optional target operation flow chart according to an embodiment of the present application, such as Figure 3 As shown, the following steps are included:
[0066] Step S301: Take the K nearest neighbor data of the I-th first type data in the data set as the neighbor sample set corresponding to the I-th first type data.
[0067] In step S301, the Ith first type data is a first type data randomly selected from the data set.
[0068] Step S302: randomly select a data from the neighbor sample set, and calculate the vector difference between the data and the Ith first type data.
[0069] Step S303, calculating the product of the vector difference and the random value to obtain a product result, wherein the random value is a value greater than 0 and less than 1.
[0070] Step S304, summing the product result and the Ith first type data to obtain newly generated first type data.
[0071] Optionally, at each target operation, a first type of data Xicd is randomly selected from the data set X, and then the K nearest neighbor data of the first type of data Xicd are determined from the data set X to form a neighbor sample set Xinn, nn∈{1, 2, ..., K}. Subsequently, any data is selected from the neighbor sample set Xinn and recorded as Xiab, and the vector difference between the data Xiab and the first type of data Xicd is calculated, and then the product of the vector difference and the random value is calculated, and then the first type of data Xicd is added to obtain a newly generated first type of data Xs. The specific calculation process can refer to formula (1):
[0072] Xs=Xicd+(Xiab-Xicd)×rand(0,1) (1)
[0073] Among them, rand(0,1) represents the above-mentioned random value.
[0074] In an optional embodiment, after the product result and the Ith first type data are summed to obtain the newly generated first type data, the credit card data processing system may further detect the similarity between the newly generated first type data and the K nearest neighbor data. If the similarity is greater than a preset similarity, the newly generated first type data is retained; if the similarity is less than or equal to the preset similarity, the newly generated first type data is deleted.
[0075] Optionally, the preset similarity can be customized. For the newly generated first type data Xs, it is necessary to calculate the similarity between the first type data Xs and the K nearest neighbor data in the neighbor sample set Xinn, and then determine whether to retain the first type data Xs based on the similarity. For example, when the similarity is greater than the preset similarity, the newly generated first type data Xs is retained; when the similarity is less than or equal to the preset similarity, the newly generated first type data Xs is deleted.
[0076] In an optional embodiment, in the process of iteratively training the neural network according to the first type of data and the second type of data to obtain the target neural network model, the credit card data processing system can use the first type of data and the second type of data as model training data, and then perform feature encoding processing on the model training data, wherein the feature encoding processing is used to perform unique hot encoding on the discrete variable information in the model training data, and to convert the non-numeric data in the model training data into numerical feature data by encoding. Subsequently, feature extraction is performed on the model training data that has completed the feature encoding processing to obtain training features, and the training features are normalized to obtain target features. Finally, the neural network is iteratively trained according to the target features to obtain the target neural network model.
[0077] Optionally, the credit card data processing system can perform feature processing on the first type of data (including the first type of data generated by amplification) and the second type of data to obtain target features. The feature processing includes two stages, namely feature encoding and data standardization.
[0078] Among them, in the feature encoding stage, the credit card data processing system can perform one-hot encoding on the discrete variables in the first type of data and the second type of data, and perform label feature encoding on the categorical data to convert them into numerical feature data. After the feature encoding stage, the feature data corresponding to the first type of data and the second type of data can be obtained (corresponding to the above-mentioned training features).
[0079] During the data standardization stage, the credit card data processing system can normalize the continuous variables in the training features and scale the value range to between 0 and 1.
[0080] In an optional embodiment, the credit card data processing system can also calculate the variance of the target feature and the discrete target variable, wherein the discrete target variable is a preset credit card user data feature value. Then, the ratio of the variance to the discrete target variable is calculated to obtain the correlation score between the target feature and the discrete target variable. Subsequently, the weight value corresponding to the target feature is determined according to the correlation score. Finally, the neural network is iteratively trained according to the target feature and the weight value corresponding to the target feature to obtain the target neural network model.
[0081] Optionally, assuming that the target feature is recorded as A and the discrete target variable is recorded as E, the correlation score between the target feature and the discrete target variable can be calculated by the following formula (2).
[0082] z=(AE) 2 / E (2)
[0083] It should be noted that the correlation score and the weight value corresponding to the target feature may be positively correlated, that is, the larger the correlation score, the larger the weight value corresponding to the target feature, and the higher the importance of the target feature in the model training process.
[0084] Optionally, if there are a large number of target features, the credit card data processing system may also filter the target features according to the weight value corresponding to each target feature, thereby filtering out a preset number of target features with the largest weight values.
[0085] Optionally, since predicting whether a credit card holder defaults or not is a binary classification task, a logistic model can be constructed. Among them, a logistic model that can be used to predict customer credit card default is shown in formula (3):
[0086]
[0087] In formula (3), g(y) is the probability of default, x1, x2, ... n is the independent variable, θ1, θ2, ... θ n is the regression coefficient to be determined.
[0088] Perform logistic transformation to obtain a multivariate logistic regression model Export Where y = θ τ χ, that is
[0089] In an optional embodiment, after iteratively training the neural network based on the first type of data and the second type of data to obtain the target neural network model, the credit card data processing system can obtain the credit card user data of the target user, and then perform feature extraction on the credit card user data of the target user to obtain the credit card data features of the target user, and then input the credit card data features of the target user into the target neural network model, and determine the probability value of the target user's overdue repayment behavior based on the credit card data features of the target user according to the prior knowledge learned by the target neural network model in the model training phase.
[0090] According to another aspect of the embodiment of the present application, a model training device is also provided, wherein: Figure 4 is a schematic diagram of an optional model training device according to an embodiment of the present application, such as Figure 4 As shown, it includes: an acquisition unit 401, a processing unit 402, and a training unit 403.
[0091] Optionally, an acquisition unit 401 is used to acquire first type data and second type data with user authorization, wherein the first type data belongs to credit card user data with overdue repayment behavior, and the second type data belongs to credit card user data without overdue repayment behavior; a processing unit 402 is used to perform an amplification operation on the first type data when it is detected that the amount of the first type data is less than the amount of the second type data, and the difference in the amount of the first type data and the second type data is greater than a preset threshold, wherein the amplification operation is used to generate a target amount of first type data based on the amount of the first type data, the multiple of the amount by which the first type data needs to be increased, and the number of K neighboring data of the first type data; wherein K is an integer greater than 1, and the difference in the amount of the first type data and the second type data after the amplification operation is less than or equal to the preset threshold; a training unit 403 is used to iteratively train the neural network based on the first type data and the second type data to obtain a target neural network model.
[0092] Optionally, the acquisition unit 401 includes: a first acquisition subunit, a preprocessing subunit, a first processing subunit, and a second processing subunit. The first acquisition subunit is used to acquire N credit card user data with the authorization of the user, wherein N is an integer greater than 1; the preprocessing subunit is used to preprocess the N credit card user data, wherein the preprocessing is used to select mathematical statistics of numerical data in the N credit card user data to fill the missing value when any credit card user data is detected to have missing values; the first processing subunit is used to take the data with overdue repayment behavior in the N credit card user data after the preprocessing as the first type of data; the second processing subunit is used to take the data without overdue repayment behavior in the N credit card user data after the preprocessing as the second type of data.
[0093] Optionally, the model training device includes: a first determining subunit and a second determining subunit. The first determining subunit is used to determine the number multiple of the first type of data that needs to be increased according to the difference between the number of the first type of data and the number of the second type of data; the second determining subunit is used to determine the target number of the first type of data that needs to be added according to the number multiple and the number of the first type of data.
[0094] Optionally, the processing unit 402 includes: a first processing subunit and a second processing subunit. The first processing subunit is used to form a data set with the currently acquired first type data and second type data; the second processing subunit is used to perform multiple target operations on the data set until a target number of first type data is newly generated, wherein each target operation is used to randomly select a first type data from the data set, and generate new first type data according to the K nearest neighbor data of the selected first type data in the data set.
[0095] Optionally, the second processing subunit includes: a first processing module, a second processing module, a third processing module, and a fourth processing module, the first processing module being used to use the K nearest neighbor data of the Ith first type data in the data set as a neighbor sample set corresponding to the Ith first type data, wherein the Ith first type data is a first type data randomly selected from the data set; the second processing module being used to randomly select a data from the neighbor sample set, and calculate the vector difference between the data and the Ith first type data; the third processing module being used to calculate the product of the vector difference and a random value to obtain a product result, wherein the random value is a value greater than 0 and less than 1; the fourth processing module being used to sum the product result and the Ith first type data to obtain newly generated first type data.
[0096] Optionally, the model training device includes: a detection unit, a first processing unit, and a second processing unit. The detection unit is used to detect the similarity between the newly generated first type data and the K nearest neighbor data; the first processing unit is used to retain the newly generated first type data when the similarity is greater than a preset similarity; and the second processing unit is used to delete the newly generated first type data when the similarity is less than or equal to the preset similarity.
[0097] Optionally, the training unit includes: a third processing subunit, a fourth processing subunit, a fifth processing subunit, a sixth processing subunit, and a training subunit. The third processing subunit is used to use the first type of data and the second type of data as model training data; the fourth processing subunit is used to perform feature encoding processing on the model training data, wherein the feature encoding processing is used to perform one-hot encoding on the discrete variable information in the model training data, and to convert the non-numeric data in the model training data into numerical feature data by encoding; the fifth processing subunit is used to perform feature extraction on the model training data that has completed the feature encoding processing to obtain training features; the sixth processing subunit is used to perform normalization processing on the training features to obtain target features; the training subunit is used to iteratively train the neural network according to the target features to obtain a target neural network model.
[0098] Optionally, the training subunit includes: a first calculation module, a second calculation module, a first determination module, and a training module, wherein the first calculation module is used to calculate the variance of the target feature and the discrete target variable, wherein the discrete target variable is a preset credit card user data feature value; the second calculation module is used to calculate the ratio of the variance to the discrete target variable to obtain a correlation score between the target feature and the discrete target variable; the first determination module is used to determine the weight value corresponding to the target feature according to the correlation score; and the training module is used to iteratively train the neural network according to the target feature and the weight value corresponding to the target feature to obtain a target neural network model.
[0099] Optionally, the model training device includes: a first acquisition unit, a feature extraction unit, and a determination unit. The first acquisition unit is used to acquire the credit card user data of the target user; the feature extraction unit is used to extract features from the credit card user data of the target user to obtain the credit card data features of the target user; the determination unit is used to input the credit card data features of the target user into the target neural network model, and determine the probability value of the target user's overdue repayment behavior based on the credit card data features of the target user according to the prior knowledge learned by the target neural network model in the model training stage.
[0100] An embodiment of the present application may also provide an electronic device, Figure 5 is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 5 As shown, the electronic device may include: one or more ( Figure 5 Only one is shown) a processor, a memory, a storage controller, and a peripheral interface, wherein the peripheral interface is connected to a radio frequency module, an audio module, and a display.
[0101] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned model training method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0102] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: with the authorization of the user, obtain the first type of data and the second type of data, wherein the first type of data belongs to the credit card user data with overdue repayment behavior, and the second type of data belongs to the credit card user data without overdue repayment behavior; when it is detected that the amount of the first type of data is less than the amount of the second type of data, and the difference in the amount of the first type of data and the second type of data is greater than a preset threshold, perform an amplification operation on the first type of data, wherein the amplification operation is used to generate a target amount of the first type of data based on the amount of the first type of data, the multiple of the amount of the first type of data to be increased, and the number of K neighboring data of the first type of data; wherein K is an integer greater than 1, and the difference in the amount of the first type of data and the second type of data after the amplification operation is less than or equal to the preset threshold; iteratively train the neural network based on the first type of data and the second type of data to obtain a target neural network model.
[0103] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: with the user's authorization, obtain N credit card user data, where N is an integer greater than 1; preprocess the N credit card user data, wherein the preprocessing is used to select mathematical statistical values of numerical data in the N credit card user data to fill the missing values when it is detected that any credit card user data has missing values; the data with overdue repayment behavior in the N credit card user data after the preprocessing is used as the first type of data; the data without overdue repayment behavior in the N credit card user data after the preprocessing is used as the second type of data.
[0104] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: determine the quantity multiple by which the first type of data needs to be increased based on the difference between the quantity of the first type of data and the quantity of the second type of data; determine the target quantity of the first type of data that needs to be added based on the quantity multiple and the quantity of the first type of data.
[0105] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: combine the currently acquired first type data and second type data into a data set; perform multiple target operations on the data set until a new target number of first type data is generated, wherein each target operation is used to randomly select a first type data from the data set, and generate new first type data based on the K nearest neighbor data of the selected first type data in the data set.
[0106] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: use the K nearest neighbor data of the Ith first type data in the data set as a neighbor sample set corresponding to the Ith first type data, wherein the Ith first type data is a first type data randomly selected from the data set; randomly select a data from the neighbor sample set, and calculate the vector difference between the data and the Ith first type data; calculate the product of the vector difference and the random value to obtain the product result, wherein the random value is a value greater than 0 and less than 1; sum the product result and the Ith first type data to obtain newly generated first type data.
[0107] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: detect the similarity between the newly generated first type data and the K nearest neighbor data; when the similarity is greater than the preset similarity, retain the newly generated first type data; when the similarity is less than or equal to the preset similarity, delete the newly generated first type data.
[0108] The processor can call the information and application programs stored in the memory through the transmission device to execute the following steps: use the first type of data and the second type of data as model training data; perform feature encoding processing on the model training data, wherein the feature encoding processing is used to perform one-hot encoding on discrete variable information in the model training data, and convert non-numeric data in the model training data into numerical feature data by encoding; perform feature extraction on the model training data that has completed the feature encoding processing to obtain training features; perform normalization processing on the training features to obtain target features; and iteratively train the neural network according to the target features to obtain a target neural network model.
[0109] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: calculate the variance of the target feature and the discrete target variable, wherein the discrete target variable is a preset credit card user data feature value; calculate the ratio of the variance to the discrete target variable to obtain the correlation score between the target feature and the discrete target variable; determine the weight value corresponding to the target feature according to the correlation score; iteratively train the neural network according to the target feature and the weight value corresponding to the target feature to obtain the target neural network model.
[0110] The processor can call the information and application programs stored in the memory through the transmission device to execute the following steps: obtain the credit card user data of the target user; perform feature extraction on the credit card user data of the target user to obtain the credit card data features of the target user; input the credit card data features of the target user into the target neural network model, and determine the probability value of the target user's overdue repayment behavior based on the credit card data features of the target user according to the prior knowledge learned by the target neural network model in the model training stage.
[0111] It can be understood by those skilled in the art that Figure 5 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Figure 5 The structure of the electronic device is not limited. Figure 5 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 5 Different configurations are shown.
[0112] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0113] According to another aspect of the present application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, wherein when the computer program runs, the device where the computer-readable storage medium is located executes the above-mentioned model training method.
[0114] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0115] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0116] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0117] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0118] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0119] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it 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 or all 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 for 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 method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc., which can store program code.
[0120] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A model training method, characterized in that: include: With the authorization of the user, obtaining first type data and second type data, wherein the first type data belongs to credit card user data with overdue repayment behavior, and the second type data belongs to credit card user data without overdue repayment behavior; In the case where it is detected that the amount of the first type of data is less than the amount of the second type of data, and the difference between the amount of the first type of data and the amount of the second type of data is greater than a preset threshold, an amplification operation is performed on the first type of data, wherein the amplification operation is used to generate a target amount of the first type of data according to the amount of the first type of data, the multiple of the amount by which the first type of data needs to be increased, and the number of K neighboring data of the first type of data; wherein K is an integer greater than 1, and the difference between the amount of the first type of data and the amount of the second type of data after the amplification operation is less than or equal to the preset threshold; The neural network is iteratively trained according to the first type of data and the second type of data to obtain a target neural network model.
2. The model training method according to claim 1, characterized in that: The first type of data and the second type of data are obtained, including: With the authorization of the user, obtain N credit card user data, where N is an integer greater than 1; Preprocessing the N credit card user data, wherein the preprocessing is used to select mathematical statistics of numerical data in the N credit card user data to fill the missing value when it is detected that any credit card user data has a missing value; taking the data with overdue repayment behavior among the N credit card user data after the preprocessing as the first type of data; The data without overdue repayment behavior among the N credit card user data after the preprocessing is used as the second type of data.
3. The model training method according to claim 1, characterized in that: Before performing the amplification operation on the first type of data, the model training method further includes: Determining, according to a difference between the quantity of the first type of data and the quantity of the second type of data, a multiple by which the quantity of the first type of data needs to be increased; A target quantity of the first type of data to be added is determined according to the quantity multiple and the quantity of the first type of data.
4. The model training method according to claim 1, characterized in that: Performing an amplification operation on the first type of data includes: Combining the currently acquired first type data and second type data into a data set; Perform multiple target operations on the data set until the target number of first type data is newly generated, wherein each target operation is used to randomly select a first type data from the data set, and generate new first type data based on K nearest neighbor data of the selected first type data in the data set.
5. The model training method according to claim 4, characterized in that: The target operation includes the following steps: Taking the K nearest neighbor data of the I-th first type data in the data set as a neighbor sample set corresponding to the I-th first type data, wherein the I-th first type data is a first type data randomly selected from the data set; Randomly select a data from the neighboring sample set, and calculate the vector difference between the data and the I-th first type data; Calculating the product of the vector difference and a random value to obtain a product result, wherein the random value is a value greater than 0 and less than 1; The multiplication result and the Ith first type data are summed to obtain newly generated first type data.
6. The model training method according to claim 5, characterized in that: After summing the product result and the I-th first type data to obtain newly generated first type data, the model training method further includes: Detecting the similarity between the newly generated first type data and the K nearest neighbor data; When the similarity is greater than a preset similarity, retaining the newly generated first type of data; When the similarity is less than or equal to the preset similarity, the newly generated first type data is deleted.
7. The model training method according to claim 1, characterized in that: Iteratively training a neural network according to the first type of data and the second type of data to obtain a target neural network model includes: Using the first type of data and the second type of data as model training data; Performing feature encoding processing on the model training data, wherein the feature encoding processing is used to perform one-hot encoding on discrete variable information in the model training data, and converting non-numeric data in the model training data into numeric feature data by encoding; Performing feature extraction on the model training data that has completed the feature encoding process to obtain training features; Normalizing the training features to obtain target features; The neural network is iteratively trained according to the target features to obtain the target neural network model.
8. The model training method according to claim 7, characterized in that: Iteratively training the neural network according to the target feature to obtain the target neural network model includes: Calculating the variance of the target feature and the discrete target variable, wherein the discrete target variable is a preset credit card user data feature value; Calculating the ratio of the variance to the discrete target variable to obtain a correlation score between the target feature and the discrete target variable; Determine a weight value corresponding to the target feature according to the correlation score; The neural network is iteratively trained according to the target features and the weight values corresponding to the target features to obtain the target neural network model.
9. The model training method according to claim 1, characterized in that: After iteratively training the neural network according to the first type of data and the second type of data to obtain a target neural network model, the model training method further includes: Obtain the target user's credit card user data; Extracting features from the target user's credit card user data to obtain the target user's credit card data features; The credit card data features of the target user are input into the target neural network model, and the probability value of the target user's overdue repayment behavior is determined based on the credit card data features of the target user according to the prior knowledge learned by the target neural network model during the model training phase.
10. A model training device, characterized in that: include: An acquisition unit, configured to acquire first type data and second type data with authorization from a user, wherein the first type data belongs to credit card user data with overdue repayments, and the second type data belongs to credit card user data with no overdue repayments; a processing unit, configured to, when detecting that the amount of the first type of data is less than the amount of the second type of data, and the amount difference between the first type of data and the second type of data is greater than a preset threshold, perform an amplification operation on the first type of data, wherein the amplification operation is configured to generate a target amount of the first type of data according to the amount of the first type of data, a multiple of the amount by which the first type of data needs to be increased, and the number of K neighboring data of the first type of data; wherein K is an integer greater than 1, and the amount difference between the first type of data and the second type of data after the amplification operation is less than or equal to the preset threshold; A training unit is used to iteratively train the neural network according to the first type of data and the second type of data to obtain a target neural network model.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located executes the model training method described in any one of claims 1 to 9.
12. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the model training method described in any one of claims 1 to 9.