Data classification method, apparatus, device, storage medium, and program product
Patent Information
- Application Number
- CN202510484382.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2026-10-23
AI Technical Summary
[0004]上述神经网络模型虽然可以实现对使用对象的预测分类,但是由于神经网络模型的参数较多且处理过程较为繁琐,若仅仅通过唯一输出的分类结果表征使用对象的违约情况,可能存在分析不全面等问题,使得使用对象的违约情况的判定存在误差,影响使用对象的操作过程
[0018]通过至少两个感知机网络层对第一账号的账号数据执行分类预测,得到与至少两个感知机网络层分别对应的数据分类结果,考虑到每个感知机网络层对应的网络层权重表征感知机网络层的分类影响程度,因此通过网络层权重协调至少两个数据分类结果并得到第一账号的账号分类结果。将预先训练的至少两个感知机网络层作为对账号数据执行分类预测的网络层,以在保障分类处理数据量较小的同时,通过至少两个感知机网络层清晰化数据的分类过程,以网络层权重协调数据分类结果,使得账号分类结果的获取更具有可解释性,从而可以更准确地预测第一账号在未来时间段的账号操作情况,在避免影响使用对象的操作过程的同时,也可以提高账号管理平台对于第一账号的管理针对性,降低账号管理平台的管理风险,保障账号管理平台下更多使用对象的使用体验。
Smart Images

Figure CN122964624A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine learning, and in particular to a data classification method, apparatus, device, storage medium, and program product. Background Technology
[0002] With the development of machine learning technology, various neural network models are being applied to a variety of scenarios, such as gaming, finance, risk management and credit assessment, and education, to improve analysis efficiency and decision-making accuracy, and to provide more intelligent support in complex and dynamic environments.
[0003] In related technologies, taking the prediction of default by users in risk management and credit assessment scenarios as an example, it is usually necessary to obtain a neural network model pre-trained through a public dataset, then analyze the object data corresponding to the user through the neural network model, and output the classification results based on the object data through the output layer to characterize whether the user may default or not.
[0004] While the aforementioned neural network model can predict and classify users, it has many parameters and a complex processing procedure. If the classification result alone is used to characterize the user's breach of contract, there may be issues such as incomplete analysis, leading to errors in the determination of the user's breach of contract and affecting the user's operational process. Summary of the Invention
[0005] This application provides a data classification method, apparatus, device, storage medium, and program product that can use at least two perceptron network layers as network layers to perform classification prediction on account data, clarifying the data classification process, coordinating the data classification results with network layer weights, making the acquisition of account classification results more interpretable, and thus more accurately predicting the account operation of the first account in the future time period, ensuring the user experience. The technical solution is as follows.
[0006] On the one hand, a method for training a data classification model is provided, the method comprising:
[0007] Acquire account data, which describes the account operation activities of the first account within a historical time period;
[0008] The account data is classified and predicted by at least two pre-trained perceptron network layers to obtain data classification results corresponding to the at least two perceptron network layers respectively; wherein, the at least two perceptron network layers correspond to network layer weights, the network layer weights are parameters learned by the perceptron network layers during training, and the network layer weights are used to characterize the classification influence of the perceptron network layers.
[0009] Based on the network layer weights corresponding to the at least two perceptron network layers, and through the data classification results corresponding to the at least two perceptron network layers, the account classification result corresponding to the first account is obtained; the account classification result is a prediction result of the account operation of the first account in a future time period.
[0010] On the other hand, a training apparatus for a data classification model is provided, the apparatus comprising:
[0011] The acquisition module is used to acquire account data, which describes the account operation of the first account within a historical time period.
[0012] The prediction module is used to perform classification prediction on the account data through at least two pre-trained perceptron network layers to obtain data classification results corresponding to the at least two perceptron network layers respectively; wherein, the at least two perceptron network layers respectively correspond to network layer weights, the network layer weights are parameters learned by the perceptron network layers during training, and the network layer weights are used to characterize the classification influence of the perceptron network layers.
[0013] The determination module is used to obtain the account classification result corresponding to the first account based on the network layer weights corresponding to the at least two perceptron network layers and the data classification results corresponding to the at least two perceptron network layers respectively; the account classification result is a prediction result of the account operation of the first account in a future time period.
[0014] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the data classification method as described in any of the embodiments of this application above.
[0015] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored therein, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the data classification method as described in any of the embodiments of this application above.
[0016] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the data classification methods described in the above embodiments.
[0017] The beneficial effects of the technical solutions provided in this application include at least the following:
[0018] The account data of the first account is classified and predicted using at least two perceptron network layers. This yields classification results corresponding to each of the at least two perceptron network layers. Considering that the weights of each perceptron network layer represent its influence on classification, the weights are used to coordinate the classification results of the at least two layers to obtain the account classification result for the first account. Using at least two pre-trained perceptron network layers as the classification prediction layers for the account data ensures a relatively small amount of data is processed. The classification process is clarified through these at least two layers, and the weights coordinate the classification results, making the account classification results more interpretable. This allows for more accurate prediction of the first account's future activity, avoiding disruption to user operations while improving the targeting of the account management platform for the first account, reducing management risks, and ensuring a better user experience for more users on the platform. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a structural block diagram of a classification system provided in an exemplary embodiment of this application;
[0021] Figure 2 This is a flowchart of a data classification method provided in an exemplary embodiment of this application;
[0022] Figure 3 This is a flowchart of a data classification method provided in another exemplary embodiment of this application;
[0023] Figure 4 This is a flowchart of a data classification method provided in another exemplary embodiment of this application;
[0024] Figure 5 This is a flowchart illustrating a comparative analysis of a data classification model and a logistic regression model based on a perceptron network layer, provided in an exemplary embodiment of this application.
[0025] Figure 6 This is a detailed flowchart of a comparative analysis of a data classification model and a logistic regression model based on a perceptron network layer provided in an exemplary embodiment of this application;
[0026] Figure 7 This is a schematic diagram of an exemplary embodiment of the present application, which uses a perceptron network layer as a base classifier to construct and train a data classification model;
[0027] Figure 8 This is a schematic diagram of a data classification model obtained through training, provided in an exemplary embodiment of this application;
[0028] Figure 9 This is a structural block diagram of a data classification apparatus provided in an exemplary embodiment of this application;
[0029] Figure 10 This is a structural block diagram of a data classification apparatus provided in another exemplary embodiment of this application;
[0030] Figure 11 This is a structural block diagram of a server provided in an exemplary embodiment of this application. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0032] In related technologies, taking the prediction of user default in risk management and credit assessment scenarios as an example, it is usually necessary to obtain a neural network model pre-trained on a public dataset. Then, the neural network model analyzes the user's corresponding object data, and the output layer outputs a classification result based on the object data to characterize whether the user may default or not. While the aforementioned neural network model can achieve predictive classification of users, due to the large number of parameters and the cumbersome processing, relying solely on the single output classification result to characterize the user's default may lead to incomplete analysis and errors in determining the user's default status, affecting the user's operational process.
[0033] This application presents a training method for a data classification model. This method utilizes at least two perceptron network layers to perform classification prediction on account data, clarifying the data classification process. By coordinating the data classification results with network layer weights, the method enhances the interpretability of the account classification results, thereby more accurately predicting the account activity of the first account in the future and ensuring a better user experience. The data classification method proposed in this application can be applied to various data-based classification prediction scenarios, such as risk management and credit assessment, finance, healthcare, content recommendation, and network environment detection, without limitation.
[0034] In some embodiments, the application of data classification methods to risk management and credit assessment scenarios is illustrated as an example.
[0035] In illustrative terms, risk management and credit assessment scenarios within the financial services and related industries involve identifying, assessing, and managing potential risks related to the behavior and financial status of users. For example, this typically involves analyzing a user's historical behavior, financial situation, credit score, and other factors to assess the likelihood of default.
[0036] Optionally, obtain account data.
[0037] Among them, account data is used to describe the account operation of the first account within a historical time period.
[0038] For illustrative purposes, the primary account refers to the account of the user that needs to be assessed and managed for risk management and credit assessment. For example, in the financial industry, the primary account may be the user's bank account number or user identifier; in the application industry, the primary account may be the user's registration or login account on the application. Here, the primary account is not limited in scope.
[0039] For illustrative purposes, this refers to the first account, where account data is collected based on the account operations of the first account within a historical time period. The historical time period is a preset period from the past, such as the past month, past three months, or past year. For example, in the financial industry, the first account is the account opening account; the account data includes deposit amounts, loan amounts, repayment amounts, and repayment durations recorded within the historical time period (e.g., the past year). Or, in the application industry, the first account is the application account logged into the application; the account data includes application usage time and payment frequency recorded within the historical time period (e.g., the time period from registration to the current time). These are not limited here.
[0040] Optionally, classification prediction is performed on the account data using at least two pre-trained perceptron network layers to obtain data classification results corresponding to the at least two perceptron network layers respectively.
[0041] In illustratively, at least two pre-trained perceptron network layers are obtained, and account data is input into each of the at least two perceptron network layers. Each perceptron network layer performs classification prediction on the account data, thereby obtaining the data classification results corresponding to the at least two perceptron network layers respectively.
[0042] The data classification result represents the classification prediction result of a single-layer perceptron network for the first account. For example, the classification prediction result includes default and no default. Each perceptron network layer performs classification prediction on the account data and obtains a corresponding data classification result indicating default or no default. For example, if the account data is input into perceptron network layer a, perceptron network layer b, etc., the data classification result output by perceptron network layer a is "no default", which means that perceptron network layer a predicts that the user of the first account is unlikely to default in the future. The data classification result output by perceptron network layer b is "default", which means that perceptron network layer b predicts that the user of the first account is likely to default in the future, and so on.
[0043] In this system, at least two perceptron network layers correspond to network layer weights, which are parameters learned by the perceptron network layers during training. The network layer weights are used to characterize the classification influence of the perceptron network layers.
[0044] To illustrate, during the training of the perceptron network layers, each perceptron network layer learns its own corresponding network layer weights, and these network layer weights influence the process of obtaining the final account classification result based on the data classification results.
[0045] Optionally, based on the network layer weights corresponding to at least two perceptron network layers, the account classification result corresponding to the first account is obtained through the data classification results corresponding to at least two perceptron network layers.
[0046] To illustrate, the larger the weight of a network layer, the more attention needs to be paid to the account classification result output by that perceptron network layer; conversely, the smaller the weight of a network layer, the less attention needs to be paid to the account classification result output by that perceptron network layer. Therefore, based on the network layer weight corresponding to each perceptron network layer, the classification influence of the data classification result output by the corresponding perceptron network layer in obtaining the final account classification result is adjusted, thereby obtaining an account classification result that conforms to the network layer weights and integrates multiple data classification results.
[0047] The account classification result is a prediction of the account's activity in the future. Illustratively, the account classification result is obtained by combining the data classification results from at least two perceptron network layers, constrained by the network layer weights. For example, if there are two perceptron network layers, with layer a having a weight of 0.68 and predicting that the user of the first account is unlikely to default in the future, and layer b having a weight of 0.52 and predicting that the user of the first account is likely to default in the future, the combined account classification result for the first account is "will not default," such as considering the first account a safe account and not restricting its operations in the future.
[0048] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant regions. For example, the account data involved in this application was obtained with full authorization.
[0049] Secondly, the classification system involved in the embodiments of this application will be described. The data classification method provided in the embodiments of this application can be implemented by the terminal alone, by the server, or by the terminal and the server through data interaction. The embodiments of this application do not limit this. Optionally, the data classification method is described using the interaction between the terminal and the server.
[0050] This is illustrative; please refer to it. Figure 1 The classification system involves a terminal 110 and a server 120, which are connected via a communication network 130.
[0051] In some embodiments, terminal 110 has a data acquisition function for acquiring account data to be classified and predicted, wherein the account data is used to describe the account operation of the first account in a historical time period.
[0052] For illustrative purposes, the primary account is the account used for risk management and credit assessment. Account data is generated based on operational activities during the primary account's usage and is linked to the primary account.
[0053] Optionally, terminal 110 sends account data to server 120 via communication network 130, and server 120 performs data classification tasks; or, terminal 110 performs data classification tasks itself, etc.
[0054] In some embodiments, taking the data classification process performed by server 120 as an example, server 120 performs classification prediction on account data through at least two pre-trained perceptron network layers to obtain data classification results corresponding to the at least two perceptron network layers respectively.
[0055] In this system, at least two perceptron network layers (e.g., perceptron network layer 1, perceptron network layer 2, ..., perceptron network layer n) correspond to network layer weights. These weights are parameters learned during the training process and characterize the classification influence of each perceptron network layer. Illustratively, by performing classification prediction on account data using each perceptron network layer, data classification results corresponding to at least two perceptron network layers can be obtained.
[0056] In some embodiments, the server 120 obtains the account classification result corresponding to the first account based on the network layer weights corresponding to at least two perceptron network layers and the data classification results corresponding to at least two perceptron network layers.
[0057] The account classification result is a prediction of the account's activity in the future. Illustratively, constrained by network layer weights, the account classification result is obtained by combining the data classification results from at least two perceptron network layers. This represents the predicted classification of the first account in the future, such as whether the first account is a defaulting account or a non-defaulting account; or whether the first account prefers entertainment or educational content.
[0058] Optionally, server 120 sends the account classification results to terminal 110 via communication network 130 to render and display the account classification results of the account data on terminal 110.
[0059] It is worth noting that the aforementioned terminals include, but are not limited to, mobile terminals such as mobile phones, tablets, portable laptops, smart voice interaction devices, smart home appliances, and in-vehicle terminals, and can also be desktop computers, etc.; the aforementioned servers can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers.
[0060] Based on the above introduction to terminology and application scenarios, the data classification method provided in this application will be explained, with an example of its application to a server, such as... Figure 2 As shown, the method includes the following steps 210 to 230.
[0061] Step 210: Obtain account data.
[0062] Among them, account data is used to describe the account operation of the first account within a historical time period.
[0063] For illustrative purposes, the primary account is the account used by the user. This primary account can be implemented as different accounts depending on the platform used by the user. Optionally, in the financial industry, the primary account may be such as the user's bank account number or the user's object identifier; in the application industry, the primary account may be such as the application account used by the user to register or log in to the application.
[0064] This is illustrative; the historical time period refers to a period of time that has elapsed before the current moment, such as the past week, the past month, or the past six months. The system tracks the activity of the first account within this historical time period, generating account data corresponding to that account. This account data includes at least one of several data types related to the first account, such as account attribute data, account behavior data, account interaction data, and account security data.
[0065] Account attribute data describes the account attributes of the primary account itself. Account attribute data includes at least one of the following: account creation time (e.g., account opening time, registration time), most recent login time (e.g., most recent card swipe time, most recent online time), type of device used for login (e.g., bank counter, ATM, mobile phone type), and Internet Protocol (IP) address used for login.
[0066] Account behavior data describes the usage status of a primary account and includes at least one of the following: account click history, account browsing history, account search history, etc.
[0067] Account interaction data describes the interactions between the first account and other accounts. Account interaction data includes at least one of several types of data, such as transfer data (e.g., transferring money to or receiving money from other accounts), comment data, and like data.
[0068] Account security data describes the security status and potential risks of the primary account. Account security data includes at least one of the following: abnormal login data (e.g., frequently used in location A but suddenly used in location B), password change records (e.g., changing transfer password, changing login password), and security verification data (e.g., failing to verify the primary account after multiple password attempts). This is not limited to any particular type of data.
[0069] In some embodiments, account classification is performed on the first account based on account data, which can also be called data classification. The classification process determines the account category to which the first account belongs.
[0070] For illustrative purposes, account categories may vary depending on the classification process. Optionally, when account classification is applied to risk management and credit assessment scenarios, account categories may include "default category" and "non-default category"; that is, the purpose of account classification is to predict whether the first account is likely to "default" or "not default" in the future. Alternatively, when account classification is applied to content recommendation scenarios, account categories may include "game category," "education category," "entertainment category," etc.; that is, the purpose of account classification is to predict whether the first account is likely to view game content, educational content, or entertainment content in the future, etc., without limitation here.
[0071] Step 220: Perform classification prediction on the account data using at least two pre-trained perceptron network layers to obtain the data classification results corresponding to the at least two perceptron network layers respectively.
[0072] Indicatively, at least two pre-trained perceptron network layers constitute the network layers of a pre-trained data classification model; the data classification model is a model used to perform data classification on account data.
[0073] A perceptron network is an artificial neural network typically used for binary classification problems. A perceptron network mainly consists of an input layer and an output layer. In a perceptron network, the input layer receives input data and passes it to neurons. During computation, neurons perform a linear combination of the input data and then convert it into an output signal using an activation function (such as a step function). Each neuron performs a weighted sum based on the input data and its corresponding weights, and uses an activation function to determine whether to activate the output. The output layer then derives the final predicted classification result based on the processing results of the input layer.
[0074] Optionally, at least two perceptron network layers are pre-trained, and the data classification model is constructed by connecting the at least two perceptron network layers in series. Each trained perceptron network layer has a certain data classification ability and is used to perform the classification process on the input data.
[0075] In a schematic manner, account data is input into each perceptron network layer. Each perceptron network layer performs classification prediction on the account data to obtain the data classification result. The data classification result is the category of the first account predicted based on the account data. Since there are at least two perceptron network layers, the data classification results corresponding to at least two perceptron network layers are output respectively. The data classification results output by different perceptron network layers may be the same or different.
[0076] Optionally, at least two perceptron network layers have the same network layer architecture, but the network layer parameters learned during training may be different. A perceptron network layer includes at least one sub-network layer, and the network layer parameters are adjustable parameters that the perceptron network layer can learn during training. At least one parameter corresponding to each sub-network layer in a perceptron network layer collectively constitutes the network layer parameters for that perceptron network layer. For example, if each perceptron network layer includes one neuron, the parameter corresponding to the neuron can be considered as the network layer parameters; if each perceptron network layer includes multiple neurons, the parameter corresponding to each neuron can be considered as part of the network layer parameters.
[0077] During the training of the perceptron network layer, the parameters of each sub-network layer in the perceptron network layer are adjusted by optimization algorithms such as gradient descent, and the network layer parameters of the perceptron network layer are obtained after training is completed.
[0078] Optionally, the network layer architectures of at least two perceptron network layers may also differ, such as: the number of sub-network layers in different perceptron network layers is different; and / or, the number of neurons in each sub-network layer is different; and / or, the activation functions are different, etc. Accordingly, the network layer parameters learned during the training of the perceptron network layer may also be different, which is not limited here.
[0079] In this system, at least two perceptron network layers correspond to network layer weights; the network layer weights are parameters learned by the perceptron network layers during training.
[0080] As an illustration, during the training of at least two perceptron network layers, each perceptron network layer learns its corresponding network layer weights. These network layer weights characterize the degree of classification influence of the perceptron network layer.
[0081] The network layer weights are different from the network layer parameters mentioned above. The network layer parameters affect the output of the perceptron network layer, that is, the data classification result output by the perceptron network layer is determined by the network layer parameters. The network layer weights affect the proportion of the data classification result in the final classification result, that is, the data classification result output by different perceptron network layers is adjusted by the network layer weights.
[0082] To illustrate, when analyzing account data using a data classification model to predict the category of a first account, at least two perceptron network layers are needed to jointly analyze the account data. The network layer weights learned during training represent the importance of each perceptron network layer in the final classification result output by the data classification model. For example, if the network layer weight 1 of perceptron network layer a1 is larger, it means that perceptron network layer a1 has a greater influence on the final classification result, that is, the data classification result output by perceptron network layer a1 needs to be considered more when obtaining the final classification result; if the network layer weight 2 of perceptron network layer a2 is smaller, it means that perceptron network layer a2 has a smaller influence on the final classification result, that is, the data classification result output by perceptron network layer a2 can be considered less when obtaining the final classification result.
[0083] Step 230: Based on the network layer weights corresponding to at least two perceptron network layers, obtain the account classification result corresponding to the first account through the data classification results corresponding to at least two perceptron network layers.
[0084] In a schematic way, the influence of the perceptron network layer on the final classification result is represented by the network layer weight. Therefore, the network layer weight of the perceptron network layer is used as the weight to measure the influence of the corresponding data classification result on the final classification result. Thus, the account classification result is obtained by combining the data classification results output by the perceptron network layer.
[0085] To illustrate, the higher the weight of a network layer, the greater the influence of the data classification result output by that perceptron network layer on the resulting account classification; conversely, the lower the weight of a network layer, the smaller the influence of the data classification result output by that perceptron network layer on the resulting account classification. By combining the data classification results output by at least two perceptron network layers, the account classification result corresponding to the first account can be obtained, that is, the category to which the first account belongs can be determined.
[0086] The account classification result is a prediction of the account's activity over a future time period.
[0087] Indicatively, the future time period is the time period after the current moment that has not yet passed; the account classification result is a summary consideration of at least two account classification results, which is a comprehensive result after performing classification prediction on account data within the historical time period at least twice, representing the predicted account operation situation of the first account in the future time period.
[0088] In an optional embodiment, for the kth perceptron network layer in at least two perceptron network layers, the kth data classification result output by the kth perceptron network layer is adjusted by the weight of the kth network layer corresponding to the kth perceptron network layer to obtain the first adjustment result corresponding to the kth perceptron network layer, where k is a positive integer; the account classification result corresponding to the first account is obtained by using the first adjustment results corresponding to the at least two perceptron network layers respectively.
[0089] Indicatively, the kth perceptron network layer is any one of at least two perceptron network layers. By adjusting the weights of the kth network layer, the kth data classification result output by the kth perceptron network layer can be obtained as the first adjustment result after equilibrium. The account classification result is obtained by summing at least two first adjustment results.
[0090] In some embodiments, the first adjustment results corresponding to at least two perceptron network layers are summed to obtain the account classification result corresponding to the first account; wherein, if the account classification result reaches a first threshold, the first account corresponds to a first account category, and if the account classification result does not reach the first threshold, the first account corresponds to a second account category, and the first account category and the second account category are different.
[0091] Optionally, taking risk management and credit assessment scenarios as an example, the account classification results can be categorized into account types such as "default category" or "non-default category". If the account classification result is "default category", it means that the first account is predicted to "default" in the future.
[0092] Optionally, taking a content recommendation scenario as an example, if a perceptron network layer is used to perform a binary classification process, the account classification result will lead to an account category such as "education category" or "entertainment category" (the account categories selected here are only illustrative examples and are not limited). If the account classification result is "entertainment category", it means that the first account is predicted to view entertainment content in the future.
[0093] It is worth noting that the above are merely illustrative examples, and the embodiments of this application are not limited thereto.
[0094] In summary, by using at least two pre-trained perceptron network layers as the network layers for classifying and predicting account data, the classification process can be clarified by using at least two perceptron network layers while ensuring a relatively small amount of data to be processed. The classification results are coordinated by the network layer weights, making the acquisition of account classification results more interpretable. This allows for more accurate prediction of the account operation status of the first account in the future. While avoiding affecting the operation process of users, it can also improve the targeting of the account management platform for the first account, reduce the management risk of the account management platform, and ensure the user experience of more users under the account management platform.
[0095] In an optional embodiment, the pre-trained at least two perceptron network layers include a trained first perceptron network layer and a trained second perceptron network layer. The first perceptron network layer is trained using a sample dataset to obtain the trained first perceptron network layer. Based on the trained first perceptron network layer, the second perceptron network layer is further trained using the sample dataset, thereby performing classification prediction on the account data with the help of the trained first and second perceptron network layers. (Illustrative example, as shown...) Figure 3 As shown above, Figure 3 The illustrated embodiments may also include steps 310 to 340.
[0096] Step 310: Obtain the sample dataset.
[0097] The sample dataset is used to train the data classification model. The data classification model includes at least two trained perceptron network layers; therefore, the sample dataset is used to train at least two perceptron networks to obtain at least two trained perceptron network layers.
[0098] Optionally, the sample dataset includes multiple sample data, each of which is labeled with a sample label, which is used to characterize the category to which the sample data belongs.
[0099] When the classification prediction scenario is different, the sample dataset is usually different as well. For example, in the scenario of risk management and credit assessment, sample dataset 1 is selected, and the sample labels of the sample data in the sample dataset represent "default category" or "non-default category", etc.
[0100] If the sample dataset is a binary classification dataset, the sample labels of the sample data in the sample dataset are usually divided into two cases, such as positive sample labels and negative sample labels; the sample data can also be divided into positive sample data (sample data labeled with positive sample labels) and negative sample data (sample data labeled with negative sample labels).
[0101] For example, in risk management and credit assessment scenarios, positive sample data consists of account data corresponding to non-defaulting accounts, with a corresponding positive sample label (non-default category); negative sample data consists of account data corresponding to defaulting accounts, with a corresponding negative sample label (default category); or, positive sample data consists of account data corresponding to defaulting accounts, with a corresponding positive sample label (default category); negative sample data consists of account data corresponding to non-defaulting accounts, with a corresponding negative sample label (non-default category), etc., without limitation here.
[0102] In some embodiments, a public dataset is selected as the sample dataset. The public dataset is a dataset that is publicly available in the domain targeted by the classification prediction and can usually be obtained from public websites or public databases.
[0103] In some embodiments, considering that directly selecting a public dataset as the sample dataset may lead to data imbalance, such as a significant number of positive samples outnumbering negative samples, the positive samples would be the majority class and the negative samples the minority class; or vice versa. For example, there might be far more samples in the "no breach" category than in the "breach" category (i.e., more users are using the "no breach" category). Based on this, multiple extended sample datasets similar to the minority class sample datasets are generated, and these extended sample datasets are also labeled with the minority class sample labels (e.g., if the minority class sample datasets are negative, the generated extended sample datasets are labeled with negative labels). Then, these extended sample datasets and the public dataset are aggregated to obtain the sample dataset. This sample dataset effectively addresses the data imbalance problem, allowing the model to be trained and improving the robustness of the data classification model.
[0104] Step 320: Train the first perceptron network layer using the first sample data in the sample dataset to obtain the trained first perceptron network layer.
[0105] Schematic, the first perceptron network layer is any one or more of the at least two perceptron network layers that constitute the data classification model.
[0106] Optionally, the first perceptron network layer can be any one of at least two perceptron network layers, or it can be multiple perceptron network layers from at least two perceptron network layers. When the first perceptron network layer is a single perceptron network layer, it is trained using the first sample data. When the first perceptron network layer is multiple perceptron network layers (e.g., five perceptron network layers are grouped together, and five perceptron network layers are trained at once), the multiple perceptron network layers are trained in parallel using the first sample data, or each perceptron network layer is trained sequentially using the first sample data, etc., without any limitation here.
[0107] For illustrative purposes, the first sample data is the sample data in the sample dataset.
[0108] Optionally, the first sample data is all the sample data in the sample dataset; the first perceptron network layer is trained using all the sample data to obtain the trained first perceptron network layer.
[0109] Optionally, the first sample data is a portion of the sample data in the sample dataset.
[0110] For illustrative purposes, a preset number of sample data is randomly selected from the sample dataset as the first sample data, such as 70% of the sample data in the sample dataset.
[0111] In an optional embodiment, weighted sampling is performed on at least two sample data based on the sample weights corresponding to at least two sample data in the sample dataset to obtain at least one sample data as the first sample data.
[0112] Among them, sample weights are used to characterize the influence of sample data on the training of perceptron network layers.
[0113] As an illustration, the sample data in the sample dataset is labeled with sample weights. Sample weights are used to characterize the degree of influence of sample data on the training process of the data classification model. They are used to help focus on the difficult-to-classify sample data during training and reduce attention to other sample data.
[0114] For example, the weight of each sample data is a pre-assigned weight value; or, the weight of each sample data is a weight value learned during the training of the data classification model based on a preset value; or, the weight of each sample data is a weight value determined based on the importance of the sample data, etc.
[0115] Optionally, sample weights can be taken as an example, where the weights are determined based on the importance of the sample data.
[0116] As an illustration, the sample weight is determined based on the update frequency of the sample data. For example, if the sample data records the operation of the second account in a historical time period, the sample weight is set to be larger if the sample data is updated frequently (i.e., the update frequency is high) and smaller if the sample data is not updated frequently (i.e., the update frequency is low).
[0117] For illustrative purposes, the sample weight is determined based on the account attributes of the sample account corresponding to the sample data. Account attributes include at least one of several, such as account level, account registration duration, and account value. For example, if the sample data records the operation of the second account in a historical time period, and the second account has a higher account level, then the sample weight of the sample data is set to be larger; or, if the second account has a higher account value, then the sample weight of the sample data is set to be larger, etc. There are no restrictions here.
[0118] Optionally, weighted sampling is performed on the sample dataset based on the sample weights to obtain a preset number of sample data as the first sample data.
[0119] Weighted sampling is a data sampling method in which the probability of a sample being selected is determined by the sample weight. Therefore, the sample weight determines the probability of a sample being selected. The larger the sample weight, the greater the probability that the sample is selected as the first sample, and the smaller the sample weight, the smaller the probability that the sample is selected as the first sample.
[0120] In some embodiments, the sample dataset is used to train at least two perceptron network layers sequentially.
[0121] Indicatively, at least two perceptron network layers in the data classification model are connected in series; when training the perceptron network layers using a sample dataset, at least one sample data from the sample dataset is used sequentially as the sample data for training at least two perceptron network layers.
[0122] In some embodiments, when training the i-th perceptron network layer, the weights of the i-th sample corresponding to at least two sample data are determined respectively.
[0123] Where i is a positive integer. Illustratively, the i-th perceptron network layer is any one of at least two perceptron network layers; the weights of the i-th samples corresponding to at least two sample data points may be the same or different, or some sample data points may have the same weights while the remaining sample data points have different weights, etc.
[0124] Optionally, when i=1, it represents training the first perceptron network layer. If the initial sample weights are preset weight values, the first sample weights corresponding to at least two sample data are usually set to be the same. As the training of the perceptron network layer changes, the sample weights corresponding to different sample data are adjusted accordingly, which will be introduced later.
[0125] In some embodiments, weighted sampling is performed on at least two sample data based on the weight of the i-th sample to obtain the first sample data used in the training of the i-th perceptron network layer from the sample dataset.
[0126] Indicatively, during the training of the i-th perceptron network layer, the probability of selecting at least two sample data points is determined by the weights of the i-th sample corresponding to at least two sample data points, thereby selecting the first sample data point through weighted sampling.
[0127] In other words, when training different perceptron network layers, the first sample data selected may be the same, different, or partially the same and partially different; this is not limited here.
[0128] In an optional embodiment, a first perceptron network layer in at least two network layers is trained using the first sample data to obtain the trained first perceptron network layer.
[0129] In illustrative terms, after determining at least one sample data as the first sample data based on the extraction method, a first perceptron network layer is trained using the first sample data. During the training of the first perceptron network layer, the first perceptron network layer predicts the first data category corresponding to the first sample data (i.e., the prediction result), and trains the first perceptron network layer using the difference between the first data category and the sample label corresponding to the first sample data (i.e., the true result). For example, the first perceptron network layer can be trained using the loss value between the first data category and the sample label, and the trained first perceptron network layer is obtained when the loss value converges.
[0130] Step 330: Predict the data category of the second sample data through the trained first perceptron network layer to obtain the prediction result.
[0131] For illustrative purposes, the second sample data is sample data from the sample dataset.
[0132] Optionally, the second sample data is all the sample data in the sample dataset; the data category of each sample data in the all sample data is predicted by the first perceptron network layer after training, so as to obtain the prediction results corresponding to all sample data respectively.
[0133] Optionally, the second sample data is a portion of the sample dataset. Illustratively, other sample data besides the first sample data may be used as the second sample data; or, a portion of the first sample data (such as randomly selected data) and other sample data may be used as the second sample data, etc., without limitation here.
[0134] The second sample data is labeled with sample tags.
[0135] Illustratively, sample labels are identifiers used to uniquely represent sample data, and are typically used in classification prediction to represent the true category of the sample data; each second sample data is labeled with a sample label as a way to measure the accuracy of the category prediction of the first perceptron network layer after training.
[0136] The second sample data corresponds to the weight of the first sample.
[0137] In illustrative terms, sample weights are used to characterize the influence of sample data on the training of the perceptron network layer. The first sample weight serves as the sample weight corresponding to the second sample data, representing the influence of the second sample data on the training of the perceptron network layer.
[0138] In some embodiments, the data category of at least one second sample data is predicted by the i-th trained perceptron network layer, thereby obtaining the prediction results corresponding to at least one second sample data.
[0139] The first sample weight corresponding to the second sample data is the sample weight learned after training the (i-1)th perceptron network layer, where i is a positive integer. When predicting the data category of at least one second sample data through the first trained perceptron network layer, the first sample weight corresponding to the second sample data is the initially set sample weight; when predicting the data category of at least one second sample data through the second trained perceptron network layer, the first sample weight corresponding to the second sample data is the sample weight learned after training the first perceptron network layer.
[0140] Step 340: Based on the difference between the prediction result and the sample label, determine the second sample weight corresponding to the second sample data during the training of the second perceptron network layer.
[0141] Indicatively, each second sample data point corresponds to a prediction result and a sample label. The prediction result and sample label corresponding to the same second sample data point are compared to determine the difference between the two, thereby analyzing the second sample weight corresponding to each second sample data point.
[0142] In this process, at least one second sample data with a second sample weight is used to train the trained second perceptron network layer.
[0143] Optionally, the second perceptron network layer can be any one of at least two perceptron network layers, or it can be multiple perceptron network layers from at least two perceptron network layers. When the second perceptron network layer is a single perceptron network layer, it is trained using at least one second sample data with second sample weights. When the second perceptron network layer is multiple perceptron network layers (e.g., five perceptron network layers form a group, and after training five first perceptron network layers in a single run, five second perceptron network layers are trained), the multiple perceptron network layers are trained in parallel using at least one second sample data with second sample weights, or each perceptron network layer is trained sequentially using at least one second sample data with second sample weights, etc., without limitation here.
[0144] This is illustrated by determining the difference between the prediction result and the sample label corresponding to the same second sample data, which is used to adjust the current first sample weight of the second sample data. Since the first sample weight is used to characterize the training influence of the second sample data on the perceptron network layer, the purpose of adjusting the first sample weight is to change the training influence of the second sample data on the perceptron network layer. For example, for any second sample data 1, if the first sample weight is increased to obtain the second sample weight, it means that the second sample data 1 has a greater training influence on the next perceptron network layer (such as the second perceptron network layer); or, for any second sample data 2, if the first sample weight is decreased to obtain the second sample weight, it means that the second sample data 2 has a smaller training influence on the next perceptron network layer (such as the second perceptron network layer).
[0145] In an optional embodiment, the weighted learning error rate corresponding to the first perceptron network layer is obtained based on the difference between the prediction result and the sample label.
[0146] The weighted learning error rate is used to characterize the category prediction performance of the perceptron network layer. Illustratively, during the training of the perceptron network layer, the learning error rate is an important metric for measuring the difference between the predicted result and the sample label.
[0147] Since there may be multiple second sample data, there will also be differences between the prediction results corresponding to the second sample data and the corresponding sample labels; the weighted learning error rate is an indicator that adjusts the influence of sample data in the overall training by combining the sample weights of the sample data.
[0148] In some embodiments, the i-th weighted learning error rate is obtained based on the difference between the prediction result and the sample label.
[0149] Here, the i-th weighted learning error rate is used to characterize the category prediction performance of the i-th perceptron network layer, where i is a positive integer.
[0150] To illustrate, for any i-th perceptron network layer, the i-th weighted learning error rate during the training process of the i-th perceptron network layer is obtained by the difference between the prediction result and the sample label.
[0151] Optionally, the formula for calculating the weighted learning error rate is shown in Formula 1 below.
[0152] Formula 1:
[0153]
[0154] Among them, e k It is the weighted learning error rate of the perceptron network layer; w i It is sample data x i The sample weights; I(h) k (x i ()≠yi) is an indicator function, when the prediction result h k (x i ) and sample data x i Corresponding sample label y i If the values are different, the return value is 1; otherwise, the return value is 0. N is the total number of the second sample data.
[0155] In an optional embodiment, the network layer weights corresponding to the first perceptron network layer are obtained based on the weighted learning error rate.
[0156] The network layer weights characterize the classification influence of the perceptron network layer, representing its importance in the data classification model's data classification prediction. Different perceptron network layers correspond to different network layer weights to measure their importance.
[0157] Optionally, the network layer weights are parameters obtained based on the weighted learning error rate, as shown in Formula 2 below.
[0158] Formula 2:
[0159]
[0160] Among them, e k It is the weighted learning error rate of the perceptron network layer; ln is the natural logarithm; α k These are network layer weights.
[0161] As shown in Formulas 1 and 2 above, there is a negative correlation between network layer weights and the weighted learning error rate. That is, when the weighted learning error rate e... kWhen the value is relatively small (i.e., the class prediction of the perceptron network layer is relatively accurate), the network layer weight α... k Larger; conversely, when the weighted learning error rate e k When the value is large (i.e., the class prediction of the perceptron network layer is not very accurate), the network layer weight α k Smaller.
[0162] In some embodiments, the network layer weights corresponding to the i-th perceptron network layer are obtained based on the i-th weighted learning error rate.
[0163] To illustrate, for any i-th perceptron network layer, the network layer weights corresponding to the i-th perceptron network layer are calculated using the i-th weighted learning error rate corresponding to the i-th perceptron network layer and the above formula 2.
[0164] In an optional embodiment, the first sample weights are adjusted by the network layer weights corresponding to the first perceptron network layer to obtain the second sample weights corresponding to the sample data during the training of the second perceptron network layer.
[0165] As an illustration, after training each perceptron network layer, the weights of the sample data are adjusted based on the current perceptron network layer's weights. The weights of correctly classified samples decrease, while the weights of misclassified samples increase.
[0166] w′ i ←w j ·exp(-α k y i h k (x i ))
[0167] Among them, w i ′ The second sample data x obtained after the update i The second sample weights; w i The second sample data x before the update i The first sample weight; α k These are the network layer weights of the perceptron network layer; y i It is the second sample data x i The corresponding first sample label; h k (x i ) is the second sample data x i The corresponding prediction results.
[0168] In an optional embodiment, if the prediction result of the first perceptron network layer after training for the m-th second sample data is the same as the sample label corresponding to the m-th second sample data, the first sample weight corresponding to the m-th second sample data is reduced to obtain the second sample weight corresponding to the m-th second sample data.
[0169] Where m is a positive integer.
[0170] In illustrative terms, the m-th second sample data can be any second sample data. The trained first perceptron network layer performs classification prediction on the m-th second sample data, obtaining the prediction result corresponding to the m-th second sample data. The m-th second sample data corresponds to a sample label (such as the first sample label). If the prediction result corresponding to the m-th second sample data is the same as the sample label corresponding to the m-th second sample data, then the m-th second sample data has been accurately predicted. Since the purpose of training the network layer is to better learn sample data that cannot be accurately predicted, the weight of the first sample corresponding to the m-th second sample data can be reduced, thereby obtaining the second sample weight corresponding to the m-th second sample data.
[0171] At this point, the weight of the second sample corresponding to the m-th second sample is less than the weight of the first sample corresponding to the m-th second sample. This also means that subsequent learning based on the second sample weight requires reducing the focus on the m-th second sample.
[0172] In an optional embodiment, if the prediction result of the first perceptron network layer after training for the m-th second sample data is the same as the sample label corresponding to the m-th second sample data, the first sample weight corresponding to the m-th second sample data is increased to obtain the second sample weight corresponding to the m-th second sample data.
[0173] For illustrative purposes, the m-th second sample data can be any second sample data. If the prediction result corresponding to the m-th second sample data is different from the sample label corresponding to the m-th second sample data, then the m-th second sample data has not been accurately predicted. Since the purpose of training the network layer is to better learn the sample data that cannot be accurately predicted, the weight of the first sample corresponding to the m-th second sample data can be increased to obtain the weight of the second sample corresponding to the m-th second sample data.
[0174] At this point, the weight of the second sample corresponding to the m-th second sample data is greater than the weight of the first sample corresponding to the m-th second sample data; this also means that, based on the weight of the second sample data, we need to increase our attention to the learning of the m-th second sample data.
[0175] In an optional embodiment, when the preset number of first perceptron network layers trained in succession meets the preset training conditions, the number of perceptron network layers in the first perceptron network layer group is increased to obtain a second perceptron network layer group; then the second perceptron network layer group is trained.
[0176] Schematic, the first perceptron network layer group includes at least one perceptron network layer, such as each first perceptron network layer group including 1 perceptron network layer, or each first perceptron network layer group including 5 perceptron network layers, etc.; if the first perceptron network layer group trained continuously for a preset number (such as 3) meets the preset training conditions (such as loss value convergence), the number of perceptron network layers in the first perceptron network layer group is increased to obtain the second perceptron network layer group, such as the second perceptron network layer group including 8 perceptron network layers, so that more perceptron network layers can be trained at once, etc., without limitation here.
[0177] It is worth noting that the above are merely illustrative examples, and the embodiments of this application are not limited thereto.
[0178] In one optional embodiment, taking the process of predicting data categories as a binary classification problem as an example, the sample labels of the sample data can be divided into two categories: positive and negative. Accordingly, there are four possible outcomes during classification prediction.
[0179] 1. True Positive (TP): This means that the sample label is positive and the prediction result is also positive.
[0180] 2. True Negative (TN): This means that the sample label is negative and the prediction result is also negative.
[0181] 3. False Positive (FP): This means that the sample label is actually negative, but the prediction result is positive.
[0182] 4. False Negative (FN): This means that the sample label is actually positive, but the prediction result is negative.
[0183] To more intuitively view the classification prediction results, the confusion matrix was obtained by statistically analyzing the prediction results of the above four categories; the confusion matrix for the binary classification problem is shown in Table 1 below.
[0184] Table 1
[0185]
[0186]
[0187] The confusion matrix shown in Table 1 lists the final statistical results of a binary classification prediction. Generally, accuracy measures the overall prediction performance. However, in imbalanced datasets, due to the significant difference in the proportion of positive and negative samples (typically, the number of positive samples is much greater than the number of negative samples, such as non-defaulting users being much larger than defaulting users), accuracy cannot accurately evaluate the prediction performance.
[0188] In extreme cases, when the majority class accounts for 90% of all samples in an imbalanced dataset, while the minority class accounts for only 10%, if the model learns information from 90% of the majority class samples during training, but not from the 10% of the minority class samples, the model accuracy reaches 90%. However, the data classification model has not actually achieved its classification prediction purpose. Therefore, accuracy cannot be used to evaluate imbalanced datasets.
[0189] In this embodiment of the application, in order to comprehensively evaluate the overall predictive ability of the data classification model, five indicators derived from the confusion matrix will be used to evaluate the data classification model: accuracy, precision, recall, F1 score, and Matthews Correlation Coefficient (MCC). Among them, there is a negative correlation between precision and recall, where one increases and the other decreases.
[0190] (1) Accuracy.
[0191] The formula for calculating accuracy is shown in Formula 3 below. Accuracy is the ratio between the number of samples accurately predicted by the data classification model and the total number of samples predicted, representing how many samples are accurately predicted out of all predicted samples.
[0192] Formula 3:
[0193]
[0194] (2) Precision.
[0195] The precision is calculated using Formula 4 below. Precision represents the proportion of sample data predicted as positive whose actual label (true value) is also positive.
[0196] Formula 4:
[0197]
[0198] (3) Recall.
[0199] Recall, also known as the full coverage rate, is shown in Formula 5 below. Recall represents the proportion of samples whose labels are positive that are accurately predicted by the data classification model.
[0200] Formula 5:
[0201]
[0202] (4) F1 score.
[0203] Because precision and recall have an inverse, competitive relationship, an improvement in the precision of a data classification model will lead to a decrease in its recall, and vice versa. Therefore, considering the trade-off between the two metrics, a balance is achieved by calculating the harmonic mean of the two metrics, which is shown in Formula 6 below. A poor precision or recall will result in a poor F1 score; only when both precision and recall perform well will the F1 score be relatively high.
[0204] The formula for the F1 score is shown in Formula Six below.
[0205] Formula Six:
[0206]
[0207] (5) Matthews correlation coefficient.
[0208] The F1 score, which combines precision and recall, provides a relatively good reflection of the predictive performance of a data classification model. However, it can fluctuate significantly due to changes in the number of positive class samples. The Matthews correlation coefficient, on the other hand, is particularly suitable for handling imbalanced datasets. As shown in Formula 7, its calculation considers four metrics: true positive, true negative, false positive, and false negative. The calculation is more complex, and the Matthews correlation coefficient ranges from -1 to 1. A value of 1 indicates perfect prediction, -1 indicates a prediction completely inconsistent with the sample label, and 0 indicates random prediction. In practice, a value greater than 0.5 is generally considered to indicate good predictive performance, and the Matthews correlation coefficient is often considered the unbiased version of the F1 score.
[0209] Formula 7:
[0210]
[0211] It is worth noting that the above are merely illustrative examples, and the embodiments of this application are not limited thereto.
[0212] In summary, by using at least two pre-trained perceptron network layers as the network layers for classifying and predicting account data, the classification process can be clarified by using at least two perceptron network layers while ensuring a relatively small amount of data to be processed. The classification results are coordinated by the network layer weights, making the acquisition of account classification results more interpretable. This allows for more accurate prediction of the account operation status of the first account in the future. While avoiding affecting the operation process of users, it can also improve the targeting of the account management platform for the first account, reduce the management risk of the account management platform, and ensure the user experience of more users under the account management platform.
[0213] This application describes the construction of a data classification model using a perceptron network layer. The perceptron network layer has a simple structure and low computational cost, enabling efficient processing during training and inference, thus making the acquisition of data classification results more efficient. Furthermore, the perceptron network layer achieves decision classification through weighted summation, efficiently and accurately completing classification tasks in binary classification problems. Considering that the data classification model applied to credit analysis scenarios also exhibits good recall, it can effectively recall accounts that meet recall requirements (such as defaulters), improving the targeting of account screening, avoiding overlooking insecure accounts, and enhancing the security of the account operation platform.
[0214] In an optional embodiment, considering the potential data imbalance issue if the public dataset is directly used as the sample dataset, such as a smaller number of samples labeled as defaulters (minority class samples) and a larger number of samples labeled as non-defaulters (majority class samples), a balanced sample dataset can be constructed by generating minority class samples after obtaining the first imbalanced dataset (such as the public dataset). This sample data can then be used to train the perceptron network layers. (Illustrative example follows.) Figure 4 As shown above, Figure 3 Step 310 shown can also be implemented as steps 410 to 440.
[0215] Step 410: Obtain the first dataset.
[0216] Optionally, the first dataset is a publicly available dataset obtained from a public website. The first dataset includes a first number of positive samples and a second number of negative samples, where the first number is less than the second number, and the negative samples are labeled with different negative labels than the positive samples.
[0217] For illustrative purposes, the first dataset is an imbalanced dataset, such as the first number being much smaller than the second number. Optionally, taking a risk management and credit assessment scenario as an example, the first number of positive sample data consists of account data of defaulting accounts, and the second number of negative sample data consists of account data of non-defaulting accounts. The positive sample data is labeled with the positive sample label "default type", and the negative sample data is labeled with the negative sample label "non-default type".
[0218] Step 420: Based on the data association relationships between the first number of positive sample data, obtain the data cluster centers corresponding to the positive sample data.
[0219] To illustrate, considering the limited number of positive samples, directly training the data classification model using the first dataset may cause the model to overfit to the majority class (i.e., the larger number of negative samples) and ignore the minority class (i.e., the smaller number of positive samples), thereby reducing the model's prediction performance on the minority class.
[0220] Based on this, a balanced sample dataset can be obtained by generating data labeled with positive sample labels (such as extended sample data) and adding it to the first dataset.
[0221] Considering that the generated data labeled with positive samples has a higher similarity to the positive sample data in the first dataset, the cluster center corresponding to the positive sample data can be obtained based on the data association relationship between the first number of positive sample data.
[0222] Indicatively, the cluster center is the center point of the first number of positive samples, representing the average position of the first number of positive samples, and can most effectively represent the overall characteristics of the first number of positive samples.
[0223] Optionally, the positive sample feature representations corresponding to the first number of positive sample data are extracted, and the data cluster centers are determined from the vector space by calculating the average value of the first number of positive sample feature representations. The first number of positive sample feature representations correspond one-to-one with the first number of positive sample data.
[0224] Step 430: Under the constraint of the data difference relationship between the data cluster center and the second number of negative sample data, generate extended sample data labeled with positive sample labels around the data cluster center.
[0225] To illustrate, in order to avoid ignoring negative sample data that is opposite to the positive sample data during the process of generating extended sample data labeled with positive sample labels around the data cluster center, the data difference relationship between the data cluster center and the second number of negative sample data can also be considered to avoid generating data that is more consistent with the negative sample labels.
[0226] The expanded sample data is used to balance the difference in the number of negative and positive sample data in the first dataset.
[0227] To illustrate, since the extended sample data is generated based on the first number of positive sample data and labeled with positive sample labels, the extended sample data can be regarded as positive sample data. The extended sample data is added to the first dataset, thereby increasing the number of positive sample data and reducing the difference in the number of negative sample data and positive sample data.
[0228] In an optional embodiment, a distance threshold is obtained based on the first interval distances corresponding to the second number of negative sample data and the data cluster centers, respectively.
[0229] The first interval distance is used to characterize the data difference relationship between the data cluster centers and the negative sample data.
[0230] Indicatively, the first interval distance between each negative sample data point and the data cluster center is determined, resulting in the first interval distances corresponding to a second number of negative sample data points. By combining these second number of first interval distances, an example threshold representing the data difference relationship between the data cluster centers and the negative sample data can be obtained.
[0231] In some embodiments, a first interval distance corresponding to a second number of negative sample data is obtained; the average distance of the second number of first interval distances is obtained as a distance threshold.
[0232] To illustrate, the average distance of the first interval is calculated for the second number of intervals to obtain the distance threshold.
[0233] In some embodiments, a weighted average is performed on the second number of first interval distances to obtain a distance threshold.
[0234] Indicatively, the sample reference weights corresponding to the second number of negative sample data are determined. The sample reference weights are determined based on the operation frequency indicated by the negative sample data. For example, if a negative sample data indicates that an account has a high operation frequency (such as logging in multiple times in one day), then a higher sample reference weight is set for that negative sample data.
[0235] Indicatively, in the process of obtaining the distance threshold based on the first interval distance of the second quantity, the distance threshold is obtained by combining the sample reference weights corresponding to each negative sample data and the first interval distance corresponding to the negative sample data, and using a weighted average method.
[0236] In an optional embodiment, a third number of negative sample data is obtained by filtering from a first number of negative sample data based on a distance threshold.
[0237] The third quantity is no greater than the first quantity.
[0238] Schematic, the distance threshold characterizes the data difference relationship between the data cluster center and the second number of negative sample data; if the first interval distance between the negative sample data and the data cluster center is less than (or less than or equal to) the distance threshold, it means that the difference between the negative sample data and the data cluster center is small and the correlation is large; if the first interval distance between the negative sample data and the data cluster center is not less than (or greater than) the distance threshold, it means that the difference between the negative sample data and the data cluster center is large and the correlation is small.
[0239] In some embodiments, a second interval distance is obtained between a first number of positive sample data and the data cluster center, respectively.
[0240] The second interval distance is used to characterize the data association relationship between positive sample data and data cluster centers. Illustratively, the interval distance between a first number of positive sample data and data cluster centers is analyzed separately to determine the second interval distance corresponding to each of the first number of positive sample data.
[0241] Optionally, from the perspective of vector space analysis, the positive sample feature representations corresponding to the first number of positive sample data are determined, and the interval distance between the positive sample feature representations and the data cluster centers in the vector space is taken as the second interval distance.
[0242] In some embodiments, a third number of positive sample data is obtained by filtering positive sample data from a first number of positive sample data where the second interval distance is not greater than a distance threshold.
[0243] Schematic, the distance threshold characterizes the data difference relationship between the data cluster centers and the second number of negative samples. If the second interval distance is not greater than the distance threshold, it means that the positive sample data is more strongly associated with the data cluster centers, and that the positive sample data is more consistent with the positive sample label; conversely, if the second interval distance is less than the distance threshold, it means that the positive sample data is less associated with the data cluster centers.
[0244] In a schematic way, positive sample data with a second interval distance not greater than the distance threshold are filtered out from the first number of positive sample data to obtain the third number of positive sample data; the third number of positive sample data is usually a part of the positive sample data in the first number of positive sample data.
[0245] In an optional embodiment, based on a third number of positive sample data and data cluster centers, extended sample data labeled with positive sample tags is generated around the data cluster centers.
[0246] As an illustration, since the third number of positive sample data is more consistent with the positive sample label, the third number of positive sample data is used as the data generation constraint, thereby generating extended sample data labeled with positive sample labels around the data cluster center.
[0247] In some embodiments, for any one of the positive sample data in the third number of positive sample data, interpolation is performed between the positive sample data and the data cluster center to obtain at least one extended sample data.
[0248] To illustrate, taking the generation of extended sample data based on vector space as an example, for any positive sample data in the third number of positive sample data, the positive sample feature representation corresponding to the positive sample data is determined, and interpolation is performed between the positive sample feature representation and the data cluster center; the interpolation is a way to generate new data points by "inserting" or "filling" between two points in the vector space.
[0249] When performing interpolation between positive sample feature representations and data cluster centers, at least one extended sample can be randomly generated in the middle, or at least one extended sample can be generated closer to the data cluster centers. Applying interpolation between a third number of positive samples and data cluster centers yields more extended sample data, which are labeled with positive sample tags and can reflect the data information expressed by the positive sample data in a similar manner.
[0250] Step 440: Add the extended sample data to the first dataset to obtain the sample dataset.
[0251] To illustrate, extended sample data generated around the cluster centers corresponding to the positive sample data are added to the first dataset. In this case, the extended sample data based on the labeled positive sample data can also be considered positive sample data. Therefore, compared to the first dataset, the sample dataset contains more positive sample data labeled with positive sample labels, and also contains a significant number of negative sample data labeled with negative sample labels, resulting in a more balanced distribution of data across different categories.
[0252] Optionally, the data classification model described above can be obtained by training a sample dataset, that is, by training at least two perceptron network layers on the sample dataset to obtain the trained perceptron network layers. This allows the data classification model to learn more comprehensive and balanced information, avoids the prediction bias problem of the majority class sample data, and improves the generalization ability and prediction accuracy of the data classification model for the data that needs to be predicted later.
[0253] It is worth noting that the above are merely illustrative examples, and the embodiments of this application are not limited thereto.
[0254] In summary, by using at least two pre-trained perceptron network layers as the network layers for classifying and predicting account data, the classification process can be clarified by using at least two perceptron network layers while ensuring a relatively small amount of data to be processed. The classification results are coordinated by the network layer weights, making the acquisition of account classification results more interpretable. This allows for more accurate prediction of the account operation status of the first account in the future. While avoiding affecting the operation process of users, it can also improve the targeting of the account management platform for the first account, reduce the management risk of the account management platform, and ensure the user experience of more users under the account management platform.
[0255] This application describes how to generate expanded sample data based on minority class positive sample data to obtain a balanced sample dataset. Considering that the minority class sample data in the publicly available first dataset results in insufficient information learned during model training, expanding the minority class positive sample data effectively balances the quantity of sample data across classes, preventing the model from favoring the majority class sample data and thus improving the prediction accuracy of the minority class. Using a distance threshold determined by the data difference relationship between the data cluster centers and negative sample data as a constraint, expanded sample data that better matches the positive sample labels can be generated around the data cluster centers, improving the quality of the generated expanded sample data and thus enhancing the quality of the sample dataset. The balanced sample dataset significantly increases the diversity of the sample data, allowing the model to learn more latent features during training, enhancing the model's generalization ability and robustness, and reducing the risk of overfitting.
[0256] In an optional embodiment, the above data classification method is applied to the financial industry in risk management and credit assessment scenarios, such as assessing and predicting the creditworthiness of users (e.g., predicting whether users will default or not in the future); the above data classification method can also be called a credit risk prediction method.
[0257] This illustrates how societal development has led to a shift in consumer attitudes. Driven by various factors, a wide range of financial products have become readily available, presenting both opportunities and challenges for the financial industry. Low default rates are increasingly becoming a key risk control objective. Therefore, introducing appropriate machine learning methods to improve risk control systems can help relevant departments identify potential default risks in advance and facilitate proactive risk control measures, thereby promoting the healthy development of the financial market.
[0258] In some embodiments, the training process is carried out by predicting sample data during the training of a data classification model, and the sample data comes from a sample dataset. Considering that if a public dataset is directly used as the sample dataset, there is often an imbalance between the number of majority class (e.g., positive class) sample data and minority class (e.g., negative class) sample data in the public dataset, it is necessary to first balance the number of sample data to obtain a sample dataset for training the data classification model; in addition, the model architecture of the data classification model is also crucial, and the following two parts are explained.
[0259] (a) Obtaining the sample dataset.
[0260] To illustrate how to address the data imbalance problem, an improved oversampling method is proposed. This method uses the center of the minority class sample data as a reference point and divides all minority class sample data into safe points and noise points based on their distance from the central reference point. Then, along the line connecting the central reference point and the safe points, more minority class sample data are generated through random interpolation, thereby achieving the goal of balancing the data volume and obtaining a sample dataset.
[0261] Optionally, the distance threshold for distinguishing between safe points and noise points is the average distance from the central reference point of the majority class sample data to the minority class sample data; minority class sample data that is less than this distance threshold is regarded as safe points, and conversely, minority class sample data that is greater than or equal to this distance threshold is regarded as noise points.
[0262] The improved oversampling method described above avoids blurring the data boundaries between the majority and minority class samples, and eliminates the need for tuning other parameters, such as determining the optimal number of nearest neighbors required in traditional oversampling methods. Compared to traditional oversampling techniques that synthesize minority class samples, this method addresses imbalanced data by obtaining a balanced dataset, which helps the data classification model achieve better predictive performance.
[0263] (II) Model architecture of data classification model.
[0264] Indicatively, an innovative adaptive boosting ensemble algorithm (AdaBoost) is proposed in the modeling approach. It uses a perceptron network layer as the base classifier and combines 100 perceptron networks through an algorithm to create a strong learner as the model architecture for the data classification model. This data classification model can also be called the Perceptron-AdaBoost model.
[0265] Given that the core task of credit forecasting is to identify as many low-credit (default) adversaries as possible, and that recall among the five metrics mentioned above measures the proportion of "negative class sample data" correctly identified by the model out of all real "negative class sample data" (i.e., the proportion of no missed cases), recall has a more significant meaning in credit forecasting.
[0266] Optionally, to compare and demonstrate the model classification effect of the data classification model provided in the embodiments of this application, an LR-AdaBoost model is additionally constructed, which uses the traditional logistic regression (LR) model as the base classifier and combines it with the AdaBoost algorithm. The data classification model with the perceptron network layer as the base classifier is compared with the LR-AdaBoost model, and each is trained using a balanced sample dataset.
[0267] like Figure 5 The diagram shows a flowchart of a comparative analysis of a data classification model and a logistic regression model based on a perceptron network layer.
[0268] Step 510, data preprocessing.
[0269] To illustrate, data preprocessing involves cleaning and feature selection of the data in the original first dataset to extract useful information.
[0270] Step 520: Balance the sample dataset using an improved oversampling method.
[0271] Illustratively, the improved oversampling method described above for generating extended sample data is used to balance the sample dataset (i.e., to improve the data imbalance problem of the first dataset and obtain the sample dataset).
[0272] Indicatively, a central reference point (the data cluster center mentioned above) is determined based on minority class sample data; minority class sample data is divided into safe points and noise points according to the distance between the minority class sample data and the central reference point (data cluster center); the distance threshold for dividing safe points and noise points is determined based on the average distance between the majority class sample data and the central reference point; and the sample dataset is balanced by random interpolation on the line connecting the central reference point and the safe points.
[0273] Step 530: Construct the LR-AdaBoost model 531, and construct the data classification model based on the perceptron network layer 532.
[0274] Schematic illustration: A data classification model based on a perceptron network layer is constructed using a perceptron as the base classifier (perceptron network layer) and combined with the AdaBoost algorithm 532. An LR-AdaBoost model is constructed using a logistic regression model as the base classifier and combined with the AdaBoost algorithm 531.
[0275] Step 540, Model Training and Evaluation.
[0276] This is illustrative of how model training and evaluation achieve the goal of training a data classification model 532 based on a perceptron network layer and an LR-AdaBoost model 531.
[0277] Optionally, during training, the data classification model 532 and the LR-AdaBoost model 531 can be trained using the aforementioned sample datasets, respectively; or, during training, the traditional Synthetic Minority Over-sampling Technique (SMOTE) can be used to obtain sample dataset 1, and the improved oversampling method described above for generating extended sample data can be used to obtain sample dataset 2; the LR-AdaBoost model 531 can be trained using sample dataset 1, and the data classification model 532 can be trained using sample dataset 2, etc., without limitation here.
[0278] Step 550: Compare model performance.
[0279] To illustrate, after the model is trained, data classification prediction will also be performed based on the trained model, that is, classification prediction will be performed through the trained data classification model 532 and through the trained LR-AdaBoost model 531.
[0280] Step 560: Select the best model.
[0281] This example illustrates the selection of the best model by comparing model performance. Optionally, the performance of different models may be compared, including at least one metric such as recall, F1 score, and Matthews correlation coefficient.
[0282] Then, based on model performance and the use case of the data classification model, the model most suitable for the actual business scenario is selected. For example, in risk management and credit assessment scenarios, recall is more important, so a model with higher recall should be selected as the best model.
[0283] like Figure 6 As shown, Figure 5A detailed diagram illustrates the calculation of metrics such as accuracy, precision, recall, F1 score, and Matthews correlation coefficient. The goal of these calculations is to compare model performance (610) between a data classification model based on a perceptron network layer and an LR-AdaBoost model, selecting the best model by comparing these metrics. Furthermore, it explains the use of an improved oversampling method to balance the sample dataset (620) by separating minority class samples into safe points and noise points, determining distance thresholds for comparison with safe and noise points, and then balancing the sample dataset along the line connecting the central reference point and the safe point using random interpolation.
[0284] In some embodiments, gradient boosting decision tree (GBDT) models and extreme gradient boosting (XGBoost) models can be additionally constructed, and the above models can be trained with sample datasets to compare the model classification performance of the data classification models.
[0285] In an optional embodiment, the above-described method of using a perceptron network layer as a base classifier to construct and train a data classification model is explained as follows: Using a single perceptron network model as a base classifier yields an ensemble model (data classification model) with perceptrons as basis vectors. The algorithm steps are as follows: Figure 7 And as shown below.
[0286] In the process of training the data classification model using the balanced sample dataset 710 obtained after generating the extended sample data as described above, the sample dataset includes n sample data; each of the n sample data is labeled with a sample weight, and the data classification model includes multiple cascaded perceptron network layers. The sample dataset is used to train multiple perceptron network layers sequentially.
[0287] (1) In the initial stage, the sample weights labeled by each of the n sample data are usually the same (e.g., sample weight D1). Then, weighted sampling is performed based on sample weight D1, and 70% of the sample data is extracted as the training set.
[0288] (2) Use 70% of the sample data as input data for the first perceptron network layer to train the first perceptron network layer and obtain the trained first perceptron network layer.
[0289] (3) Subsequently, the first perceptron network layer after training is used to perform classification prediction on all sample data in the sample dataset (i.e., including the 70% of sample data used for training and the 30% of sample data used for testing mentioned above), and the weighted learning error rate of the first perceptron network layer and the network layer weights are calculated based on the prediction results of the first perceptron network layer.
[0290] (4) Update the sample weights (e.g., sample weight D2) of each sample data in the sample dataset according to the calculated network layer weights; at this time, the sample weights corresponding to different sample data may be the same or different.
[0291] (5) Repeat steps (1) to (4) above until the preset T perceptron network layers are trained. T is a positive integer greater than 1, such as T = 100, which means that the data classification model includes 100 perceptron network layers.
[0292] (6) When applying the data classification model after training, that is, to determine the classification result corresponding to the account data by combining T trained perceptron network layers, the following strategy shown in Formula 8 can be used to combine the T trained perceptron network layers to achieve the purpose of classification prediction.
[0293] Formula 8:
[0294]
[0295] Where, f(x) i ) represents the prediction result for the data to be predicted (such as account data in the application phase or sample data in the training phase); sign is the sign function, returning 1 if the value in parentheses is an integer, 0 if the value in parentheses is 0, and -1 if the value in parentheses is negative; T is the number of perceptron network layers in the data classification model; α k These are the network layer weights of the perceptron network layer; k (x i ) is the data classification result of any perceptron network layer k for the data to be predicted (such as account data in the application stage or sample data in the training stage).
[0296] It is worth noting that the above are merely illustrative examples, and the embodiments of this application are not limited thereto.
[0297] In an optional embodiment, to verify the predictive performance of the data classification model, ten-fold cross-validation is used to calculate the model's predictive power. Ten-fold cross-validation can effectively avoid overfitting and underfitting problems in data classification models.
[0298] The 10-fold cross-validation method divides the sample dataset into 10 subsets. Each time, one subset is used as the test set, and the remaining nine subsets are used as the training set, allowing for 10 trials. In other words, each time a different subset is used as the test set, the remaining subsets are used as the training set to train the model, the test set is used to evaluate the model, and finally, the average of the 10 test results is used as the model's final prediction.
[0299] Indicative, such as Figure 8 The image shown is a schematic diagram illustrating the training process to obtain a data classification model.
[0300] Step 810: Initialize the number of perceptron network layers.
[0301] This is an illustrative example, where the number of perceptron network layers is initialized to 10 (n_estimators = 10), meaning that 10 perceptron network layers are initially built before the training process. The initial number of 10 is merely an illustrative example; other values such as 20 or 15 can also be set, and this is not a limitation here.
[0302] Step 820: Initialize the learning rate.
[0303] For illustrative purposes, the initial learning rate is set to 0.1 (learning_rate = 0.1); this initial value is merely an illustrative example and is not intended to be limiting.
[0304] Indicatively, the initial learning rate (usually a hyperparameter) is used to adjust the weight updates of each perceptron network layer. Its role is to control the step size of the perceptron network layer's updates to the data classification model during each training process. The learning rate is a parameter that controls the overall training speed of the model and determines the magnitude of the weight updates in each iteration. The introduction of the learning rate is to avoid overfitting and improve the model's generalization ability.
[0305] In practical applications, the initial learning rate is usually set to a value less than 1, with common choices being 0.1, 0.01, etc.
[0306] Step 830: Construct a data classification model.
[0307] This is an illustrative example of a model structure that uses a perceptron network layer as the base classifier, thereby constructing a data classification model formed by sequentially connecting multiple perceptron network layers.
[0308] Step 840: Train the data classification model using the training set.
[0309] To illustrate, the sample dataset is divided into training and test sets for optimal parameter search.
[0310] Optionally, 70% of the sample data in the sample dataset can be selected as the training dataset, thereby training the model using the sample data in the training dataset.
[0311] Step 850: Evaluate the data classification model using the test set and calculate the MCC metric and learning rate.
[0312] To illustrate, we can use 30% of the sample data to evaluate the model's predictive performance; or we can use the entire sample data to evaluate the model's predictive performance.
[0313] Step 860: Determine if the learning rate is less than 1. That is, is the learning rate < 1?
[0314] As an illustration, during model training, the learning rate is dynamically adjusted according to different strategies (such as learning rate decay strategy, adaptive learning rate strategy, etc.). These strategies help improve training efficiency, avoid overfitting, and enable the model to converge better.
[0315] Optionally, when the learning rate is less than 1, perform step 861; when the learning rate is not less than 1, perform step 862.
[0316] Step 861: Increase the learning rate by 0.1.
[0317] Indicatively, the learning rate is increased by 0.1 based on the most recent judgment to perform subsequent steps with the new learning rate.
[0318] Step 862: Determine if the number of perceptron network layers is less than 100. That is, is the number of perceptron network layers < 100?
[0319] For illustration purposes, if the number of perceptron network layers is determined to be less than 100, step 870 is executed; if the number of perceptron network layers is determined to be not less than 100, step 880 is executed.
[0320] Step 870: Increase the number of perceptron network layers by 10.
[0321] As an illustration, steps 820 to 860 above are executed after increasing the number of perceptron network layers by 10. The value of 10 here is merely an illustrative example and is not intended to be limiting.
[0322] Step 880: Select the optimal parameter combination corresponding to the MCC to construct the final data classification model.
[0323] To illustrate, even when using the same number of perceptron network layers to build a data classification model, different learning rates may correspond to different MCCs. Since MCC is a comprehensive evaluation index, a certain number of perceptron network layers (such as 100) and a learning rate corresponding to the optimal MCC can be selected to build a data classification model.
[0324] Step 890: Use 10-fold cross-validation to evaluate the performance metrics of the data classification model.
[0325] To illustrate, the ten-fold cross-validation method described above is used to evaluate the data classification model in order to determine the classification prediction performance of the data classification model.
[0326] In an alternative embodiment, the improved oversampling method for generating extended sample data described above does not require consideration of the number of nearest neighbors k when interpolating sample data; it only needs to determine the required sampling ratio.
[0327] The strategy involves oversampling minority class data during the sample generation process to achieve a 1:1 ratio between minority and majority class data. After addressing the imbalanced data problem, the key lies in the number of perceptron layers in the data classification model and the learning rate of each perceptron layer. The learning rate should be between 0 and 1. A learning rate that is too high can lead to overfitting, while a learning rate that is too low can result in underfitting due to insufficient learning of the data.
[0328] Optionally, a grid search method can be used to determine the optimal combination of learning rate and number of perceptrons, as shown in the parameter ranges in Table 2 below.
[0329] Table 2
[0330] parameter Parameter tuning range n_estimators [10,100], step size is 10 learning rate [0,0.1], with a step size of 0.1
[0331] Through grid search, it was found that when the number of perceptrons is 100 and the learning rate is 0.3, the data classification model has the best Matthews correlation coefficient on the test set, which is 0.4631.
[0332] Therefore, a data classification model was constructed using 100 perceptrons and a learning rate of 0.3. The evaluation index of the model was calculated using the ten-fold cross-validation method. The predictive ability of the model is shown in Table 3.
[0333] Table 3
[0334] Evaluation indicators Indicator value accuracy 0.7122 accuracy 0.6749 Recall rate 0.8270 F1 score 0.7412 MCC 0.4347
[0335] As shown in Table 3, among several evaluation indicators, the data classification model has a good recall rate, identifying 82.70% of the sample data of real defaults; however, it performs only moderately in terms of accuracy and precision. The overall Matthews correlation coefficient of the data classification model reaches 0.4347, which is close to 0.5, thus it has good predictive ability, especially in the identification of default sample data.
[0336] In an optional embodiment, the above-described method of obtaining sample datasets is compared with the methods of obtaining sample datasets in related technologies.
[0337] Illustratively, traditional synthetic minority oversampling techniques such as Borderline-SMOTE and Adaptive Synthetic Sampling Approach for Imbalanced Learning (ADASYN) combine the sample dataset obtained by traditional techniques with the model to perform comparative analysis on accuracy, precision, recall, F1 score, and Matthews correlation coefficient.
[0338] In the selection of the number of nearest neighbors k in traditional synthetic minority oversampling techniques (SMOTE), Borderline-SMOTE, and adaptive oversampling, a grid search method is used to determine the optimal number of samples k. Logistic regression models are theoretically sound and stable, and are frequently used in credit prediction research. Therefore, in the selection of the optimal k, a logistic regression model is used as the screening model, and the Matthews correlation coefficient is used as the evaluation index. The average of the results for each number of nearest neighbors k is calculated using ten-fold cross-validation and taken as the sampling effect of that k value. After searching, the optimal number of nearest neighbors k for each sampling method is shown in Table 4.
[0339] Table 4
[0340] Oversampling method Search range of k Optimal number of nearest neighbors k Matthews correlation coefficient SMOTE [3,19], step size is 2 19 0.192 Borderline-SMOTE [3,19], step size is 2 15 0.2447 ADASYN [3,19], step size is 2 19 0.1628
[0341] After balancing the sample dataset using various oversampling methods, the balanced sample dataset was used as the input to the model, and the fitting results are shown in Table 5.
[0342] Table 5
[0343]
[0344] By comparing five model evaluation metrics, a significant improvement in model prediction performance can be observed. This demonstrates that the improved oversampling method, while mitigating sample imbalance, does not blur sample boundaries and effectively distinguishes between the two classes of samples. The improvement in recall is particularly significant, making this sampling method more suitable for practical credit prediction scenarios.
[0345] In some embodiments, to further verify the effectiveness of the improved model, this application embodiment selects Logistic Regression-AdaBoost, Gradient Boosting Decision Tree (GBDT) and Extreme Gradient Boosting (XGBoost) on the same dataset for comparative experiments, and the comprehensive evaluation results are shown in Table 6.
[0346] Table 6
[0347]
[0348] A comprehensive comparison of multiple evaluation metrics shows that the improved model delivers the best overall predictive performance. It outperforms the [previous model] in accuracy, precision, recall, F1 score, and Matthews correlation coefficient. However, the [previous model] shows the best performance in recall. In risk management and credit assessment scenarios, a conservative approach is typically adopted, aiming to detect as many users as possible who are predicted to default. A high recall rate indicates that the model can identify a higher percentage of actual default records. Therefore, in this respect, the data classification model provided in this application embodiment demonstrates superior performance in real-world business scenarios.
[0349] Furthermore, while its F1 score and Matthews correlation coefficient are not significantly different from others, it boasts excellent recall, making the model more suitable for real-world scenarios.
[0350] It is worth noting that the above are merely illustrative examples, and the embodiments of this application are not limited thereto.
[0351] In summary, by using at least two pre-trained perceptron network layers as the network layers for classifying and predicting account data, the classification process can be clarified by using at least two perceptron network layers while ensuring a relatively small amount of data to be processed. The classification results are coordinated by the network layer weights, making the acquisition of account classification results more interpretable. This allows for more accurate prediction of the account operation status of the first account in the future. While avoiding affecting the operation process of users, it can also improve the targeting of the account management platform for the first account, reduce the management risk of the account management platform, and ensure the user experience of more users under the account management platform.
[0352] In this embodiment, a perceptron network layer is integrated as a base classifier to construct a strong learner as a data classification model. Comparative experiments show that the data classification model performs excellently in recall, with overall prediction performance superior to traditional logistic regression models and other ensemble algorithms. It is particularly suitable for credit risk prediction in real-world business scenarios, enabling more accurate identification of potential default risks and helping risk control departments deploy relevant measures in advance, thereby promoting the healthy development of the financial market and facilitating better application in practical business scenarios.
[0353] In an optional embodiment, taking the above data classification method applied to a content recommendation scenario as an example, the purpose of the account classification result is to determine the type of content recommended by the first account, and the following can be performed.
[0354] 1. Obtain account data.
[0355] Among them, account data is used to describe the account operation of the first account within a historical time period.
[0356] For illustrative purposes, the first account is a social media platform account, and account data is generated based on the first account's activities on the social media platform.
[0357] 2. Perform classification prediction on the account data using at least two pre-trained perceptron network layers to obtain the data classification results corresponding to the at least two perceptron network layers respectively.
[0358] In this system, at least two perceptron network layers correspond to network layer weights, which are parameters learned by the perceptron network layers during training. The network layer weights are used to characterize the classification influence of the perceptron network layers.
[0359] To illustrate, each perceptron network layer performs classification prediction on account data. The data classification result represents the content category that the first account is interested in, as predicted by the perceptron network layer. For example, the data classification result output by perceptron network layer 1 is "entertainment category", and the data classification result output by perceptron network layer 2 is "education category", etc.
[0360] 3. Based on the network layer weights corresponding to at least two perceptron network layers, classify the data according to the data corresponding to at least two perceptron network layers.
[0361] Among them, the account classification result corresponding to the first account is obtained; the account classification result is a prediction result of the account operation of the first account in the future time period.
[0362] Indicatively, for any perceptron network layer, the data classification result output by the perceptron network layer is adjusted by the weight of the kth network layer corresponding to the perceptron network layer to obtain the first adjusted result output by the perceptron network layer, where k is a positive integer; the account classification result corresponding to the first account is obtained by using the first adjusted results corresponding to at least two perceptron network layers respectively.
[0363] The first adjustment results corresponding to at least two perceptron network layers are summed to obtain the account classification result corresponding to the first account. Wherein, if the account classification result reaches a first threshold, the first account corresponds to the first account category; if the account classification result does not reach the first threshold, the first account corresponds to the second account category, and the first account category and the second account category are different.
[0364] For illustrative purposes, the first threshold is a preset threshold, such as 0.5. If the account classification result reaches the first threshold, the first account is determined to be in the "entertainment category", and entertainment content is recommended for the first account; if the account classification result does not reach the first threshold, the first account is determined to be in the "education category", and educational content is recommended for the first account, etc., without any specific limitation.
[0365] The pre-trained at least two perceptron network layers include a first perceptron network layer and a second perceptron network layer after training. The data classification model can be trained using a publicly available dataset of content related to the promotional content as a sample dataset, or it can be trained using a data-balanced sample dataset based on the publicly available dataset. Please refer to the above content for relevant details, which will not be elaborated here.
[0366] In some embodiments, content recommendation scenarios place greater emphasis on accuracy. Therefore, accuracy can be used as a metric to analyze the training status of the data classification model, thereby improving the fit between the data classification model and the scenario. It is worth noting that the above are merely illustrative examples, and the embodiments of this application do not limit the scope of the invention.
[0367] This application describes the application of data classification methods to content recommendation scenarios. By analyzing account data to understand the content that a first account is interested in, accurate classification can improve the relevance and personalization of recommendations, enhance the user experience, increase user engagement, and adapt to changes in user interests. This helps improve the effectiveness of content recommendations, making them not only more accurate but also more targeted, ultimately promoting platform growth and user satisfaction, without further limitations.
[0368] Figure 9 A structural block diagram of a data classification apparatus provided in an exemplary embodiment of this application is shown below. Figure 9 As shown, the device includes the following parts:
[0369] The acquisition module 910 is used to acquire account data, which describes the account operation of the first account within a historical time period.
[0370] The prediction module 920 is used to perform classification prediction on the account data through at least two pre-trained perceptron network layers to obtain data classification results corresponding to the at least two perceptron network layers respectively; wherein, the at least two perceptron network layers respectively correspond to network layer weights, the network layer weights are parameters learned by the perceptron network layers during training, and the network layer weights are used to characterize the classification influence of the perceptron network layers.
[0371] The determination module 930 is used to obtain the account classification result corresponding to the first account based on the network layer weights corresponding to the at least two perceptron network layers and the data classification results corresponding to the at least two perceptron network layers respectively; the account classification result is a prediction result of the account operation of the first account in a future time period.
[0372] In an optional embodiment, the determining module 930 is further configured to, for the kth perceptron network layer among the at least two perceptron network layers, adjust the kth data classification result output by the kth perceptron network layer through the kth network layer weight corresponding to the kth network layer, to obtain a first adjustment result corresponding to the kth perceptron network layer, where k is a positive integer; and obtain the account classification result corresponding to the first account through the first adjustment results corresponding to the at least two perceptron network layers respectively.
[0373] In an optional embodiment, the determining module 930 is further configured to sum the first adjustment results corresponding to the at least two perceptron network layers respectively to obtain the account classification result corresponding to the first account; wherein, if the account classification result reaches a first threshold, the first account corresponds to a first account category, and if the account classification result does not reach the first threshold, the first account corresponds to a second account category, and the first account category is different from the second account category.
[0374] In an optional embodiment, the pre-trained at least two perceptron network layers include a trained first perceptron network layer and a trained second perceptron network layer.
[0375] like Figure 10 As shown, the device also includes a training module 940;
[0376] The training module 940 is also used to acquire a sample dataset, which is used to train a data classification model. The data classification model includes a trained first perceptron network layer and a trained second perceptron network layer. The first perceptron network layer is trained with first sample data in the sample dataset to obtain the trained first perceptron network layer. The data category of the second sample data is predicted by the trained first perceptron network layer to obtain a prediction result. The second sample data is labeled with sample labels and corresponds to first sample weights. Based on the difference between the prediction result and the sample labels, the second sample weights corresponding to the second sample data are determined during the training of the second perceptron network layer. At least one second sample data with the second sample weights is used to train the trained second perceptron network layer.
[0377] In an optional embodiment, the training module 940 is further configured to acquire a first dataset, the first dataset including a first number of positive sample data and a second number of negative sample data, the first number being less than the second number, and the negative sample labels labeled on the negative sample data being different from those labeled on the positive sample data; based on the data association relationship between the first number of positive sample data, acquiring the data cluster center corresponding to the positive sample data; under the constraint of the data difference relationship between the data cluster center and the second number of negative sample data, generating extended sample data labeled with the positive sample labels around the data cluster center, the extended sample data being used to balance the difference in the number of data between the negative sample data and the positive sample data in the first dataset; adding the extended sample data to the first dataset to obtain the sample dataset.
[0378] In an optional embodiment, the training module 940 is further configured to obtain a distance threshold based on the first interval distances corresponding to the second number of negative sample data and the data cluster centers, wherein the first interval distance is used to characterize the data difference relationship between the data cluster centers and the negative sample data; to filter out a third number of positive sample data from the first number of positive sample data based on the distance threshold, wherein the third number is not greater than the first number; and to generate extended sample data labeled with the positive sample labels around the data cluster centers based on the third number of positive sample data and the data cluster centers.
[0379] In an optional embodiment, the training module 940 is further configured to obtain the first interval distance corresponding to the second number of negative sample data respectively; obtain the average distance of the second number of first interval distances as the distance threshold; or, perform weighted averaging on the second number of first interval distances to obtain the distance threshold.
[0380] In an optional embodiment, the training module 940 is further configured to obtain the second interval distances corresponding to the first number of positive sample data and the data cluster centers, the second interval distance being used to characterize the data association relationship of the positive sample data relative to the data cluster centers; and to filter the positive sample data from the first number of positive sample data whose second interval distance is not greater than the distance threshold to obtain the third number of positive sample data.
[0381] In an optional embodiment, the training module 940 is further configured to perform interpolation processing between the positive sample data and the data cluster center for any one of the third number of positive sample data to obtain at least one of the extended sample data, the extended sample data being labeled with the positive sample label.
[0382] In an optional embodiment, the training module 940 is further configured to perform weighted sampling on the at least two sample data based on the sample weights corresponding to at least two sample data in the sample dataset, to obtain at least one sample data as the first sample data, wherein the sample weights are used to characterize the training influence of the sample data on the perceptron network layer; and to train the first perceptron network layer in the at least two network layers using the first sample data to obtain the trained first perceptron network layer.
[0383] In an optional embodiment, the sample dataset is used to sequentially train the at least two perceptron network layers;
[0384] The training module 940 is further configured to determine the i-th sample weights corresponding to the at least two sample data when training the i-th perceptron network layer, where i is a positive integer; perform weighted sampling on the at least two sample data based on the i-th sample weights, and obtain the first sample data used in the training process of the i-th perceptron network layer from the sample dataset.
[0385] In an optional embodiment, the training module 940 is further configured to: obtain a weighted learning error rate corresponding to the first perceptron network layer based on the difference between the prediction result and the sample label, wherein the weighted learning error rate is used to characterize the category prediction performance of the perceptron network layer; obtain network layer weights corresponding to the first perceptron network layer based on the weighted learning error rate, wherein the network layer weights are used to characterize the importance of the perceptron network layer in performing data classification prediction in the data classification model; and adjust the first sample weights with the network layer weights corresponding to the first perceptron network layer to obtain the second sample weights corresponding to the sample data during the training of the second perceptron network layer.
[0386] In an optional embodiment, the training module 940 is further configured to, when the prediction result of the first perceptron network layer for the m-th second sample data is the same as the sample label corresponding to the m-th second sample data, reduce the first sample weight corresponding to the m-th second sample data to obtain the second sample weight corresponding to the m-th second sample data, where m are positive integers; or, when the prediction result of the first perceptron network layer for the m-th second sample data is the same as the sample label corresponding to the m-th second sample data, increase the first sample weight corresponding to the m-th second sample data to obtain the second sample weight corresponding to the m-th second sample data.
[0387] In summary, by using at least two pre-trained perceptron network layers as the network layers for classifying and predicting account data, the classification process can be clarified by using at least two perceptron network layers while ensuring a relatively small amount of data to be processed. The classification results are coordinated by the network layer weights, making the acquisition of account classification results more interpretable. This allows for more accurate prediction of the account operation status of the first account in the future. While avoiding affecting the operation process of users, it can also improve the targeting of the account management platform for the first account, reduce the management risk of the account management platform, and ensure the user experience of more users under the account management platform.
[0388] It should be noted that the data classification device provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the data classification device and the data classification method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0389] Figure 11 This illustration shows a schematic diagram of the structure of a server provided in an exemplary embodiment of this application. Specifically, it includes the following structure.
[0390] Server 1100 includes a Central Processing Unit (CPU) 1101, a system memory 1104 including Random Access Memory (RAM) 1102 and Read Only Memory (ROM) 1103, and a system bus 1105 connecting the system memory 1104 and the CPU 1101. Server 1100 also includes a mass storage device 1106 for storing the operating system 1113, application programs 1114, and other program modules 1115.
[0391] Mass storage device 1106 is connected to central processing unit 1101 via a mass storage controller (not shown) connected to system bus 1105. Mass storage device 1106 and its associated computer-readable media provide non-volatile storage for server 1100. That is, mass storage device 1106 may include computer-readable media (not shown) such as hard disk or compact disc read-only memory (CD-ROM) drives.
[0392] Without loss of generality, computer-readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include RAM, ROM, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other solid-state storage technologies, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that computer storage media are not limited to the above-mentioned types. The system memory 1104 and mass storage device 1106 described above can be collectively referred to as memory.
[0393] According to various embodiments of this application, server 1100 can also be connected to a remote computer on a network, such as the Internet. That is, server 1100 can be connected to network 1112 via network interface unit 1111 connected to system bus 1105, or it can also use network interface unit 1111 to connect to other types of networks or remote computer systems (not shown).
[0394] The aforementioned memory also includes one or more programs, which are stored in the memory and configured to be executed by the CPU.
[0395] Embodiments of this application also provide a computer device including a processor and a memory. The memory stores at least one instruction, at least one program, a code set, or an instruction set. The processor loads and executes the at least one instruction, at least one program, a code set, or an instruction set to implement the data classification method provided in the above-described method embodiments. Optionally, the computer device may be a terminal or a server.
[0396] Embodiments of this application also provide a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the data classification method provided in the above-described method embodiments.
[0397] Embodiments of this application also provide a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the data classification methods described in the above embodiments.
[0398] Optionally, the computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), solid-state drives (SSDs), or optical discs, etc. The random access memory may include resistive random access memory (ReRAM) and dynamic random access memory (DRAM). The sequence numbers of the embodiments in this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0399] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0400] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A data classification method, characterized in that, The method includes: Acquire account data, which describes the account operation activities of the first account within a historical time period; The account data is classified and predicted by at least two pre-trained perceptron network layers to obtain data classification results corresponding to the at least two perceptron network layers respectively; wherein, the at least two perceptron network layers correspond to network layer weights, the network layer weights are parameters learned by the perceptron network layers during training, and the network layer weights are used to characterize the classification influence of the perceptron network layers. Based on the network layer weights corresponding to the at least two perceptron network layers, and through the data classification results corresponding to the at least two perceptron network layers, the account classification result corresponding to the first account is obtained; the account classification result is a prediction result of the account operation of the first account in a future time period.
2. The method according to claim 1, characterized in that, The process of obtaining the account classification result corresponding to the first account based on the network layer weights corresponding to the at least two perceptron network layers and the data classification results corresponding to the at least two perceptron network layers includes: For the kth perceptron network layer in the at least two perceptron network layers, the kth data classification result output by the kth perceptron network layer is adjusted by the weight of the kth network layer corresponding to the kth perceptron network layer, so as to obtain the first adjustment result corresponding to the kth perceptron network layer, where k is a positive integer; The account classification result corresponding to the first account is obtained through the first adjustment results corresponding to the at least two perceptron network layers respectively.
3. The method according to claim 2, characterized in that, The step of obtaining the account classification result corresponding to the first account through the first adjustment results corresponding to the at least two perceptron network layers includes: The first adjustment results corresponding to the at least two perceptron network layers are summed to obtain the account classification result corresponding to the first account. Wherein, if the account classification result reaches the first threshold, the first account corresponds to the first account category; if the account classification result does not reach the first threshold, the first account corresponds to the second account category, and the first account category is different from the second account category.
4. The method according to any one of claims 1 to 3, characterized in that, The pre-trained at least two perceptron network layers include a trained first perceptron network layer and a trained second perceptron network layer. The method further includes: Obtain a sample dataset, which is used to train a data classification model. The data classification model includes a trained first perceptron network layer and a trained second perceptron network layer. The first perceptron network layer is trained using the first sample data in the sample dataset to obtain the trained first perceptron network layer. The training first perceptron network layer predicts the data category of the second sample data to obtain the prediction result. The second sample data is labeled with sample labels and corresponds to the first sample weight. Based on the difference between the prediction result and the sample label, the second sample weight corresponding to the second sample data is determined during the training of the second perceptron network layer, and at least one second sample data with the second sample weight is used to train the trained second perceptron network layer.
5. The method according to claim 4, characterized in that, The acquisition of the sample dataset includes: Obtain a first dataset, which includes a first number of positive sample data and a second number of negative sample data, wherein the first number is less than the second number, and the negative sample labels labeled on the negative sample data are different from those labeled on the positive sample data. Based on the data association relationships among the first number of positive sample data, obtain the data clustering center corresponding to the positive sample data; Under the constraint of the data difference relationship between the data cluster center and the second number of negative sample data, extended sample data labeled with the positive sample labels are generated around the data cluster center. The extended sample data is used to balance the difference in the number of data between the negative sample data and the positive sample data in the first dataset. The extended sample data is added to the first dataset to obtain the sample dataset.
6. The method according to claim 5, characterized in that, Under the constraint of the data difference relationship between the data cluster center and the second number of negative sample data, generating extended sample data labeled with the positive sample labels around the data cluster center includes: Based on the first interval distances corresponding to the second number of negative sample data and the data cluster centers, a distance threshold is obtained, wherein the first interval distance is used to characterize the data difference relationship between the data cluster centers and the negative sample data; A third number of positive sample data is obtained from the first number of positive sample data based on the distance threshold, wherein the third number is not greater than the first number; Based on the third number of positive sample data and the data cluster centers, extended sample data labeled with the positive sample labels are generated around the data cluster centers.
7. The method according to claim 6, characterized in that, The step of obtaining a distance threshold based on the first interval distance between the second number of negative sample data and the data cluster center includes: Obtain the first interval distance corresponding to the second number of negative sample data respectively; The average distance of the second number of first interval distances is obtained as the distance threshold; or, a weighted average is performed on the second number of first interval distances to obtain the distance threshold.
8. The method according to claim 6, characterized in that, The step of filtering the first number of positive sample data from the first number of positive sample data based on the distance threshold includes: Obtain the second interval distances corresponding to the first number of positive sample data and the data cluster centers, whereby the second interval distance is used to characterize the data association relationship between the positive sample data and the data cluster centers; The third number of positive sample data is obtained by filtering positive sample data from the first number of positive sample data where the second interval distance is not greater than the distance threshold.
9. The method according to claim 6, characterized in that, The process of generating extended sample data labeled with the positive sample tags around the data cluster centers, based on the third number of positive sample data and the data cluster centers, includes: For any one of the positive sample data in the third number of positive sample data, interpolation is performed between the positive sample data and the data cluster center to obtain at least one extended sample data, the extended sample data being labeled with the positive sample label.
10. The method according to claim 4, characterized in that, The step of training a first perceptron network layer with first sample data from the sample dataset to obtain the trained first perceptron network layer includes: Based on the sample weights corresponding to at least two sample data in the sample dataset, weighted sampling is performed on the at least two sample data to obtain at least one sample data as the first sample data. The sample weights are used to characterize the training influence of the sample data on the perceptron network layer. The first perceptron network layer in the at least two network layers is trained using the first sample data to obtain the trained first perceptron network layer.
11. The method according to claim 10, characterized in that, The sample dataset is used to train the at least two perceptron network layers sequentially. The step of performing weighted sampling on at least two sample data points based on their respective sample weights in the sample dataset to obtain at least one sample data point as the first sample data point includes: During the training of the i-th perceptron network layer, the weights of the i-th samples corresponding to the at least two sample data are determined, where i is a positive integer; Weighted sampling is performed on the at least two sample data based on the i-th sample weight, and the first sample data used in the training of the i-th perceptron network layer is obtained from the sample dataset.
12. The method according to claim 4, characterized in that, The step of determining the second sample weights corresponding to the second sample data during the training of the second perceptron network layer based on the difference between the prediction result and the sample label includes: Based on the difference between the prediction result and the sample label, the weighted learning error rate corresponding to the first perceptron network layer is obtained, and the weighted learning error rate is used to characterize the category prediction performance of the perceptron network layer. The weighted learning error rate is used to obtain the network layer weights corresponding to the first perceptron network layer. The network layer weights are used to characterize the importance of the perceptron network layer in performing data classification prediction in the data classification model. The first sample weights are adjusted by the network layer weights corresponding to the first perceptron network layer to obtain the second sample weights corresponding to the sample data during the training of the second perceptron network layer.
13. The method according to claim 4, characterized in that, The step of obtaining the weighted learning error rate corresponding to the first perceptron network layer based on the difference between the prediction result and the sample label, wherein the weighted learning error rate is used to characterize the category prediction performance of the perceptron network layer, includes: If the prediction result of the first perceptron network layer after training for the m-th second sample data is the same as the sample label corresponding to the m-th second sample data, then the first sample weight corresponding to the m-th second sample data is reduced to obtain the second sample weight corresponding to the m-th second sample data, where m is a positive integer; or... If the prediction result of the first perceptron network layer after training is the same as the sample label corresponding to the m-th second sample data, the first sample weight corresponding to the m-th second sample data is increased to obtain the second sample weight corresponding to the m-th second sample data.
14. A data classification device, characterized in that, The device includes: The acquisition module is used to acquire account data, which describes the account operation of the first account within a historical time period. The prediction module is used to perform classification prediction on the account data through at least two pre-trained perceptron network layers to obtain data classification results corresponding to the at least two perceptron network layers respectively; wherein, the at least two perceptron network layers respectively correspond to network layer weights, the network layer weights are parameters learned by the perceptron network layers during training, and the network layer weights are used to characterize the classification influence of the perceptron network layers. The determination module is used to obtain the account classification result corresponding to the first account based on the network layer weights corresponding to the at least two perceptron network layers and the data classification results corresponding to the at least two perceptron network layers respectively; the account classification result is a prediction result of the account operation of the first account in a future time period.
15. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one program, which is loaded and executed by the processor to implement the data classification method as described in any one of claims 1 to 13.
16. A computer-readable storage medium, characterized in that, The storage medium stores at least one program segment, which is loaded and executed by a processor to implement the data classification method as described in any one of claims 1 to 13.
17. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the data classification method as described in any one of claims 1 to 13.
