CN114462532A - Model training method, device, equipment and medium for predicting transaction risk - Google Patents

Model training method, device, equipment and medium for predicting transaction risk Download PDF

Info

Publication number
CN114462532A
CN114462532A CN202210115648.8A CN202210115648A CN114462532A CN 114462532 A CN114462532 A CN 114462532A CN 202210115648 A CN202210115648 A CN 202210115648A CN 114462532 A CN114462532 A CN 114462532A
Authority
CN
China
Prior art keywords
data set
transaction data
transaction
model
training
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
Application number
CN202210115648.8A
Other languages
Chinese (zh)
Inventor
袁世聪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202210115648.8A priority Critical patent/CN114462532A/en
Publication of CN114462532A publication Critical patent/CN114462532A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/24323Tree-organised classifiers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The disclosure provides a model training method which can be applied to the technical field of artificial intelligence. The model training method comprises the following steps: acquiring a first target historical transaction data set generated in a preset time interval, wherein the first target historical transaction data set comprises a normal transaction data set and an abnormal transaction data set, and the normal transaction data set and the abnormal transaction data set are provided with transaction tags; clustering normal transaction data sets in the first target historical transaction data set to obtain a plurality of clusters; determining a second target historical transaction data set from the plurality of clusters; updating the transaction labels carried by the second target historical transaction data set and the abnormal transaction data set by using the classification model to obtain a training data set; and training the model to be trained based on the training data set to obtain a model for predicting transaction risk. The present disclosure also provides a method, apparatus, device, storage medium and program product for predicting a transaction risk.

Description

