CN115953031A - Method and device for training risk prediction model and computer readable storage medium - Google Patents
Method and device for training risk prediction model and computer readable storage medium Download PDFInfo
- Publication number
- CN115953031A CN115953031A CN202310132757.5A CN202310132757A CN115953031A CN 115953031 A CN115953031 A CN 115953031A CN 202310132757 A CN202310132757 A CN 202310132757A CN 115953031 A CN115953031 A CN 115953031A
- Authority
- CN
- China
- Prior art keywords
- risk
- training
- risk prediction
- prediction model
- training sample
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The disclosure relates to a risk prediction model training method and device and a computer readable storage medium, and relates to the field of artificial intelligence. The training method of the risk prediction model comprises the following steps: obtaining a plurality of training samples, wherein each training sample comprises a risk label and a user characteristic, the risk label of at least one training sample in the plurality of training samples comprises a first risk label generated in a first time window and a second risk label generated in a second time window, and the length of the first time window is greater than that of the second time window; generating a risk prediction result by utilizing a risk prediction model according to the user characteristics aiming at each training sample; and training a risk prediction model according to the risk prediction results of the training samples and the corresponding risk labels. According to the training method of the risk prediction model, the accuracy of the risk prediction model on long-term risk prediction and short-term risk prediction can be improved simultaneously.
Description
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a risk prediction model training method, a risk prediction method and apparatus, an electronic device, and a computer-readable storage medium.
Background
With the rapid development of the internet and communication technologies, the traditional risk control mode can not support the risk prediction demand gradually, and the internet technology can better meet the development requirements of risk control in the information development era on the intelligent processing of multi-dimensional and large-volume data and the batch standardized execution flow. In the technical field of the Internet, various risk prediction models are established, behavior patterns of users are learned, values existing in mass data are mined, and the purpose of reasonably avoiding risks is achieved.
Risks in the internet refer to: the user is not able to fulfill obligations in the contract and risks loss. In the related technology, a risk prediction model is established, rules are learned from user characteristics, and whether default risks exist in a user is predicted, so that risk control and risk prompt are performed on the user, and the default risks of the user are avoided.
Disclosure of Invention
According to a first aspect of the present disclosure, there is provided a method for training a risk prediction model, including:
obtaining a plurality of training samples, wherein each training sample comprises a risk label and a user characteristic, the risk label of at least one training sample in the plurality of training samples comprises a first risk label generated in a first time window and a second risk label generated in a second time window, and the length of the first time window is greater than that of the second time window;
generating a risk prediction result by using a risk prediction model according to the user characteristics for each training sample, wherein the risk prediction result of at least one training sample comprises a prediction result of a first risk prediction task corresponding to a first risk label and a prediction result of a second risk prediction task corresponding to a second risk label;
and training a risk prediction model according to the risk prediction results of the training samples and the corresponding risk labels.
In some embodiments, training a risk prediction model based on the risk prediction results and corresponding risk labels for a plurality of training samples comprises:
for each training sample in the at least one training sample, calculating a loss function of each training sample in the at least one training sample according to the first risk label, the second risk label, the prediction result of the first risk prediction task and the prediction result of the second risk prediction task;
and training a risk prediction model according to the loss functions of the training samples.
In some embodiments, for each of the at least one training samples, calculating a loss function for each of the at least one training samples based on the first risk label, the second risk label, the predicted outcome of the first risk prediction task, and the predicted outcome of the second risk prediction task, comprises:
for each training sample in the at least one training sample, calculating a first loss function of each training sample in the at least one training sample according to the first risk label and the prediction result of the first risk prediction task;
for each training sample in the at least one training sample, calculating a second loss function of each training sample in the at least one training sample according to a second risk label and a prediction result of a second risk prediction task;
calculating a loss function for each of the at least one training samples from the first and second loss functions for each of the at least one training samples.
In some embodiments, calculating the loss function for each of the at least one training samples from the first and second loss functions for each of the at least one training samples comprises:
calculating a loss function for each of the at least one training samples according to a sum of the first loss function and the second loss function for each of the at least one training samples.
In some embodiments, the user features of the at least one training sample are extracted at a specified time, the first time window is a time window from the specified time to a first time, and the second time window is a time window from the specified time to a second time.
In some embodiments, the method of training a risk prediction model further comprises at least one of:
populating missing values in the user feature with default values;
filling missing values in the user characteristics by using a mean filling method;
filling missing values in the user characteristics by using a near completion method;
filling missing values in the user characteristics by using a nearest neighbor method;
filling missing values in the user features with multiple interpolation methods.
In some embodiments, the method of training a risk prediction model further comprises screening out at least one of the following user characteristics:
user features for which the loss rate is greater than a first threshold;
the discrimination of the training samples is lower than the user characteristics of a second threshold value;
user features having a variance greater than a third threshold.
In some embodiments, the method for training a risk prediction model further comprises:
and carrying out discretization processing on the user characteristics.
In some embodiments, the method for training a risk prediction model further comprises:
the risk prediction model is validated using a validation sample, wherein the validation sample is generated at a different time than the training sample.
In some embodiments, the risk prediction model is a multitasking deep neural network model or a tree model.
According to a second aspect of the present disclosure, there is provided a risk prediction method, comprising:
and generating a risk prediction result of the target user by using a risk prediction model according to the user characteristics of the target user, wherein the risk prediction model is obtained by training according to the training method of the risk prediction model in any embodiment of the disclosure.
According to a third aspect of the present disclosure, there is provided a training device for a risk prediction model, comprising:
the training system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module acquires a plurality of training samples, each training sample comprises a risk label and a user characteristic, the risk label of at least one training sample in the plurality of training samples comprises a first risk label generated in a first time window and a second risk label generated in a second time window, and the length of the first time window is greater than that of the second time window;
the generating module is used for generating a risk prediction result by using a risk prediction model according to the user characteristics aiming at each training sample, wherein the risk prediction result of at least one training sample comprises a prediction result of a first risk prediction task corresponding to a first risk label and a prediction result of a second risk prediction task corresponding to a second risk label;
and the training module is used for training a risk prediction model according to the risk prediction results of the training samples and the corresponding risk labels.
According to a fourth aspect of the present disclosure, there is provided a risk prediction apparatus comprising: the generating module is configured to generate a risk prediction result for the target user by using a risk prediction model according to the user characteristics of the target user, wherein the risk prediction model is obtained by training according to a training device of the risk prediction model in any embodiment of the present disclosure.
According to a fifth aspect of the present disclosure, there is provided an electronic device comprising:
a memory; and
a processor coupled to the memory, the processor configured to perform a method of training a risk prediction model according to any embodiment of the present disclosure, or a method of risk prediction according to any embodiment of the present disclosure, based on instructions stored in the memory.
According to a sixth aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement a method of training a risk prediction model according to any of the embodiments of the present disclosure, or a method of risk prediction according to any of the embodiments of the present disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.
The present disclosure may be more clearly understood from the following detailed description, taken with reference to the accompanying drawings, in which:
FIG. 1 illustrates a flow diagram of a method of training a risk prediction model according to some embodiments of the present disclosure;
FIG. 2 illustrates a method of constructing risk prediction tags and user features according to some embodiments of the present disclosure;
FIG. 3 illustrates a data pre-processing method according to some embodiments of the present disclosure;
FIG. 4 illustrates a flow diagram for training a risk prediction model using risk prediction results, according to some embodiments of the present disclosure;
FIG. 5 illustrates a method of calculating a loss function according to some embodiments of the present disclosure;
FIG. 6 illustrates a block diagram of a training apparatus for a risk prediction model according to some embodiments of the present disclosure;
FIG. 7 shows a block diagram of an electronic device, in accordance with further embodiments of the present disclosure;
FIG. 8 illustrates a block diagram of a computer system for implementing some embodiments of the present disclosure.
Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as exemplary only and not as limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be discussed further in subsequent figures.
In the related art, when a wind control model is established, each user serves as a sample, the time applied by the user serves as an observation point, and a time window before the observation point serves as an observation period, so that behavioral expression data of the user is extracted in the observation period, and the characteristics X of the sample are constructed.
The time window from the observation point to the presentation point was taken as the presentation period. The presentation period is a time period during which the user's performance at the point of view is monitored, and the risk label Y is classified into "0" and "1" according to the user's performance within the time window. "0" and "1" indicate that the user will not experience a breach, loss of contact, etc. in the future. The presentation period is the future time compared to the observation point, the acquisition of the risk label needs to wait more than several months, and the number of samples with long presentation period is less. Therefore, the tag Y has a certain hysteresis and a delayed feedback phenomenon.
The longer the label modeling is used, the behaviors of the user can be fully expressed, the default risk of the user is more fully exposed, and the fewer samples can be used, so that the training effect and the accuracy of the model are influenced. The risk label with shorter presentation period is used for modeling, although more samples can be used, the label with short presentation period can not fully expose the long-term default risk of the user, so the trained model can not well learn the behavior pattern of the user, the possibility of the long-term default behavior of the user is not accurately predicted, and loss is caused.
In choosing a sample training model, it is difficult to balance the integrity of the sample with the quality of the sample.
In addition, a model trained by a certain label can only predict the performance of the user on the risk corresponding to the label, but does not have generalization.
The present disclosure provides a training method for a risk prediction model, a risk prediction method and apparatus, an electronic device, and a computer-readable storage medium, which can improve the accuracy of a risk prediction model in both long-term risk prediction and short-term risk prediction.
Fig. 1 illustrates a flow diagram of a method of training a risk prediction model according to some embodiments of the present disclosure.
As shown in fig. 1, the training method of the risk prediction model includes steps S1 to S3. In some embodiments, the method of training the risk prediction model is performed by a training device of the risk prediction model.
In step S1, a plurality of training samples are obtained, where each training sample includes a risk label and a user characteristic, the risk label of at least one training sample in the plurality of training samples includes a first risk label generated in a first time window and a second risk label generated in a second time window, and a length of the first time window is greater than a length of the second time window.
FIG. 2 illustrates a method of constructing risk prediction labels and user features according to some embodiments of the present disclosure.
As shown in fig. 2, the user features of at least one training sample are extracted at a specified time, the first time window is a time window from the specified time to a first time, and the second time window is a time window from the specified time to a second time.
A period of time before the specified time (i.e., the observation point) is an observation period, which is located on the left side of the time axis, and is a time interval for observing the user characteristics. For example, at a specified time, the user features generated during the observation period are extracted.
One skilled in the art will appreciate that the specified time may be a time interval, i.e., the time at which the user submitted the application, at which the user submitted the application constitutes a sample for modeling.
A time window after the observation point is used to generate a risk label. According to some embodiments of the present disclosure, in the samples used for training the model, part of the training samples simultaneously possess the labels generated by a plurality of time windows with different lengths. For example, training sample A has a first risk label Y at the same time 1 And a second risk label Y 2 。Y 1 And Y 2 The first risk label and the second risk label are respectively used for indicating whether different types of first risks and second risks occur or not, namely, the first risk label and the second risk label respectively correspond to different risk prediction tasks. For example, the first risk is the user violating 90 days, and the second risk is the violating 30 days. Y is 1 The values 1 and 0 respectively indicate whether the first risk occurs, Y 2 The values 1 and 0 indicate whether the second risk occurs, respectively. First Risk tag Y 1 Corresponding to a first time window (presentation period), i.e. a time interval from a given time to a first time, having a length T 1 . Second Risk tag Y 2 A corresponding second time window (presentation period), i.e. the time interval from the given time to the second time, having a length T 2 ,T 1 >T 2 。
One training sample can have more than two risk signatures at the same time, e.g. Y 1 ,Y 2 ,Y 3 ,……Y N Etc. that the present disclosure is not limited thereto.
In addition, there are also training examples that can only have one risk label. For example, the set of samples used to train the model (training set) also includes training samples B and D, training sample B having an at-risk label Y 3 Training sample C with risk label Y 4 ,Y 3 The length of the corresponding time window is greater than Y 4 Time window Y of 4 . That is, the set of training samples includes a length of the training samplesTraining samples of the same risk label.
In step S2, a risk prediction result is generated for each training sample according to the user characteristics by using a risk prediction model, where the risk prediction result of at least one training sample includes a prediction result of a first risk prediction task corresponding to a first risk label and a prediction result of a second risk prediction task corresponding to a second risk label.
For example, all samples are input into the model, and the prediction result corresponding to each risk label of the sample is obtained.
And if one sample has a plurality of labels, generating a plurality of prediction results of a plurality of tasks corresponding to the labels, wherein the risk prediction result of at least one training sample comprises a prediction result of a first risk prediction task corresponding to a first risk label and a prediction result of a second risk prediction task corresponding to a second risk label. Training sample A also has a first risk label Y 1 And a second risk label Y 2 Then generate the prediction result p of the corresponding first risk prediction task 1 And a second risk label p 2 。
The first risk label and the second risk label correspond to different risk prediction tasks respectively. The risk prediction model can learn a first risk prediction task corresponding to the first risk label and a second risk prediction task corresponding to the second risk label at the same time, and an overall optimal solution on multiple risk prediction targets is obtained. Compared with training a single-task model by using a training sample with only one label, the multi-task learning technology used in the risk prediction model has the following advantages:
(1) Because a plurality of risk prediction tasks corresponding to a plurality of risk labels (generated by time windows with different lengths) have certain correlation and have respective noise, the multi-task learning can realize implicit data enhancement;
(2) The multi-task learning can help the risk prediction model to focus attention on important user features and risk prediction tasks, other risk prediction tasks provide additional evidence for relevance or irrelevance of the important user features, and the learning effect of the model for each risk prediction task is enhanced;
(3) The risk prediction model can learn generalized user characteristic characterization to play a role in implicit regularization.
The model prediction method has the advantages that the training set is preprocessed before the model is trained, and the model prediction efficiency can be improved. FIG. 3 illustrates a data pre-processing method according to some embodiments of the present disclosure.
As shown in fig. 3, the data preprocessing includes data preparation, feature processing, feature engineering, and the like.
The feature processing comprises missing value processing, feature screening, data partitioning and the like. Methods of feature processing according to some embodiments of the present disclosure are described below.
In some embodiments, the risk prediction model further comprises at least one of: populating missing values in the user feature with default values; filling missing values in the user characteristics by using a mean filling method; filling missing values in the user characteristics by using a near completion method;
filling missing values in the user characteristics by using a nearest neighbor method; filling missing values in the user features with multiple interpolation methods.
For example, for the samples in the training set and the verification set, if the values of part of the features in the plurality of features of the samples are missing, the missing feature values are filled with default values, and the missing values in the labels are reserved without modification. In addition, in addition to filling the missing value with the default value, the missing value may be processed by a special value filling method, an average value filling method, a hot card (nearest neighbor) method, a nearest neighbor method, a multiple interpolation method, model prediction, or the like.
In some embodiments, the method of training a risk prediction model further comprises screening out at least one of the following user characteristics: user features for which the loss rate is greater than a first threshold; the discrimination of the training samples is lower than the user characteristics of a second threshold value; user features having a variance greater than a third threshold.
For example, a feature screening process is performed on a plurality of features of the training sample and/or the validation sample. And (4) excluding the characteristics with higher deletion rate and/or unstable characteristics with larger variance. It is also possible to exclude invalid features, i.e. user features whose discrimination of the training samples is below a second threshold, e.g. constant-valued features. Wherein, the discrimination is an index for evaluating the discrimination capability of a feature to a user. Discrimination of features was calculated using AUC (Area Under Curve), KS (Kolmogorov-Smirnov, lorentz Curve), IV (Information Value) with single features as input to the risk prediction model.
In addition, the screening of the effective features can also be realized by adopting a feature dimension reduction method, such as PCA (principal component analysis).
When the training samples are divided, the training samples are randomly divided into a training set (train) and a test set (test) according to a certain proportion, and the verification samples are reserved and not divided, wherein the training set is used for training the model, the test set is used for supervising the training process of the model to prevent overfitting, and the verification set is used for evaluating the performance of the model.
In some embodiments, the method for training a risk prediction model further comprises: and carrying out discretization processing on the user characteristics. For example, binning discretization is performed on features (e.g., continuous features, multi-classification features).
By carrying out discretization processing on the features, the rapid iteration of the model can be promoted, the risk of overfitting the model is reduced, and the stability of the model is improved.
In addition, in the feature engineering, the class features in the training set are subjected to one-hot (onehot) coding to obtain an embedded vector; the continuous features are subjected to data normalization (e.g., data normalization), log (log) transformation, and the like to obtain dense vectors. Similar processing is performed on the verification sample.
In the user characteristics, irrelevant characteristics may exist, and the characteristics may also be interdependent, so that the data can be processed more flexibly through characteristic processing.
In step S3, a risk prediction model is trained according to the risk prediction results of the plurality of training samples and the corresponding risk labels.
For example, for each training sample, a loss function for the training sample can be calculated based on the risk prediction results for the training sample and the label of the sample. And solving the model parameter corresponding to the minimum value of the loss function according to the loss functions of all the training samples so as to update the model parameter and train the risk prediction model.
In some embodiments, the risk prediction model is a Multi-tasking prediction model such as a Multi-tasking Deep Neural Networks (muiti-tasking Deep Neural Networks) or tree model.
And if the risk prediction model adopts a tree structure model, continuously and iteratively establishing a new tree by adopting the principles of an addition model and step-by-step calculation until the condition that the model stops training is reached.
If a multitask deep neural network model is used, the parameters of the iterative model are updated during the training process, and the model can be trained for a plurality of rounds (epochs), wherein each epoch is trained on the basis of the last epoch. And training the neural network model in a gradient descent and back propagation mode, and updating parameters to be optimized. During optimization, an optimization manner, such as gradient descent, random gradient descent, small batch (minipatch) gradient descent, momentum (Momentum) random gradient descent, adaptive gradient (adaptative gradient) method, adaptive moment estimation (Adam) method, and the like, may be adjusted for a specific task type.
The loss function adopts a cross entropy loss function, a 0-1 loss function, a Hinge loss function, an exponential loss function, a logarithmic loss function and the like.
After the model training is completed, evaluation indexes such as Auc, recall (Recall), balance F score (F1), KS and the like are adopted to evaluate the model.
FIG. 4 illustrates a flow diagram for training a risk prediction model using risk prediction results, according to some embodiments of the present disclosure.
As shown in FIG. 4, training a risk prediction model using the risk prediction results includes steps S31-S32.
In step S31, for each training sample of the at least one training sample, a loss function of each training sample of the at least one training sample is calculated according to the first risk label, the second risk label, the prediction result of the first risk prediction task, and the prediction result of the second risk prediction task.
In step S32, a risk prediction model is trained based on the loss functions of the plurality of training samples.
For example, if training sample A also includes first risk label Y 1 And a second risk label Y 2 Inputting the characteristics of the training sample A into the model to obtain a prediction result p for whether the first risk occurs 1 And a predicted result p of whether the first risk occurs 2 . According to Y 1 、Y 2 、p 1 、p 2 And calculating a loss function of the training sample A.
If training sample B includes only one risk label (e.g., first risk label Y) 1 ) Inputting the characteristics of the training sample A into the model, and then only needing to be based on Y 1 And p 1 And calculating a loss function of the training sample A.
In some embodiments, for each of the at least one training sample, calculating a loss function for each of the at least one training sample based on the first risk label, the second risk label, the predicted outcome of the first risk prediction task, and the predicted outcome of the second risk prediction task, comprises: for each training sample in the at least one training sample, calculating a first loss function of each training sample in the at least one training sample according to the first risk label and the prediction result of the first risk prediction task; for each training sample in the at least one training sample, calculating a second loss function of each training sample in the at least one training sample according to the second risk label and the prediction result of the second risk prediction task; a loss function for each of the at least one training samples is calculated based on the first and second loss functions for each of the at least one training samples.
For example, according to Y 1 And p 1 Calculating a first loss function L of the training sample A 1 According to Y 2 And p 2 Calculating a second loss function of the training sample AL 2 And calculating the final loss function of the training sample A according to the first loss function and the second loss function.
In some embodiments, calculating the loss function for each of the at least one training samples from the first loss function and the second loss function for each of the at least one training samples comprises: a loss function for each of the at least one training samples is calculated based on a sum of the first loss function and the second loss function for each of the at least one training samples.
For example, the final loss function for training sample A is L 1 +L2。
The risk prediction model can have more than two risk prediction tasks, and accordingly, one training sample can have more than two risk labels. In the following, a multitask neural network model is taken as an example to describe how to implement model training under the condition that there are N risk prediction tasks.
Fig. 5 illustrates a method of calculating a loss function according to some embodiments of the present disclosure.
For N risk prediction tasks, the corresponding risk label is Y = { Y = 1 ,Y 2 …Y N }. Because the labels have hysteresis with respect to the user characteristics, and some labels may be missing, not every training sample may have all risk labels, i.e., any risk label of a training sample may be null.
The risk prediction result of the risk prediction model on the N tasks is P = { P 1 ,p 2 …p N }。
For any training sample, all risk labels of the training sample are traversed, if the current risk label Y i If it is null, skip, otherwise, according to Y i And p i Calculating the Loss function Loss of the training sample on the ith task i . And summing all the loss functions of the training sample to obtain the total loss function of the training sample. Wherein, the Loss function Loss of the training sample on the ith task i May be a cross entropy loss function.
In some embodiments, the risk prediction model is validated using a validation sample, wherein the validation sample is generated at a different time than the training sample. For example, a time is specified in the database as a point of view and a time window is determined, generating a training set and a cross-time validation set. The training set is used for training the model, and the verification set is used for evaluating the performance of the model.
The validation samples are OOT (Out of Time) validation samples that can be used to simulate the effect of the evaluation model after online application. The label generation time of the OOT verification sample is different from the label generation time of the training sample, and thus, the time of the OOT verification sample is different from the training sample. For example, the training samples are samples generated from the present year data, and the validation samples are samples generated from the last year data. The time windows corresponding to the risk labels of the training sample and the validation sample do not overlap. The model is verified by using the verification sample of the cross-time, so that the stability of the model can be ensured, and the generalization capability of the model is improved.
When the model is tested by using the test sample and/or verified by using the verification sample, the method for calculating the loss function is similar to the training process, and details are not repeated here.
According to the training method of the risk prediction model, a plurality of training samples are obtained, the risk prediction model is utilized, a risk prediction result is generated according to user characteristics for each training sample, then the risk prediction model is trained according to the risk prediction results of the training samples and corresponding risk labels, the first risk labels and the second risk labels of partial training samples are utilized, the risk prediction model is trained on a plurality of tasks at the same time, and prediction results on the first risk prediction task and the second risk prediction task are obtained.
The risk prediction model learns the relation between the long-term risk and the user characteristics, and reduces the influence of the delayed feedback phenomenon of the risk label on the long-term risk prediction; and more fresh training samples can be utilized, so that the number of available training samples is increased while the relation between the short-term risk and the user characteristics is learned. In addition, the first risk prediction task and the second risk prediction task have certain correlation and have respective noises, and the method for simultaneously training the risk prediction model on the plurality of risk prediction tasks can realize data enhancement. Therefore, the trained risk prediction model has higher accuracy in both long-term risk prediction and short-term risk prediction.
In addition, the risk prediction model obtained by training according to the training method of the risk prediction model disclosed by the invention can be used for simultaneously predicting a plurality of risk prediction tasks, and the generalization performance is better.
The present disclosure provides a risk prediction method, comprising: and generating a risk prediction result of the target user by using a risk prediction model according to the user characteristics of the target user, wherein the risk prediction model is obtained by training according to the training method of the risk prediction model in any embodiment of the disclosure. In some embodiments, the risk prediction method is performed by a risk prediction device.
The target user may be any user whose risk of default needs to be assessed. After the risk prediction model is trained, according to the user characteristics of the target user, the risk prediction model is utilized, and the prediction result of the first risk prediction task and/or the prediction result of the second risk prediction task corresponding to the second risk label can be generated according to needs, so that whether the target user will violate in a future first time window and/or whether the target user will violate in a second time window is judged. The user features are extracted at the specified time, the first time window is a time window from the specified time to the first time, and the second time window is a time window from the specified time to the second time.
Fig. 6 illustrates a block diagram of a training apparatus for a risk prediction model according to some embodiments of the present disclosure.
As shown in fig. 6, the risk prediction model training device 6 includes an obtaining module 61, a generating module 62, and a training module 63.
The obtaining module 61 is configured to obtain a plurality of training samples, where each training sample includes a risk label and a user characteristic, and the risk label of at least one training sample in the plurality of training samples includes a first risk label generated in a first time window and a second risk label generated in a second time window, where a length of the first time window is greater than a length of the second time window, for example, step S1 shown in fig. 6 is performed.
A generating module 62 configured to generate a risk prediction result by using a risk prediction model according to the user characteristic for each training sample, where the risk prediction result of at least one training sample includes a prediction result of a first risk prediction task corresponding to a first risk label and a prediction result of a second risk prediction task corresponding to a second risk label, for example, step S2 shown in fig. 6 is performed.
A training module 63 configured to train a risk prediction model according to the risk prediction results of the plurality of training samples and the corresponding risk labels, for example, to execute step S3 shown in fig. 6.
The present disclosure provides a risk prediction apparatus including a generation module. The generation module is configured to generate a risk prediction result for the target user by using a risk prediction model according to the user characteristics of the target user, wherein the risk prediction model is obtained by training according to a training device of the risk prediction model according to any embodiment of the present disclosure.
FIG. 7 shows a block diagram of an electronic device, in accordance with further embodiments of the present disclosure.
As shown in fig. 7, the electronic device 7 includes a memory 71; and a processor 72 coupled to the memory 71, the memory 71 being configured to store a training method for executing the risk prediction model. The processor 72 is configured to perform a method of training a risk prediction model in any of the embodiments of the present disclosure based on instructions stored in the memory 71.
According to the training device and/or the electronic equipment of the risk prediction model of some embodiments of the present disclosure, the first risk label and the second risk label of a part of the training samples are utilized, the risk prediction model is trained on a plurality of tasks at the same time, and the prediction results on the first risk prediction task and the second risk prediction task are obtained, so that not only the relationship between the long-term risk and the user characteristics is learned, the influence of the delayed feedback phenomenon of the risk labels on the long-term risk prediction is reduced, but also more fresh training samples can be utilized, and the number of available training samples is increased while the relationship between the short-term risk and the user characteristics is learned, and the data enhancement is realized. Therefore, the trained risk prediction model has higher accuracy in both long-term risk prediction and short-term risk prediction.
Fig. 8 illustrates a block diagram of a computer system for implementing some embodiments of the present disclosure.
As shown in FIG. 8, computer system 80 may take the form of a general purpose computing device. The computer system 80 includes a memory 810, a processor 820, and a bus 800 that couples various system components.
The memory 810 may include, for example, system memory, non-volatile storage media, and the like. The system memory stores, for example, an operating system, an application program, a Boot Loader (Boot Loader), and other programs. The system memory may include volatile storage media, such as Random Access Memory (RAM) and/or cache memory. A non-volatile storage medium, for example, stores instructions to perform a method of training a risk prediction model in any of some embodiments of the present disclosure. Non-volatile storage media include, but are not limited to, magnetic disk storage, optical storage, flash memory, and the like.
The processor 820 may be implemented as discrete hardware components, such as a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gates or transistors, or the like. Accordingly, each of the modules, such as the judging module and the determining module, may be implemented by a Central Processing Unit (CPU) executing instructions in a memory for performing the corresponding step, or may be implemented by a dedicated circuit for performing the corresponding step.
The bus 800 may use any of a variety of bus architectures. For example, bus architectures include, but are not limited to, industry Standard Architecture (ISA) bus, micro Channel Architecture (MCA) bus, and Peripheral Component Interconnect (PCI) bus.
The computer system 80 may also include an input-output interface 830, a network interface 840, a storage interface 850, and the like. These interfaces 830, 840, 850, as well as the memory 810 and the processor 820, may be connected by a bus 800. The input/output interface 830 may provide a connection interface for input/output devices such as a display, a mouse, and a keyboard. The network interface 840 provides a connection interface for various networking devices. The storage interface 850 provides a connection interface for external storage devices such as a floppy disk, a usb disk, and an SD card.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable apparatus to produce a machine, such that the execution of the instructions by the processor results in an apparatus that implements the functions specified in the flowchart and/or block diagram block or blocks.
These computer-readable program instructions may also be stored in a computer-readable memory that can direct a computer to function in a particular manner, such that the instructions cause an article of manufacture to be produced including instructions which implement the function specified in the flowchart and/or block diagram block or blocks.
The present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects.
Through the training method of the risk prediction model, the risk prediction method and device, the electronic equipment and the computer readable storage medium in the embodiment, the accuracy of the risk prediction model on long-term risk prediction and short-term risk prediction is improved.
Thus, the method and apparatus for training a risk prediction model, and a computer-readable storage medium according to the present disclosure have been described in detail. Some details well known in the art have not been described in order to avoid obscuring the concepts of the present disclosure. Those skilled in the art can now fully appreciate how to implement the teachings disclosed herein, in view of the foregoing description.
Claims (15)
1. A method of training a risk prediction model, comprising:
obtaining a plurality of training samples, wherein each training sample comprises a risk label and a user characteristic, the risk label of at least one training sample in the plurality of training samples comprises a first risk label generated in a first time window and a second risk label generated in a second time window, and the length of the first time window is greater than that of the second time window;
generating a risk prediction result by using a risk prediction model according to user characteristics for each training sample, wherein the risk prediction result of at least one training sample comprises a prediction result of a first risk prediction task corresponding to a first risk label and a prediction result of a second risk prediction task corresponding to a second risk label;
and training a risk prediction model according to the risk prediction results of the training samples and the corresponding risk labels.
2. The training method of the risk prediction model according to claim 1, wherein training the risk prediction model according to the risk prediction results and the corresponding risk labels of the plurality of training samples comprises:
for each training sample in the at least one training sample, calculating a loss function of each training sample in the at least one training sample according to the first risk label, the second risk label, the prediction result of the first risk prediction task and the prediction result of the second risk prediction task;
and training a risk prediction model according to the loss functions of the plurality of training samples.
3. The training method of the risk prediction model of claim 2, wherein for each of the at least one training sample, calculating a loss function for each of the at least one training sample based on the first risk label, the second risk label, the predicted outcome of the first risk prediction task, and the predicted outcome of the second risk prediction task comprises:
for each training sample in the at least one training sample, calculating a first loss function of each training sample in the at least one training sample according to the first risk label and the prediction result of the first risk prediction task;
for each training sample in the at least one training sample, calculating a second loss function of each training sample in the at least one training sample according to a second risk label and a prediction result of a second risk prediction task;
calculating a loss function for each of the at least one training samples from the first and second loss functions for each of the at least one training samples.
4. The method of training a risk prediction model according to claim 3, wherein calculating a loss function for each of the at least one training sample from the first and second loss functions for each of the at least one training sample comprises:
calculating a loss function for each of the at least one training samples according to a sum of the first loss function and the second loss function for each of the at least one training samples.
5. The method of training a risk prediction model according to any one of claims 1 to 4, wherein the user features of the at least one training sample are extracted at a specified time, the first time window being a time window from the specified time to a first time, and the second time window being a time window from the specified time to a second time.
6. The method of training a risk prediction model according to any one of claims 1 to 4, further comprising at least one of:
populating missing values in the user feature with default values;
filling missing values in the user characteristics by using a mean filling method;
filling missing values in the user characteristics by using a near completion method;
filling missing values in the user characteristics by using a nearest neighbor method;
and filling missing values in the user characteristics by using a multi-interpolation method.
7. The method of training a risk prediction model according to any one of claims 1 to 4, further comprising screening out at least one of the following user characteristics:
user features for which the loss rate is greater than a first threshold;
the discrimination of the training samples is lower than the user characteristics of a second threshold value;
user features having a variance greater than a third threshold.
8. The method of training a risk prediction model according to any one of claims 1 to 4, further comprising:
and carrying out discretization processing on the user characteristics.
9. The method of training a risk prediction model according to any one of claims 1 to 4, further comprising:
the risk prediction model is validated using a validation sample, wherein the validation sample is generated at a different time than the training sample.
10. The training method of the risk prediction model according to any one of claims 1 to 4, wherein the risk prediction model is a multitasking deep neural network model or a tree model.
11. A method of risk prediction, comprising:
generating a risk prediction result for the target user by using a risk prediction model according to the user characteristics of the target user, wherein the risk prediction model is obtained by training according to the training method of the risk prediction model according to any one of claims 1-10.
12. A training apparatus for a risk prediction model, comprising:
the training system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module acquires a plurality of training samples, each training sample comprises a risk label and a user characteristic, the risk label of at least one training sample in the plurality of training samples comprises a first risk label generated in a first time window and a second risk label generated in a second time window, and the length of the first time window is greater than that of the second time window;
the generating module is used for generating a risk prediction result by using a risk prediction model according to the user characteristics for each training sample, wherein the risk prediction result of at least one training sample comprises a prediction result of a first risk prediction task corresponding to a first risk label and a prediction result of a second risk prediction task corresponding to a second risk label;
and the training module is used for training a risk prediction model according to the risk prediction results of the training samples and the corresponding risk labels.
13. A risk prediction device comprising:
a generating module configured to generate a risk prediction result for the target user by using a risk prediction model according to the user characteristics of the target user, wherein the risk prediction model is obtained by training with the training device of the risk prediction model according to claim 12.
14. An electronic device, comprising:
a memory; and
a processor coupled to the memory, the processor configured to perform a method of training a risk prediction model according to any one of claims 1 to 10, or a method of risk prediction according to claim 1, based on instructions stored in the memory.
15. A computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement a method of training a risk prediction model according to any one of claims 1 to 10, or a method of risk prediction according to claim 1.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310132757.5A CN115953031A (en) | 2023-02-09 | 2023-02-09 | Method and device for training risk prediction model and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310132757.5A CN115953031A (en) | 2023-02-09 | 2023-02-09 | Method and device for training risk prediction model and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115953031A true CN115953031A (en) | 2023-04-11 |
Family
ID=87297035
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310132757.5A Pending CN115953031A (en) | 2023-02-09 | 2023-02-09 | Method and device for training risk prediction model and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115953031A (en) |
-
2023
- 2023-02-09 CN CN202310132757.5A patent/CN115953031A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11650968B2 (en) | Systems and methods for predictive early stopping in neural network training | |
Kronberger et al. | Shape-constrained symbolic regression—improving extrapolation with prior knowledge | |
CN111369299B (en) | Identification method, device, equipment and computer readable storage medium | |
CN108536784B (en) | Comment information sentiment analysis method and device, computer storage medium and server | |
CN104978612A (en) | Distributed big data system risk predicating method based on AHP-RBF | |
US20210374544A1 (en) | Leveraging lagging gradients in machine-learning model training | |
CN106022517A (en) | Risk prediction method and device based on nucleus limit learning machine | |
CN107729241B (en) | Software variation test data evolution generation method based on variant grouping | |
CN109376535A (en) | A kind of leak analysis method and system based on intelligent semiology analysis | |
CN112819024B (en) | Model processing method, user data processing method and device and computer equipment | |
Bhardwaj et al. | Health insurance amount prediction | |
Huang et al. | Harnessing deep learning for population genetic inference | |
CN116361788A (en) | Binary software vulnerability prediction method based on machine learning | |
CN115600105A (en) | Water body missing data interpolation method and device based on MIC-LSTM | |
CN113627513A (en) | Training data generation method and system, electronic device and storage medium | |
CN114139636A (en) | Abnormal operation processing method and device | |
CN113610299A (en) | Information propagation prediction method and device based on characteristic attenuation reinforced neural network | |
CN112433952A (en) | Method, system, device and medium for testing fairness of deep neural network model | |
US20240054369A1 (en) | Ai-based selection using cascaded model explanations | |
CN113448821A (en) | Method and device for identifying engineering defects | |
CN116976491A (en) | Information prediction method, device, equipment, storage medium and program product | |
CN115953031A (en) | Method and device for training risk prediction model and computer readable storage medium | |
CN113448860A (en) | Test case analysis method and device | |
CN113191527A (en) | Prediction method and device for population prediction based on prediction model | |
CN107888590B (en) | Unknown Trojan horse detection method based on GPU and Bayesian network inference |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |