Credit card fraud prediction model training method and device, equipment and storage medium
By processing and optimizing the initial data set and pre-trained model, a highly accurate credit card fraud prediction model is generated, which solves the problem of insufficient accuracy of credit card fraud prediction in traditional methods, and achieves higher detection reliability and economic benefits.
Patent Information
- Application Number
- CN202411527559.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-28
AI Technical Summary
The traditional method of Measurement of Credit Card Fraud Risk is mainly based on local analysis, and it is difficult to generate a highly accurate credit card fraud prediction model.
By obtaining the initial data set and pre-trained model, performing data preprocessing and stacking prediction results of multiple initial learners, determining the initial expected misclassification cost, and optimizing the target expected misclassification cost to generate a credit card fraud prediction model.
It improves the accuracy and robustness of the credit card fraud prediction model, reduces the economic losses caused by misclassification, and enhances the reliability and practicality of fraud detection.
Smart Images

Figure CN119539937A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for training a credit card fraud prediction model, a training device for a credit card fraud prediction model, a computer device, and a computer-readable storage medium. Background Art
[0002] Credit card fraud is a financial risk faced by the country and society, especially the banking industry, in the current era of big data finance. It is urgent to actively explore the combination of new mobile Internet big data technologies and fraud risk prevention, and continuously improve fraud insight capabilities and fraud strategy adaptability to achieve intelligent and precise management of fraud risks.
[0003] Traditional credit risk measurement is to evaluate the user's credit fraud probability based on the customer's basic information and credit history data, using the corresponding machine learning credit prediction model. This type of method is more local analysis and less global analysis. Therefore, how to train and generate a credit card fraud prediction model plays an important role in improving the accuracy of credit card fraud prediction. Summary of the invention
[0004] The present application provides a credit card fraud prediction model training method, a credit card fraud prediction model training device, a computer device and a computer-readable storage medium, aiming to generate a credit card fraud prediction model with better performance, thereby being able to more accurately predict user fraudulent behavior using credit cards.
[0005] To achieve the above objectives, the present application also provides a method for training a credit card fraud prediction model, comprising:
[0006] Acquire an initial data set and a pre-trained model, and perform a pre-processing operation on the initial data set to obtain a training data set, wherein the pre-trained model includes a plurality of initial learners;
[0007] Traversing the initial data set through each of the initial learners to obtain a number of prediction results, and stacking the prediction results into a target prediction result; and determining an initial expected misclassification cost corresponding to each of the initial learners;
[0008] Determine the target expected misclassification cost corresponding to the pre-trained model based on the target prediction result and the initial expected misclassification cost;
[0009] The pre-trained model is optimized by the target expected misclassification cost until the target expected misclassification cost is a minimum value, thereby obtaining the credit card fraud prediction model.
[0010] To achieve the above objectives, the present application also provides a training device for a credit card fraud prediction model, comprising:
[0011] An acquisition module, the acquisition module is used to acquire an initial data set and a pre-trained model, and perform a pre-processing operation on the initial data set to obtain a training data set, wherein the pre-trained model includes a plurality of initial learners;
[0012] A prediction module, the prediction module is used to traverse the initial data set through each of the initial learners to obtain a plurality of prediction results, and stack the plurality of prediction results as a target prediction result; and determine an initial expected misclassification cost corresponding to each of the initial learners;
[0013] A determination module, the determination module is used to determine the target expected misclassification cost corresponding to the pre-trained model based on the target prediction result and the initial expected misclassification cost;
[0014] A training module is used to optimize the pre-trained model through the target expected misclassification cost until the target expected misclassification cost is a minimum value, thereby obtaining the credit card fraud prediction model.
[0015] In addition, to achieve the above-mentioned purpose, the present application also provides a computer device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the steps of the credit card fraud prediction model training method provided in any one of the embodiments of the present application when executing the computer program.
[0016] In addition, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the steps of the credit card fraud prediction model training method described in any one of the embodiments of the present application.
[0017] The present invention discloses a credit card fraud prediction model training method, a credit card fraud prediction model training device, a computer device, and a computer-readable storage medium. The method includes obtaining an initial data set and a pre-trained model, and performing a pre-processing operation on the initial data set to obtain a training data set, wherein the pre-trained model includes multiple initial learners. Further, the initial data set can be traversed through each initial learner to obtain a number of prediction results, and the multiple prediction results are stacked as a target prediction result; and the initial expected misclassification cost corresponding to each initial learner is determined. Thus, the target expected misclassification cost corresponding to the pre-trained model can be determined based on the target prediction result and the initial expected misclassification cost, and the pre-trained model can be optimized by the target expected misclassification cost until the target expected misclassification cost is the minimum value, thereby obtaining a credit card fraud prediction model. The present invention generates a target prediction result based on multiple initial learners, and uses the expected misclassification cost as the optimization basis, which can effectively improve the accuracy and robustness of the credit card fraud prediction model. By minimizing the target expected misclassification cost, the method can reduce the misjudgment rate of the model, especially reduce the cost caused by misclassification, thereby improving the reliability and practicality of credit card fraud detection and reducing potential economic losses. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 It is a scenario diagram of a method for training a credit card fraud prediction model provided in an embodiment of the present application;
[0020] Figure 2 It is a flowchart of a method for training a credit card fraud prediction model provided in an embodiment of the present application;
[0021] Figure 3 It is a schematic block diagram of a training device for a credit card fraud prediction model provided in an embodiment of the present application;
[0022] Figure 4 It is a schematic block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0024] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor do they have to be executed in the order described. For example, some operations / steps can also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions. In addition, although the functional modules are divided in the device schematic, in some cases, the module division can be different from that in the device schematic.
[0025] The term "and / or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0026] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0027] like Figure 1 As shown, the training method of the credit card fraud prediction model provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. The application environment includes a terminal device 110 and a server 120, wherein the terminal device 110 can communicate with the server 120 through a network. Specifically, the server 120 can obtain an initial data set and a pre-trained model, and perform a pre-processing operation on the initial data set to obtain a training data set, wherein the pre-trained model includes multiple initial learners; the initial data set is traversed through each of the initial learners to obtain a number of prediction results, and the prediction results are stacked as a target prediction result; and, the initial expected misclassification cost corresponding to each of the initial learners is determined; based on the target prediction result and the initial expected misclassification cost, the target expected misclassification cost corresponding to the pre-trained model is determined; the pre-trained model is optimized by the target expected misclassification cost until the target expected misclassification cost is the minimum value, and the credit card fraud prediction model is obtained, thereby sending the credit card fraud prediction model to the terminal device 110. Among them, the server 120 can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal device 110 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application does not limit this.
[0028] See also Figure 2 , Figure 2 1 is a flow chart of a method for training a credit card fraud prediction model provided in an embodiment of the present application. Figure 2 As shown, the training method of the credit card fraud prediction model can be implemented through steps S11 to S14.
[0029] Step S11: Obtain an initial data set and a pre-trained model, and perform a pre-processing operation on the initial data set to obtain a training data set.
[0030] Among them, the pre-training model includes multiple initial learners.
[0031] It should be understood that the initial data set may include information such as credit card transactions, which can be obtained from a database. Since the quality of the initial data set varies, there may be missing values, outliers, or inconsistent data formats. Therefore, the initial data set may be preprocessed to obtain a training data set for training the model.
[0032] It should be noted that the preprocessing operation may include data cleaning, data normalization, feature extraction and feature selection, etc., which is not limited in this application.
[0033] For example, the pre-trained model is composed of multiple initial learners. The initial learners include models that have undergone basic training, such as decision trees, logistic regression, support vector machines, etc., which are individual models with certain predictive capabilities.
[0034] Step S12: traverse the initial data set through each initial learner to obtain a number of prediction results, and stack the multiple prediction results as a target prediction result; and determine the initial expected misclassification cost corresponding to each initial learner.
[0035] For example, the initial data set is input into each initial learner for prediction. The initial learners have different learning capabilities and characteristics, and can give different prediction results for the same data set. By traversing each initial learner, multiple prediction results can be obtained.
[0036] For example, several prediction results can be stacked as a target prediction result. Stacking is an integrated learning method that can combine the prediction results of each initial learner to form a comprehensive target prediction result. Furthermore, stacking can generate the target prediction result by voting, weighted averaging, etc., which is not limited in this application. In this way, the shortcomings of a single model can be compensated for each other.
[0037] For example, for each initial learner, the initial expected misclassification cost can be calculated based on its prediction results. The misclassification cost is an indicator that measures the cost of model misclassification. In credit card fraud detection, incorrectly classifying fraudulent transactions as normal transactions or classifying normal transactions as fraudulent transactions will bring different losses, so the misclassification cost is usually set according to the risk of different types of errors.
[0038] Through the above embodiments, it is possible to generate a target prediction result and set an initial expected misclassification cost for each learner for subsequent further optimization of the model.
[0039] Step S13: Determine the target expected misclassification cost corresponding to the pre-trained model based on the target prediction result and the initial expected misclassification cost.
[0040] For example, the target prediction result contains the prediction information of multiple learners, and its goal is to reduce the misclassification cost of the final model by adjusting the contribution ratio of the learners or correcting the output of some learners. The initial misclassification cost can provide the direction of optimization: that is, for different errors (such as misclassifying fraudulent transactions as normal transactions), the model can adjust the strategy according to different weights, and finally obtain the target expected misclassification cost of the overall model.
[0041] Step S14: Optimize the pre-trained model by the target expected misclassification cost until the target expected misclassification cost is the minimum, and obtain a credit card fraud prediction model.
[0042] For example, the pre-trained model can adjust the weight of each initial learner, or reprocess the prediction results of some initial learners to reduce high-cost misclassification. For example, the performance of the pre-trained model can be further improved by adjusting parameters such as learning rate, regularization, etc., so that the pre-trained model can better fit the data without overfitting. Alternatively, the pre-trained model can be repeatedly adjusted in an iterative manner so that the target expected misclassification cost of each iteration is gradually reduced until it converges to a minimum value.
[0043] For example, the optimization process will continue until the target expected misclassification cost reaches the minimum, that is, the pre-trained model can no longer further reduce the target expected misclassification cost by adjusting the weights, parameters or structure of the initial learner. At this point, the pre-trained model is considered to have reached the optimal state, that is, the credit card fraud prediction model has been trained, which has a good credit card fraud detection capability.
[0044] In the above embodiments, through the optimization process, the credit card fraud prediction model finally obtained can effectively reduce the probability of misclassification and minimize the economic losses caused by misclassification. This optimization mechanism ensures the practical application value of the model in fraud detection, which not only improves the accuracy but also reduces the potential risks.
[0045] The training method of the credit card fraud prediction model disclosed in the embodiment of the present application includes obtaining an initial data set and a pre-trained model, and performing a pre-processing operation on the initial data set to obtain a training data set, wherein the pre-trained model includes multiple initial learners. Further, the initial data set can be traversed through each initial learner to obtain a number of prediction results, and the multiple prediction results are stacked as a target prediction result; and the initial expected misclassification cost corresponding to each initial learner is determined. Thus, the target expected misclassification cost corresponding to the pre-trained model can be determined based on the target prediction result and the initial expected misclassification cost, and the pre-trained model can be optimized by the target expected misclassification cost until the target expected misclassification cost is the minimum value, thereby obtaining a credit card fraud prediction model. The embodiment of the present application can effectively improve the accuracy and robustness of the credit card fraud prediction model by generating target prediction results based on multiple initial learners and taking the expected misclassification cost as the optimization basis. By minimizing the target expected misclassification cost, the method can reduce the misjudgment rate of the model, especially reduce the cost caused by misclassification, thereby improving the reliability and practicality of credit card fraud detection and reducing potential economic losses.
[0046] Optionally, the initial data set is preprocessed to obtain a training data set, including: reconstructing the initial data set by a balancing algorithm to obtain a reconstructed data set; performing a data cleaning operation on the reconstructed initial data set to obtain a cleaned data set; encoding the cleaned data set until the cleaned data set is an integer to obtain an encoded data set; and deriving features from the encoded data set based on the target features to obtain a training data set.
[0047] It should be noted that the balancing algorithm is used to represent the reconstruction of data through certain algorithms to solve the problem of class imbalance. Commonly used balancing algorithms include: oversampling, undersampling, and combined sampling. The reconstructed data set can better reflect the characteristics of fraudulent transactions and help improve the model's ability to identify minority classes (fraud).
[0048] The goal of data cleaning is to process non-compliant data and ensure that the data used in model training is complete and valid. Specific operations may include: filling missing values and processing outliers. After data cleaning, the data set is clean and consistent, providing a basis for subsequent coding and training.
[0049] It should be understood that credit card transaction data may contain some non-numeric features, such as transaction category (such as online payment, POS payment, etc.), account type, merchant name, etc. Since these features cannot be directly input into most machine learning models, it is necessary to convert the categorical data into numerical data through encoding. Common encoding methods include label encoding and unique hot encoding. The goal of encoding is to convert all data into integer representation so that the model can process and understand these features. Through this process, the original categorical data is converted into numerical data, so that it can be better used for subsequent model training.
[0050] Feature derivation is the process of creating new features from existing features in order to enhance the model’s predictive power. Through feature derivation, the training dataset contains more information, which can capture potential patterns and anomalies in transaction behavior, thereby improving the performance of the credit card fraud prediction model.
[0051] In the above embodiment, through the preprocessing steps, the original data set is reconstructed, cleaned and encoded, and features are derived to generate a high-quality training data set. The training data set not only solves problems such as class imbalance and data noise, but also increases the effective information for model learning, so that the model can better identify potential credit card fraud transactions, laying the foundation for subsequent model training and optimization.
[0052] Optionally, the initial data set includes the distance between the bank card transaction location and the user's home, the distance between the last transaction location and the home, the location of the last transaction, the ratio of the last transaction to the median price of historical transactions, whether the transaction occurred at the same merchant, whether the transaction was conducted through a bank card, and whether a personal identification password was used; the target features include the location of the last transaction and the ratio of the last transaction to the median price of historical transactions.
[0053] Optionally, the initial expected misclassification cost is obtained by the following formula:
[0054]
[0055] Among them, AUCC is the initial expected misclassification cost; θ is the model parameter; FPR is the false positive rate; FNR is the false negative rate; c FP is the cost coefficient of the false positive rate, c FN is the cost coefficient of the false negative rate, and τ is the preset probability threshold.
[0056] Optionally, reconstructing the initial data set by a balancing algorithm to obtain a reconstructed data set includes: analyzing the initial data set and determining imbalance points in the initial data set; and reconstructing the initial data set by a balancing algorithm based on the imbalance points to obtain a reconstructed data set.
[0057] For example, the initial data set can be analyzed to determine the imbalance points or data quality problems of the data set. Common imbalance phenomena include: class imbalance, feature redundancy, and noisy data. Furthermore, the data can be reconstructed through a balancing algorithm based on the analysis results of the initial data set. For example: If it is a class imbalance problem, the sample distribution can be adjusted by undersampling or oversampling. If it is a feature redundancy problem, redundant information can be removed by feature selection or dimensionality reduction. After applying the balancing algorithm, data of different categories or data of different features can be recombined into a new data set, that is, a reconstructed data set is obtained.
[0058] The above implementation method processes the initial data set through a balancing algorithm, which can solve the category imbalance and redundancy problems in the data, thereby obtaining a reconstructed data set with higher quality.
[0059] Optionally, after obtaining the credit card fraud prediction model, it also includes: iteratively training the credit card fraud prediction model to extract data features and calculate the loss function; iteratively training the loss function using a preset method for the purpose of reducing the value of the loss function until the expected threshold requirement is met; based on the iteratively trained loss function, obtaining the iterative credit card fraud prediction model.
[0060] It is understandable that in order to train a credit card fraud prediction model with higher accuracy, the credit card fraud prediction model can be repeatedly iterated to train so that the loss function continues to decrease until the loss function meets the expected threshold requirement, and then a more accurate prediction result can be obtained based on the iterated credit card fraud prediction model.
[0061] It should be noted that the present application does not limit the above-mentioned preset method and expected threshold. For example, the preset method may be a gradient descent algorithm, a batch gradient descent algorithm, a stochastic gradient descent algorithm, etc. The present application takes the gradient descent algorithm as an example for explanation.
[0062] The purpose of the gradient descent algorithm is to find the minimum value of the loss function or converge to the minimum value through iteration. In a geometric sense, the gradient descent algorithm means that the gradient decreases fastest in the direction opposite to the vector where the function changes the fastest, so it is easier to find the minimum value of the function. Based on this, in the embodiment of the present application, the gradient descent algorithm can be used to repeatedly iterate the training of the credit card fraud prediction model so that the loss function is continuously reduced, thereby reducing the error of the calculation result.
[0063] In the embodiment of the present application, the denoising model is repeatedly iteratively trained using a gradient descent algorithm so that the loss function is continuously reduced to obtain an iterative credit card fraud prediction model, and then a more accurate prediction result can be obtained based on the iterative credit card fraud prediction model.
[0064] Optionally, the loss function is obtained by the following formula:
[0065]
[0066] Among them, S is the loss function; τ is the preset probability threshold; θ is the model parameter; FPR is the false positive rate; FNR is the false negative rate; c FP is the cost coefficient of the false positive rate, c FN is the cost coefficient of the false negative rate.
[0067] Optionally, the method further includes: obtaining transaction information of the target credit card; performing feature extraction on the transaction information to obtain a target transaction feature vector; and analyzing the target transaction feature vector through a credit card fraud prediction model to obtain a risk probability value of the target credit card.
[0068] For example, transaction records related to the target credit card can be collected from the credit card transaction system. Such transaction information usually contains data of multiple dimensions, such as transaction time, location, amount, merchant category, etc.
[0069] For example, feature extraction is performed on the acquired transaction information to convert the raw data into a numerical form that the model can understand. Feature extraction can be performed from multiple dimensions, including time features (such as whether the transaction is in an abnormal time period), geographical features (the distance between the transaction location and the cardholder's usual activity location), transaction mode (whether it conforms to the cardholder's normal consumption habits), etc. The extracted data points will be combined into a feature vector of the target transaction.
[0070] For example, the extracted target transaction feature vector can be used as input to a trained credit card fraud prediction model. After analyzing the target transaction feature vector, the credit card fraud prediction model outputs a risk probability value, which can indicate the possibility that the transaction is considered fraudulent.
[0071] The above embodiments can help banks or payment institutions to quickly determine whether a transaction has potential fraud risks when it occurs through a credit card fraud prediction model, and take further measures (such as requiring verification or blocking transactions) based on the risk value.
[0072] Optionally, feature extraction is performed on the transaction information to obtain a target transaction feature vector, including: preprocessing the transaction information to obtain preprocessed transaction information; feature extraction is performed on the preprocessed transaction information, and a target transaction feature vector is constructed.
[0073] For example, before feature extraction, the original transaction data needs to be preprocessed to ensure data quality and consistency. Preprocessing operations include but are not limited to missing value processing, outlier processing, and time format processing. Furthermore, a target transaction feature vector can be generated through feature selection and feature engineering. As a result, the characteristics of transaction behavior can be effectively captured based on the target transaction feature vector, and the model can be supported for transaction analysis, fraud detection, or user behavior prediction.
[0074] See also Figure 3 , Figure 3 This is a schematic block diagram of a credit card fraud prediction model training device provided in an embodiment of the present application. The credit card fraud prediction model training device can be configured in a server to execute the aforementioned credit card fraud prediction model training method.
[0075] like Figure 4 As shown, the training device 200 for the credit card fraud prediction model includes: an acquisition module 201 , a prediction module 202 , a determination module 203 and a training module 204 .
[0076] An acquisition module 201 is used to acquire an initial data set and a pre-trained model, and perform a pre-processing operation on the initial data set to obtain a training data set, wherein the pre-trained model includes a plurality of initial learners;
[0077] The prediction module 202 is used to traverse the initial data set through each of the initial learners to obtain a plurality of prediction results, and stack the plurality of prediction results as a target prediction result; and determine an initial expected misclassification cost corresponding to each of the initial learners;
[0078] A determination module 203 is used to determine a target expected misclassification cost corresponding to the pre-trained model based on the target prediction result and the initial expected misclassification cost;
[0079] The training module 204 is used to optimize the pre-trained model through the target expected misclassification cost until the target expected misclassification cost is a minimum value, thereby obtaining the credit card fraud prediction model.
[0080] The acquisition module 201 is also used to reconstruct the initial data set through a balancing algorithm to obtain a data set after data reconstruction; perform a data cleaning operation on the initial data set after data reconstruction to obtain a data set after data cleaning; encode the data set after data cleaning until the data set after data cleaning is an integer to obtain an encoded data set; and perform feature deriving on the encoded data set based on the target feature to obtain the training data set.
[0081] The training module 204 is also used to iteratively train the credit card fraud prediction model to extract data features and calculate the loss function; iteratively train the loss function using a preset method for the purpose of reducing the value of the loss function until the expected threshold requirement is met; based on the iteratively trained loss function, obtain the iterative credit card fraud prediction model.
[0082] The acquisition module 201 is also used to acquire the transaction information of the target credit card; and extract the features of the transaction information to obtain the target transaction feature vector; and analyze the target transaction feature vector through the credit card fraud prediction model to obtain the risk probability value of the target credit card.
[0083] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0084] The method and apparatus of the present application can be used in many general or special computing system environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer terminal devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices.
[0085] Exemplarily, the above method and apparatus may be implemented in the form of a computer program. The computer program may be implemented in the form of a computer program. Figure 4 Runs on the computer device shown.
[0086] See also Figure 4 , Figure 4 1 is a schematic diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0087] like Figure 4 As shown, the computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a volatile storage medium, a non-volatile storage medium and an internal memory.
[0088] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any training method for a credit card fraud prediction model.
[0089] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0090] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any training method for the credit card fraud prediction model.
[0091] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art can understand that the structure of the computer device is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0092] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0093] Among them, in some embodiments, the processor is used to obtain an initial data set and a pre-trained model, and perform pre-processing operations on the initial data set to obtain a training data set, wherein the pre-trained model includes multiple initial learners; traverse the initial data set through each of the initial learners to obtain a number of prediction results, and stack the several prediction results into a target prediction result; and determine the initial expected misclassification cost corresponding to each of the initial learners; determine the target expected misclassification cost corresponding to the pre-trained model based on the target prediction result and the initial expected misclassification cost; optimize the pre-trained model through the target expected misclassification cost until the target expected misclassification cost is the minimum value, thereby obtaining the credit card fraud prediction model.
[0094] In some embodiments, the processor is further used to reconstruct the initial data set through a balancing algorithm to obtain a data set after data reconstruction; perform a data cleaning operation on the initial data set after data reconstruction to obtain a data set after data cleaning; encode the data set after data cleaning until the data set after data cleaning is an integer to obtain an encoded data set; and perform feature deriving on the encoded data set based on the target feature to obtain the training data set.
[0095] In some embodiments, the processor is also used to iteratively train the credit card fraud prediction model to extract data features and calculate a loss function; iteratively train the loss function using a preset method for the purpose of reducing the value of the loss function until an expected threshold requirement is met; and obtain the iterative credit card fraud prediction model based on the iteratively trained loss function.
[0096] In some embodiments, the processor is also used to obtain transaction information of a target credit card; perform feature extraction on the transaction information to obtain a target transaction feature vector; and analyze the target transaction feature vector using the credit card fraud prediction model to obtain a risk probability value for the target credit card.
[0097] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions, and when the program instructions are executed, a training method for any credit card fraud prediction model provided in the embodiment of the present application is implemented.
[0098] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.
[0099] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like.
[0100] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for training a credit card fraud prediction model, characterized in that: The training method comprises: Acquire an initial data set and a pre-trained model, and perform a pre-processing operation on the initial data set to obtain a training data set, wherein the pre-trained model includes a plurality of initial learners; Traversing the initial data set through each of the initial learners to obtain a number of prediction results, and stacking the prediction results into a target prediction result; and determining an initial expected misclassification cost corresponding to each of the initial learners; Determine the target expected misclassification cost corresponding to the pre-trained model based on the target prediction result and the initial expected misclassification cost; The pre-trained model is optimized by the target expected misclassification cost until the target expected misclassification cost is a minimum value, thereby obtaining the credit card fraud prediction model.
2. The method according to claim 1, characterized in that The preprocessing operation is performed on the initial data set to obtain a training data set, including: Reconstructing the initial data set by using a balancing algorithm to obtain a data set after data reconstruction; Performing a data cleaning operation on the initial data set after the data reconstruction to obtain a data set after the data cleaning; Encoding the cleaned data set until the cleaned data set is an integer to obtain an encoded data set; The encoded data set is subjected to feature derivation based on the target feature to obtain the training data set.
3. The method according to claim 2, characterized in that The initial data set includes the distance between the bank card transaction location and the user's home, the distance between the last transaction location and the home, the location of the last transaction, the ratio of the last transaction to the median price of historical transactions, whether the transaction occurred at the same merchant, whether the transaction was conducted through a bank card, and whether a personal identification password was used; The target features include the location where the last transaction occurred and the ratio of the last transaction to the median price of historical transactions.
4. The method according to claim 1, characterized in that: The step of reconstructing the initial data set by using a balancing algorithm to obtain a data set after data reconstruction includes: Analyzing the initial data set and determining imbalance points in the initial data set; Based on the imbalance point, the initial data set is reconstructed by using the balancing algorithm to obtain the reconstructed data set.
5. The method according to claim 1, characterized in that After obtaining the credit card fraud prediction model, the method further includes: Iteratively training the credit card fraud prediction model to extract data features and calculate a loss function; Iteratively training the loss function using a preset method for the purpose of reducing the value of the loss function until the expected threshold requirement is met; Based on the loss function after iterative training, the iterative credit card fraud prediction model is obtained.
6. The training method according to claim 1, characterized in that: The method further comprises: Get the target credit card transaction information; and extracting features from the transaction information to obtain a target transaction feature vector; The target transaction feature vector is analyzed by the credit card fraud prediction model to obtain a risk probability value of the target credit card.
7. The training method according to claim 6, characterized in that: The extracting features of the transaction information to obtain a target transaction feature vector includes: Performing a preprocessing operation on the transaction information to obtain preprocessed transaction information; Feature extraction is performed on the preprocessed transaction information, and the target transaction feature vector is constructed.
8. A training device for a credit card fraud prediction model, characterized in that: The training device comprises: An acquisition module, the acquisition module is used to acquire an initial data set and a pre-trained model, and perform a pre-processing operation on the initial data set to obtain a training data set, wherein the pre-trained model includes a plurality of initial learners; A prediction module, the prediction module is used to traverse the initial data set through each of the initial learners to obtain a plurality of prediction results, and stack the plurality of prediction results as a target prediction result; and determine an initial expected misclassification cost corresponding to each of the initial learners; A determination module, the determination module is used to determine the target expected misclassification cost corresponding to the pre-trained model based on the target prediction result and the initial expected misclassification cost; A training module is used to optimize the pre-trained model through the target expected misclassification cost until the target expected misclassification cost is a minimum value, thereby obtaining the credit card fraud prediction model.
9. A computer device, characterized in that: include: A memory and a processor; wherein the memory is connected to the processor and is used to store a program; the processor is used to implement the steps of the credit card fraud prediction model training method as described in any one of claims 1 to 7 by running the program stored in the memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to implement the steps of the method for training a credit card fraud prediction model as described in any one of claims 1 to 7.