Model training method, device, equipment and medium for predicting transaction risk
Technical Field
The present disclosure relates to the field of artificial intelligence, and more particularly to a model training method, a method, an apparatus, a device, a medium, and a program product for predicting a transaction risk.
Background
With the development of society and science and technology, information is common, and resource sharing is a requirement for the development of the times. Internet transactions play a vital role as an important component of social development. With the development of the internet, transaction channels are continuously increased, and the transaction conditions are increasingly complicated. The business range of trade in each industry is wider and wider, and each link has the possibility of being fraudulently acted, and the trade risk needs to be controlled.
However, in the process of implementing the present disclosure, it is found that there is an imbalance problem of sample data when the model is trained by obtaining the sample data, so that the transaction risk cannot be predicted more accurately.
Disclosure of Invention
In view of the foregoing, the present disclosure provides a model training method, a method of predicting transaction risk, an apparatus, a device, a medium, and a program product.
According to a first aspect of the present disclosure, there is provided a model training method, comprising: acquiring a first target historical transaction data set generated in a preset time interval, wherein the first target historical transaction data set comprises a normal transaction data set and an abnormal transaction data set, and the normal transaction data set and the abnormal transaction data set are provided with transaction tags;
clustering normal transaction data sets in the first target historical transaction data set to obtain a plurality of clusters;
determining a second target historical transaction data set from the plurality of clusters;
updating the transaction labels carried by the second target historical transaction data set and the abnormal transaction data set by using the classification model to obtain a training data set; and
and training the model to be trained based on the training data set to obtain a model for predicting transaction risk.
According to an embodiment of the present disclosure, updating the transaction labels carried by the second target historical transaction data set and the abnormal transaction data set by using the classification model, and obtaining the training data set includes:
inputting the second target historical transaction data set and the abnormal transaction data set into a classification model to obtain a classification result;
determining the error rate of the classification model by using the classification result and the transaction label;
calculating the voting weight of the classification model according to the error rate;
and updating the transaction label based on the voting weight to obtain a training data set.
According to an embodiment of the present disclosure, determining a second target historical transaction data set from the plurality of clusters includes:
and respectively screening the data in each cluster to obtain a second target historical transaction data set, wherein the screening comprises screening by taking each cluster as a center.
According to an embodiment of the present disclosure, acquiring a first target historical transaction data set generated within a preset time interval includes:
acquiring a normal transaction data set and an abnormal transaction data set generated in a preset time interval to obtain initial historical data;
and preprocessing the initial historical data to obtain a first target historical transaction data set.
According to an embodiment of the present disclosure, the normal transaction data set and the abnormal transaction data set further include: transaction basic information and transaction account information.
According to an embodiment of the present disclosure, training a model to be trained based on a training dataset, obtaining a model for predicting a transaction risk includes:
inputting a training data set into a model to be trained, and outputting a training result;
and adjusting parameters of the model to be trained based on the training result and the updated transaction label to obtain a trained model for predicting transaction risk.
According to the embodiment of the present disclosure, before acquiring the first target historical transaction data set generated within the preset time interval, the method further includes:
obtaining authorization of a user to a first target historical transaction data set;
a first target historical transaction data set is obtained after authorization.
A second aspect of the present disclosure provides a method of predicting transaction risk, comprising:
acquiring target prediction data associated with a time interval to be predicted;
inputting the target prediction data into a model for predicting transaction risk; and
outputting a prediction result;
and the model for predicting the transaction risk is obtained by training according to the model training method.
A third aspect of the present disclosure provides a model training apparatus, comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first target historical transaction data set generated in a preset time interval, the first target historical transaction data set comprises a normal transaction data set and an abnormal transaction data set, and the normal transaction data set and the abnormal transaction data set are provided with transaction tags;
the determining module is used for determining a second target historical transaction data set from a normal transaction data set in the first target historical transaction data set by using a preset method;
the updating module is used for updating the transaction labels carried by the second target historical transaction data set and the abnormal transaction data set by utilizing the classification model to obtain a training data set; and
and the training module is used for training the model to be trained on the basis of the training data set to obtain a model for predicting the transaction risk.
A fourth aspect of the present disclosure provides an apparatus for predicting transaction risk, comprising:
the second acquisition module is used for acquiring target prediction data associated with the time interval to be predicted;
an input module for inputting the target prediction data into a model for predicting a transaction risk; and
the output module is used for outputting a prediction result;
and the model for predicting the transaction risk is obtained by training according to the model training method.
A fifth aspect of the present disclosure provides an electronic device, comprising: one or more processors; memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the above-described model training methods and methods of predicting transaction risk.
A sixth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the above model training method and method of predicting a transaction risk.
A seventh aspect of the present disclosure also provides a computer program product comprising a computer program that, when executed by a processor, implements the above-described model training method and method of predicting transaction risk.
According to the embodiment of the disclosure, normal transaction data of a training sample is divided into a plurality of clusters through a clustering method, and then a new normal transaction data set is determined from the plurality of clusters; the obtained new normal transaction data set and the abnormal transaction data set obtain a reconstructed data set after the label enhancement data is readjusted through the classification model; and retraining the reconstructed data set to obtain a model for predicting transaction risk. The problem of unbalanced samples in model training is effectively relieved, the proportional difference between normal transaction data and abnormal transaction data in the samples is reduced, the distribution characteristics of the samples in the normal transaction data set are kept as far as possible, and the effect of the trained model cannot be influenced by the change of the number of the samples. And the result obtained by predicting the model for predicting the transaction risk by training can more accurately predict the fraud risk in the transaction on the aspects of accuracy, recall rate and comprehensive evaluation value.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be apparent from the following description of embodiments of the disclosure, which proceeds with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an application scenario diagram of a model training method, a method, an apparatus, a device, a medium and a program product for predicting transaction risk according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow diagram of a model training method according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a method for clustering normal transaction data sets in a first target historical transaction data set to obtain a plurality of clusters according to an embodiment of the disclosure;
FIG. 4 schematically illustrates a flow chart of a method for updating transaction labels carried by a second target historical transaction data set and an abnormal transaction data set using a classification model to obtain a training data set according to an embodiment of the present disclosure;
FIG. 5 schematically shows a flow chart of a method of predicting transaction risk according to an embodiment of the present disclosure;
FIG. 6 schematically shows a block diagram of a model training apparatus according to an embodiment of the present disclosure;
fig. 7 schematically shows a block diagram of the structure of an apparatus for predicting transaction risk according to an embodiment of the present disclosure; and
FIG. 8 schematically illustrates a block diagram of an electronic device suitable for implementing a model training method and a method of predicting transaction risk according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that these descriptions are illustrative only and are not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure, application and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations, necessary confidentiality measures are taken, and the customs of the public order is not violated.
In the technical scheme of the disclosure, before the personal information of the user is acquired or collected, the authorization or the consent of the user is acquired.
Machine learning and deep learning techniques can be used to model in anti-fraud scenarios to govern the risk of fraud present in transactions. One of the most encountered technical problems in the modeling process is the problem of sample imbalance. It will be appreciated that in a data set acquired by a transaction, a significant proportion of the samples should be normal samples, i.e. non-fraudulent samples, and only a very small proportion of the samples should be negative samples, i.e. fraudulent samples.
Two methods for solving the problem of unbalanced samples are oversampling and undersampling. The two methods have the disadvantages that oversampling is essentially to repeatedly use a few samples in a data set, so that overfitting of a trained model is inevitably caused, and the generalization capability in final application is influenced. While the undersampling actually randomly discards some normal samples, the undersampling usually results in some loss of useful information, and thus the accuracy of the trained model is not high. The disclosed embodiments provide a new way of dealing with sample imbalances to avoid the problems described above.
The embodiment of the present disclosure provides a model training method, including: acquiring a first target historical transaction data set generated in a preset time interval, wherein the first target historical transaction data set comprises a normal transaction data set and an abnormal transaction data set, and the normal transaction data set and the abnormal transaction data set are provided with transaction tags; clustering normal transaction data sets in the first target historical transaction data set to obtain a plurality of clusters; determining a second target historical transaction data set from the plurality of clusters; updating the transaction labels carried by the second target historical transaction data set and the abnormal transaction data set by using the classification model to obtain a training data set; and training the model to be trained based on the training data set to obtain a model for predicting transaction risk.
Fig. 1 schematically illustrates an application scenario diagram of a model training method, a method, an apparatus, a device, a medium, and a program product for predicting a transaction risk according to an embodiment of the present disclosure.
As shown in fig. 1, the application scenario 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a financial product type application, a shopping type application, a web browser application, a search type application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the model training method and the method for predicting transaction risk provided by the embodiments of the present disclosure may be generally executed by the server 105. Accordingly, the model training device and the device for predicting transaction risk provided by the embodiments of the present disclosure may be generally disposed in the server 105. The model training method and the method for predicting transaction risk provided by the embodiments of the present disclosure may also be performed by a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the model training device and the device for predicting transaction risk provided by the embodiments of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The model training method of the disclosed embodiment will be described in detail below with reference to fig. 2 to 5 based on the scenario described in fig. 1.
FIG. 2 schematically shows a flow diagram of a model training method according to an embodiment of the disclosure.
As shown in fig. 2, the model training method 200 of this embodiment includes operations S201 to S204.
In operation S201, a first target historical transaction data set generated within a preset time interval is obtained, where the first target historical transaction data set includes a normal transaction data set and an abnormal transaction data set, and the normal transaction data set and the abnormal transaction data set have transaction tags.
According to an embodiment of the present disclosure, the preset time interval may be a past period of time selected according to actual prediction needs. The normal transaction data set and the abnormal transaction data set both comprise basic transaction information and transaction account information. The transaction tags may be positive and negative tags. For example, the preset time interval may be, but is not limited to: the last two months, the last four months, the last half year, the last year, etc., e.g., 3/1/2019 to 7/31/2019. The basic transaction information may be, for example, but not limited to: time of transaction, frequency of transaction, amount of transaction, etc. The transaction account information may be, for example, account information of both parties of the transaction. Normal transaction data may have a positive label and abnormal transaction data may have a negative label.
Before operation S201, the method further includes: obtaining authorization of a user to a first target historical transaction data set; a first target historical transaction data set is obtained after authorization.
In operation S202, a normal transaction data set in a first target historical transaction data set is clustered, resulting in a plurality of clusters.
According to embodiments of the present disclosure, the clustering method may include, for example, a K-medoids clustering method. The clustering method replaces the commonly used K-means algorithm because the K-means algorithm has the defect that the size difference of each category generated by the algorithm is not very large, and the algorithm is very sensitive to abnormal data. Therefore, after the normal transaction data set is classified by using the K-medoids clustering method, the generated clusters are closer to the classification of the transaction categories in reality.
Fig. 3 schematically illustrates a method for clustering normal transaction data sets in a first target historical transaction data set to obtain a plurality of clusters according to an embodiment of the disclosure.
As shown in fig. 3, a plurality of clusters are obtained by clustering the normal transaction data sets in the first target historical transaction data set.
In operation S203, a second target historical transaction data set is determined from the plurality of clusters.
According to an embodiment of the present disclosure, determining a second target historical transaction data set from the plurality of clusters may include: a predetermined amount of data is selected from each cluster, respectively, to form a second target historical transaction data set. The predetermined number may be chosen according to the accuracy of the actual training model, and may be, for example, 1%. As shown in fig. 3, the black dots represent the second target historical transaction data, and the gray dots represent normal transaction data other than the second target historical transaction data. A second target historical transaction data set may be formed by selecting a second target historical transaction data represented by a black dot from the plurality of clusters.
In operation S204, transaction labels carried by the second target historical transaction data set and the abnormal transaction data set are updated by using the classification model, so as to obtain a training data set.
According to the embodiment of the disclosure, the second target historical transaction data set and the abnormal transaction data set are input into the classification model, and the transaction tags of the second target historical transaction data set and the abnormal transaction data set are re-determined according to the classification result output by the classification model. The classification model may employ a C4.5 decision tree algorithm for classification.
In operation S205, a model to be trained is trained based on the training data set, and a model for predicting transaction risk is obtained.
According to the embodiment of the disclosure, the training data set can be input into the model to be trained, and the training result is output. And determining the model parameters of the model to be trained according to the output training result and the transaction label carried by the training data set. Model parameters of the training model may also be determined based on the number of iterations.
For example, the output training result may include a classification result of training, such as normal transaction data and abnormal transaction data, and according to the transaction label carried by the training data set, the accuracy of the model may be determined, and if the accuracy is high, for example, above 95%, the model parameter at this time is used as the parameter of the model for predicting the transaction risk; otherwise, the model parameters are readjusted and the training is carried out again.
According to the embodiment of the disclosure, normal transaction data of a training sample is divided into a plurality of clusters through a clustering method, and then a new normal transaction data set is determined from the plurality of clusters; the obtained new normal transaction data set and the abnormal transaction data set obtain a reconstructed data set after the label enhancement data is readjusted through the classification model; and retraining the reconstructed data set to obtain a model for predicting transaction risk. The problem of unbalanced samples in model training is effectively relieved, the proportional difference between normal transaction data and abnormal transaction data in the samples is reduced, the distribution characteristics of the samples in the normal transaction data set are kept as far as possible, and the effect of the trained model cannot be influenced by the change of the number of the samples. And the result obtained by predicting the model for predicting the transaction risk by training can more accurately predict the fraud risk in the transaction on the aspects of accuracy, recall rate and comprehensive evaluation value.
Fig. 4 schematically illustrates a flowchart of a method for updating transaction labels carried by a second target historical transaction data set and an abnormal transaction data set to obtain a training data set by using a classification model according to an embodiment of the disclosure.
As shown in fig. 4, the method 400 for updating the transaction labels carried in the second target historical transaction data set and the abnormal transaction data set by using the classification model to obtain the training data set according to this embodiment includes operations S401 to S404.
In operation S401, the second target historical transaction data set and the abnormal transaction data set are input into the classification model, and a classification result is obtained.
According to the embodiment of the disclosure, the classification model can be classified by adopting a C4.5 decision tree algorithm, and a decision tree M can be obtainedi
According to an embodiment of the present disclosure, each data sample in the normal transaction data set in the first target historical transaction data set is given an initial weight of 1/d, where d represents the number of each data sample in the normal transaction data set in the first target historical transaction data set. Then, a preset number of iterations is started. At the beginning of each iteration, a clustering method is used. Wherein the preset iteration number is determined according to the classification of the second target historical transaction data set and the abnormal transaction data set.
In operation S402, an error rate of the classification model is determined using the classification result and the transaction tag.
According to the embodiment of the disclosure, the obtained classification result can be calculated by formula (1) to obtain MiError rate of (M)i):
Figure BDA0003496251670000101
wiRefers to the data sample x assigned to each second target historical transaction data set and abnormal transaction data setiThe weight of (c). err (x)i) Is used to represent each xiWhether the classification is correct. If one data sample xiIs decided byTree MiClassification error, err (x)i) Equal to 1 if one data sample xiIs decision tree MiCorrect classification, err (x)i) Equal to 0.
According to the calculated error (M)i) And comparing the number of iterations with a preset threshold value to determine the number of iterations.
For example, if the threshold is 0.5, then the error (M) is seti) Less than or equal to 0.5, the above operation S202 may be performed to start the next iteration. If error (M)i) Greater than 0.5, it is necessary to multiply the coefficient of each correctly classified data sample by error (M)i)/(1-error(Mi) And finally all coefficients are normalized (normalized, i.e., normalized), ending the iteration.
In operation S403, voting weights of the classification models are calculated according to the error rates.
According to the embodiment of the present disclosure, according to the operation S402, the determined error rate error (mi), the voting weight v of the classification model is calculated according to the formula (2)i
Figure BDA0003496251670000102
In operation S404, the transaction label is updated based on the voting weight, resulting in a training data set.
According to the embodiment of the present disclosure, the voting weight obtained according to the operation S403 is added to the category of each second target historical transaction data set and abnormal transaction data set, which is classified by the decision tree. After the decision trees with preset iteration times are completely classified, the class with the highest weight value in each second target historical transaction data set and the abnormal transaction data set is used as the class to which the data sample is finally classified, and therefore the transaction label is updated. The second target historical transaction data set and the anomalous transaction data set with the new transaction label may be used as the training data set.
According to the embodiment of the disclosure, the transaction labels carried by the second target historical transaction data set and the abnormal transaction data set are updated through the classification model to serve as the training data set, and the model prediction result obtained through training can more accurately predict the fraud risk existing in the transaction in terms of accuracy, recall rate and comprehensive evaluation value compared with the model obtained through training by using unprocessed data.
According to an embodiment of the present disclosure, determining a second target historical transaction data set from the plurality of clusters includes:
and respectively screening the data in each cluster to obtain a second target historical transaction data set.
According to an embodiment of the present disclosure, a predetermined amount of data may be separately screened from each cluster and then a second target historical transaction data set may be formed. The predetermined number may be chosen according to the accuracy of the actual training model, and may be, for example, 1%. The distribution characteristics of the samples in the normal transaction data set are kept as much as possible. Wherein the screening comprises screening centered on each cluster. As an alternative embodiment, the filtering may also include filtering from a spatially dense place of each cluster, where a spatially dense place may be understood as a place where the distance between normal transaction data is small.
According to an embodiment of the present disclosure, acquiring a first target historical transaction data set generated within a preset time interval includes:
acquiring a normal transaction data set and an abnormal transaction data set generated in a preset time interval to obtain initial historical data;
and preprocessing the initial historical data to obtain a first target historical transaction data set.
According to an embodiment of the present disclosure, the preset time interval may be a past period of time, for example, may be a past 6 months, 12 months, and the like. The normal transaction data set and the abnormal transaction data set may include transaction basic information and transaction account information. The preprocessing may include padding of missing values.
For example, the data table to which the initial history data of 1/2021 to 9/30/2021 is related may be determined according to the category of the transaction basic information and the transaction account information. Then, the data columns related to the basic information of the transaction and the account information of both parties of the transaction in different tables are observed. The data columns include the relative proportion of transaction frequency, the relative proportion of transaction amount, the relative proportion of transaction account number and other data columns. And splicing related data columns in different tables according to the transaction id to form the original characteristics. For the missing value column, the missing value column is completed according to a certain rule, and the certain rule can be: except for the relevant proportion of the transaction frequency, the relevant proportion of the transaction amount and the relevant proportion of the transaction account number, the null values of the data of the three types of data columns are filled with the maximum value, and the null values of the other data columns are filled with the value 0.
According to an embodiment of the present disclosure, training a model to be trained based on a training dataset, obtaining a model for predicting a transaction risk includes:
inputting a training data set into a model to be trained, and outputting a training result;
and adjusting parameters of the model to be trained based on the training result and the updated transaction label to obtain a trained model for predicting transaction risk.
According to an embodiment of the present disclosure, the training result may be that the data in each training data set is divided into normal transaction data and abnormal transaction data. The accuracy of the training model may be determined based on the training results and the updated transaction label. If the accuracy is lower than the expected accuracy, the training model can be re-parametrized and then trained again; if the accuracy reaches the expected accuracy, a trained model for predicting the transaction risk can be obtained; wherein the expected accuracy can be determined according to the accuracy which is required to train the model.
According to the embodiment of the present disclosure, before acquiring the first target historical transaction data set generated within the preset time interval, the method further includes:
obtaining authorization of a user to a first target historical transaction data set;
a first target historical transaction data set is obtained after authorization.
Based on the model training method, the present disclosure also provides a method for predicting transaction risk, which will be described in detail below.
FIG. 5 schematically shows a flow chart of a method of predicting transaction risk according to an embodiment of the disclosure
As shown in FIG. 5, the method 500 of predicting transaction risk includes operations S501-S503.
In operation S501, target prediction data associated with a time interval to be predicted is acquired.
According to an embodiment of the present disclosure, the time interval to be predicted may be a period of time during which the transaction does not occur. The target forecast data may be data to be traded, such as account data of both parties to the trade, trade amount, etc.
In operation S502, target prediction data is input into a model for predicting transaction risk.
According to embodiments of the present disclosure, data to be traded may be input into a model for predicting trading risk.
In operation S503, a prediction result is output.
According to the embodiment of the disclosure, the prediction result of normal transaction or abnormal transaction can be output.
According to the embodiment of the disclosure, the transaction can be correspondingly processed according to the prediction result, so that the occurrence of fraudulent transactions is avoided, and the loss of the fraudulent transactions to transaction users is reduced.
Based on the model training method, the disclosure also provides a model training device. The apparatus will be described in detail below with reference to fig. 6.
Fig. 6 schematically shows a block diagram of a model training apparatus according to an embodiment of the present disclosure.
As shown in fig. 6, the model training apparatus 600 of this embodiment includes a first obtaining module 610, a clustering module 620, a determining module 630, an updating module 640, and a training module 650.
The first obtaining module 610 is configured to obtain a first target historical transaction data set generated within a preset time interval, where the first target historical transaction data set includes a normal transaction data set and an abnormal transaction data set, and the normal transaction data set and the abnormal transaction data set have transaction tags. In an embodiment, the first obtaining module 610 may be configured to perform the operation S201 described above, which is not described herein again.
The clustering module 620 is configured to cluster the normal transaction data sets in the first target historical transaction data set to obtain a plurality of clusters. In an embodiment, the clustering module 620 may be configured to perform the operation S202 described above, which is not described herein again.
The determining module 630 is for determining a second target historical transaction data set from the plurality of clusters. In an embodiment, the determining module 630 may be configured to perform the operation S203 described above, which is not described herein again.
The updating module 640 is configured to update the transaction labels carried by the second target historical transaction data set and the abnormal transaction data set by using the classification model to obtain a training data set. In an embodiment, the updating module 640 may be configured to perform the operation S204 described above, which is not described herein again.
The training module 650 is configured to train the model to be trained based on the training data set, and obtain a model for predicting the transaction risk. In an embodiment, the training module 650 may be configured to perform the operation S205 described above, which is not described herein again.
According to an embodiment of the present disclosure, the first obtaining module 610 includes an obtaining sub-unit and a processing unit.
The acquisition subunit is used for acquiring a normal transaction data set and an abnormal transaction data set generated in a preset time interval to obtain initial historical data.
The processing unit is used for preprocessing the initial historical data to obtain a first target historical transaction data set.
According to an embodiment of the present disclosure, the update module 640 includes a classification unit, a determination first subunit, a calculation unit, and a determination second subunit.
And the classification unit is used for inputting the second target historical transaction data set and the abnormal transaction data set into a classification model to obtain a classification result.
The first subunit is determined for determining an error rate of the classification model using the classification result and the transaction label.
The calculation unit is used for calculating the voting weight of the classification model according to the error rate.
And determining a second subunit for updating the transaction label based on the voting weight to obtain a training data set.
According to an embodiment of the present disclosure, any plurality of the first obtaining module 610, the clustering module 620, the determining module 630, the updating module 640, and the training module 650 may be combined and implemented in one module, or any one of them may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first obtaining module 610, the clustering module 620, the determining module 630, the updating module 640, and the training module 650 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or may be implemented in any one of three implementations of software, hardware, and firmware, or in a suitable combination of any of them. Alternatively, at least one of the first obtaining module 610, the clustering module 620, the determining module 630, the updating module 640 and the training module 650 may be at least partially implemented as a computer program module, which when executed, may perform a corresponding function.
Based on the model prediction method, the disclosure also provides a device for predicting transaction risk. The apparatus will be described in detail below with reference to fig. 7.
Fig. 7 schematically shows a block diagram of the structure of an apparatus for predicting transaction risk according to an embodiment of the present disclosure.
As shown in fig. 7, the apparatus 700 for predicting transaction risk of this embodiment includes a second obtaining module 710, an input module 720, and an output module 730.
The second obtaining module 710 is configured to obtain target prediction data associated with a time interval to be predicted. In an embodiment, the second obtaining module 710 may be configured to perform the operation S1 described above, and is not described herein again.
The input module 720 is used to input the target forecast data into a model for forecasting the risk of the transaction. In an embodiment, the input module 720 may be configured to perform the operation S2 described above, which is not described herein again.
The output module 730 is used for outputting the prediction result. In an embodiment, the output module 730 may be configured to perform the operation S3 described above, and is not described herein again.
According to an embodiment of the present disclosure, any plurality of the third obtaining module 710, the input module 720 and the output module 730 may be combined into one module to be implemented, or any one of the modules may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the third obtaining module 710, the input module 720 and the output module 730 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or in any one of or a suitable combination of three manners of software, hardware and firmware. Alternatively, at least one of the third obtaining module 710, the input module 720 and the output module 730 may be at least partially implemented as a computer program module, which when executed may perform a corresponding function.
FIG. 8 schematically illustrates a block diagram of an electronic device suitable for implementing a model training method and a model prediction method according to an embodiment of the disclosure.
As shown in fig. 8, an electronic device 800 according to an embodiment of the present disclosure includes a processor 801 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 803. The processor 801 may include, for example, a general purpose microprocessor (e.g., CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., Application Specific Integrated Circuit (ASIC)), among others. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flows according to embodiments of the present disclosure.
In the RAM 803, various programs and data necessary for the operation of the electronic apparatus 800 are stored. The processor 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. The processor 801 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 802 and/or RAM 803. Note that the programs may also be stored in one or more memories other than the ROM 802 and RAM 803. The processor 801 may also perform various operations of method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 800 may also include input/output (I/O) interface 805, input/output (I/O) interface 805 also connected to bus 804, according to an embodiment of the present disclosure. The electronic device 800 may also include one or more of the following components connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, and a computer program read out therefrom is mounted into the storage section 808 as necessary.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 802 and/or RAM 803 described above and/or one or more memories other than the ROM 802 and RAM 803.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method illustrated in the flow chart. When the computer program product runs in a computer system, the program code is used for causing the computer system to realize the model training method and the method for predicting the transaction risk provided by the embodiment of the disclosure.
The computer program performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure when executed by the processor 801. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted in the form of a signal on a network medium, distributed, downloaded and installed via communication section 809, and/or installed from removable media 811. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program, when executed by the processor 801, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (13)

1. A model training method, comprising:
acquiring a first target historical transaction data set generated in a preset time interval, wherein the first target historical transaction data set comprises a normal transaction data set and an abnormal transaction data set, and the normal transaction data set and the abnormal transaction data set are provided with transaction tags;
clustering the normal transaction data set in the first target historical transaction data set to obtain a plurality of clusters;
determining a second target historical transaction data set from the plurality of clusters;
updating the transaction labels carried by the second target historical transaction data set and the abnormal transaction data set by using a classification model to obtain a training data set; and
and training the model to be trained based on the training data set to obtain a model for predicting transaction risk.
2. The method of claim 1, wherein said updating the transaction labels carried by the second target historical transaction data set and the anomalous transaction data set using a classification model to obtain a training data set comprises:
inputting the second target historical transaction data set and the abnormal transaction data set into the classification model to obtain a classification result;
determining an error rate of a classification model using the classification result and the transaction label;
calculating voting weights of the classification models according to the error rates;
and updating the transaction label based on the voting weight to obtain the training data set.
3. The method of claim 1, wherein the determining a second target historical transaction data set from the plurality of clusters comprises:
and respectively screening the data in each cluster to obtain a second target historical transaction data set, wherein the screening comprises screening by taking each cluster as a center.
4. The method of claim 1, wherein said obtaining a first target historical transaction data set generated over a preset time interval comprises:
acquiring the normal transaction data set and the abnormal transaction data set generated in the preset time interval to obtain initial historical data;
and preprocessing the initial historical data to obtain the first target historical transaction data set.
5. The method of claim 1, wherein the normal transaction data set and the abnormal transaction data set further comprise: transaction basic information and transaction account information.
6. The method of claim 1, wherein the training a model to be trained based on the training dataset, obtaining a model for predicting transaction risk comprises:
inputting the training data set into a model to be trained, and outputting a training result;
and adjusting parameters of the model to be trained based on the training result and the updated transaction label to obtain the trained model for predicting the transaction risk.
7. The method of claim 1, further comprising, prior to said obtaining a first target historical transaction data set generated within a preset time interval:
obtaining user authorization for the first target historical transaction data set;
obtaining the first target historical transaction data set after obtaining the authorization.
8. A method of predicting transaction risk, comprising:
acquiring target prediction data associated with a time interval to be predicted;
inputting the target prediction data into a model for predicting transaction risk; and
outputting a prediction result;
wherein the model for predicting transaction risk is trained according to the method of any one of claims 1 to 7.
9. A model training apparatus comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first target historical transaction data set generated in a preset time interval, the first target historical transaction data set comprises a normal transaction data set and an abnormal transaction data set, and the normal transaction data set and the abnormal transaction data set are provided with transaction tags;
the clustering module is used for clustering the normal transaction data set in the first target historical transaction data set to obtain a plurality of clusters;
a determination module to determine a second target historical transaction data set from the plurality of clusters;
the updating module is used for updating the transaction labels carried by the second target historical transaction data set and the abnormal transaction data set by utilizing a classification model to obtain a training data set; and
and the training module is used for training the model to be trained on the basis of the training data set to obtain a model for predicting the transaction risk.
10. An apparatus for predicting transaction risk, comprising:
the second acquisition module is used for acquiring target prediction data associated with the time interval to be predicted;
an input module for inputting the target prediction data into a model for predicting transaction risk; and
the output module is used for outputting a prediction result;
wherein the model for predicting transaction risk is trained according to the method of any one of claims 1 to 7.
11. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-8.
12. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 8.
13. A computer program product comprising a computer program which, when executed by a processor, implements a method according to any one of claims 1 to 8.
CN202210115648.8A 2022-02-07 2022-02-07 Model training method, device, equipment and medium for predicting transaction risk Pending CN114462532A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210115648.8A CN114462532A (en) 2022-02-07 2022-02-07 Model training method, device, equipment and medium for predicting transaction risk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210115648.8A CN114462532A (en) 2022-02-07 2022-02-07 Model training method, device, equipment and medium for predicting transaction risk

Publications (1)

Publication Number Publication Date
CN114462532A true CN114462532A (en) 2022-05-10

Family

ID=81411329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210115648.8A Pending CN114462532A (en) 2022-02-07 2022-02-07 Model training method, device, equipment and medium for predicting transaction risk

Country Status (1)

Country Link
CN (1) CN114462532A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114862482A (en) * 2022-07-05 2022-08-05 未来地图(深圳)智能科技有限公司 Data processing method and system for predicting product demand based on big data
WO2023235239A1 (en) * 2022-05-30 2023-12-07 Mastercard International Incorporated Artificial intelligence engine for transaction categorization and classification

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023235239A1 (en) * 2022-05-30 2023-12-07 Mastercard International Incorporated Artificial intelligence engine for transaction categorization and classification
CN114862482A (en) * 2022-07-05 2022-08-05 未来地图(深圳)智能科技有限公司 Data processing method and system for predicting product demand based on big data

Similar Documents

Publication Publication Date Title
US11693634B2 (en) Building segment-specific executable program code for modeling outputs
US11593811B2 (en) Fraud detection based on community change analysis using a machine learning model
CN114462532A (en) Model training method, device, equipment and medium for predicting transaction risk
CN113610230A (en) Training method, prediction method, device, computer system and storage medium
CN114358147A (en) Training method, identification method, device and equipment of abnormal account identification model
CN114238993A (en) Risk detection method, apparatus, device and medium
CN113159934A (en) Method and system for predicting passenger flow of network, electronic equipment and storage medium
CN111210109A (en) Method and device for predicting user risk based on associated user and electronic equipment
CN115795345A (en) Information processing method, device, equipment and storage medium
CN114493853A (en) Credit rating evaluation method, credit rating evaluation device, electronic device and storage medium
CN115063145A (en) Transaction risk factor prediction method and device, electronic equipment and storage medium
CN114782170A (en) Method, apparatus, device and medium for evaluating model risk level
CN114708081A (en) Credit risk prediction method and device, electronic equipment and readable storage medium
CN113568739A (en) User resource limit distribution method and device and electronic equipment
CN113391988A (en) Method and device for losing user retention, electronic equipment and storage medium
CN113094595A (en) Object recognition method, device, computer system and readable storage medium
CN113191681A (en) Site selection method and device for network points, electronic equipment and readable storage medium
CN113010798A (en) Information recommendation method, information recommendation device, electronic equipment and readable storage medium
CN113128773A (en) Training method of address prediction model, address prediction method and device
CN114897564A (en) Target customer recommendation method and device, electronic equipment and storage medium
CN114065050A (en) Method, system, electronic device and storage medium for product recommendation
CN114565453A (en) Model construction method, credit risk assessment device, credit risk assessment equipment and credit risk assessment medium
CN117934154A (en) Transaction risk prediction method, model training method, device, equipment, medium and program product
CN115689705A (en) Object identification method, device, equipment and medium
CN114742648A (en) Product pushing method, device, equipment and medium

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