Classification model training method and device, equipment, storage medium and product
Through the classification model composed of multiple models, the attention of sample data is dynamically adjusted, which solves the problem of inaccurate identification of minority samples in the existing technology, improves the model's ability to recognize minority samples, and improves the accuracy and reliability of detection.
Patent Information
- Application Number
- CN202510742815.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-09-26
AI Technical Summary
During the training process, existing classification models tend to favor the majority class and ignore the characteristics of the minority class, resulting in a high misjudgment rate when identifying minority class samples, affecting detection accuracy and system reliability.
A classification model composed of multiple initial models is used to dynamically adjust the attention of sample data by comparing the predicted classification results, focusing on minority class samples that are difficult to identify or misclassified, and retraining the model to improve its sensitivity to minority class samples.
By dynamically adjusting the model's attention, misjudgments and missed judgments are reduced, the classification model's ability to identify minority samples is improved, and the overall detection accuracy and reliability are improved.
Smart Images

Figure CN120705716A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a training method, apparatus, equipment, storage medium and product for a classification model. Background Art
[0002] With the continuous development of big data technology, user behavior data has become massive and diverse, covering a wide range of information, including transaction records, operational behaviors, preferences, and habits. This provides a rich data foundation for building intelligent predictive models. While the rapid growth of data scale has enhanced the expressive power of models, it has also brought significant challenges in storage, processing, and analysis. In particular, when faced with massive amounts of information, the time and resource consumption of model training has increased significantly, limiting its practical application.
[0003] On the other hand, this massive data set often suffers from a serious imbalance. This means that the minority class (e.g., samples of unusual or rare behaviors) is extremely underrepresented in the overall sample set. This can cause the model to favor the majority class during training and neglect the characteristics of the minority class. This can lead to misjudgments when identifying minority samples, compromising overall detection accuracy and system reliability. This issue urgently requires effective technical solutions to ensure that the model maintains sufficient sensitivity and recognition capabilities for minority samples. Summary of the Invention
[0004] The present application provides a classification model training method, apparatus, device, storage medium and product to effectively solve the problem of inaccurate recognition of minority class samples.
[0005] In a first aspect, the present application provides a method for training a classification model, comprising:
[0006] Obtain sample data and divide it into a training set and a test set; the sample data carries a classification label;
[0007] Using the training set, training a preset number of initial models to obtain a preset number of classification models;
[0008] Inputting the sample data in the test set into each of the classification models to obtain a predicted classification result corresponding to each of the sample data, and adjusting the model attention of each of the sample data based on the predicted classification result and the classification label carried by the sample data;
[0009] The classification models are trained again using the sample data after adjusting the model attention to obtain a trained classification model.
[0010] In an exemplary embodiment, after obtaining the sample data, the method further includes:
[0011] The behavior sample data is preprocessed; the preprocessing process includes at least one of data standardization, missing value processing, balancing processing, outlier processing and noise reduction.
[0012] In an exemplary embodiment, adjusting the model attention of each sample data based on the predicted classification result and the classification label carried by the sample data includes:
[0013] Based on the predicted classification result and the classification label carried by the sample data, determining the number of classification models in which the predicted classification result is consistent with the classification label;
[0014] Dividing the sample data into a plurality of data types based on the classification labels and the number of classification models whose predicted classification results are consistent with the classification labels;
[0015] Based on the data type, the model attention corresponding to the sample data is adjusted.
[0016] In an exemplary embodiment, the plurality of data types correspond one-to-one to the plurality of target model attention levels;
[0017] The adjusting the model attention corresponding to the sample data based on the data type includes:
[0018] The initial model attention degree corresponding to each sample data is adjusted to the target model attention degree corresponding to the data type of the sample data.
[0019] In an exemplary embodiment, the initial model uses at least two of a random forest algorithm, an adaptive boosting algorithm, a linear discriminant analysis algorithm, a stacked generalization algorithm, and a multilayer perceptron algorithm.
[0020] In an exemplary embodiment, after obtaining the trained classification model, the method further includes:
[0021] Obtain data to be classified;
[0022] The data to be classified is input into the trained classification model to obtain the classification result.
[0023] In a second aspect, the present application also provides a training device for a classification model, comprising:
[0024] An acquisition module is used to acquire sample data and divide it into a training set and a test set; the sample data carries a classification label;
[0025] A first training module is configured to use the training set to train a preset number of initial models to obtain a preset number of classification models;
[0026] An adjustment module, configured to input the sample data in the test set into each of the classification models, obtain a predicted classification result corresponding to each of the sample data, and adjust the model attention of each of the sample data based on the predicted classification result and the classification label carried by the sample data;
[0027] The second training module is used to retrain each of the classification models using the sample data after adjusting the model attention to obtain a trained classification model.
[0028] In a fifth aspect, the present application provides an electronic device, comprising: a memory, a processor;
[0029] The memory stores computer-executable instructions;
[0030] The processor executes the computer-executable instructions stored in the memory, so that the processor implements the steps of the method in any one of the above embodiments when executing the instructions.
[0031] In a sixth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method in any one of the above embodiments when the computer program is executed by a processor.
[0032] In a seventh aspect, the present application provides a computer program product, comprising a computer program, which implements the steps of the method in any one of the above embodiments when executed by a processor.
[0033] The training method, device, equipment, storage medium and product of the classification model provided in this application adopt a classification model composed of multiple initial models, which can reduce the risk of randomness through multiple models; by comparing the predicted classification results of multiple classification models, dynamically adjusting the attention level, and adjusting the attention intensity of different data samples in model training, the classification model pays more attention to minority class samples that are difficult to identify or misclassified, so that the classification model can more fully learn the characteristics of minority class samples and reduce misjudgments and missed judgments. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0035] Figure 1 A schematic diagram of the structure of an application environment of a classification model training method in one embodiment;
[0036] Figure 2 A flowchart of the steps of a training method for a classification model in one embodiment;
[0037] Figure 3 Schematic diagram of the structure of a training device for a classification model in one embodiment;
[0038] Figure 4 FIG. 1 is a schematic structural diagram of an electronic device in an embodiment.
[0039] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0040] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0041] It should be noted that the training method, recognition method and device of the classification model in this application can be used in the field of artificial intelligence, and can also be used in any field other than artificial intelligence. This application does not limit the application field of the training method, recognition method and device of the classification model.
[0042] The training method of the classification model provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 via the network.
[0043] For example, a classification model training method is applied to terminal 102. After receiving a training instruction, terminal 102 can obtain sample data from the data storage system of server 104 and divide it into a training set and a test set. The sample data carries classification labels. The training set is further used to train a preset number of initial models to obtain a preset number of classification models. Terminal 102 then inputs sample data from the test set into each classification model to obtain a predicted classification result corresponding to each sample data. Based on the predicted classification result and the classification label carried by the sample data, the model attention level of each sample data is adjusted. Finally, each classification model is retrained using the sample data with adjusted model attention level to obtain a trained classification model. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented as a standalone server or a server cluster consisting of multiple servers. Terminal 102 and server 104 can be directly or indirectly connected via wired or wireless communication, such as via a network connection.
[0044] For another example, the training method of the classification model is applied to the server 104. After receiving the training instruction, the terminal 102 can send the training instruction to the server 104. The server 104 can obtain sample data from the data storage system and divide it into a training set and a test set; the sample data carries a classification label; the training set is further used to train a preset number of initial models to obtain a preset number of classification models; then the server 104 inputs the sample data in the test set into each classification model to obtain the predicted classification result corresponding to each sample data, and adjusts the model attention of each sample data based on the predicted classification result and the classification label carried by the sample data; finally, the sample data with adjusted model attention is used to train each classification model again to obtain a trained classification model. It can be understood that the data storage system can be an independent storage device, or the data storage system can be located on the server 104, or the data storage system can be located on another terminal.
[0045] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0046] In an exemplary embodiment, Figure 2 As shown, a classification model training method is provided, including the following steps 202 to 208. In which:
[0047] Step 202: Obtain sample data and divide it into a training set and a test set; the sample data carries a classification label.
[0048] Sample data refers to the various behavioral records generated by users in the relevant services provided by the service provider. These data reflect the user's preferences, needs, and virtual resource usage habits. For example, this includes: virtual resource usage information such as the transfer, exchange, and application of virtual resources; platform login information such as the number of logins, login time, and account information changes on the platform interface provided by the service provider; and communication information such as communication records, consultation content, and feedback with the service provider's customer service.
[0049] As an example, upon receiving a training instruction, the terminal can retrieve sample data from the server's data storage system. The training instruction can be issued by a staff member through the terminal's human-computer interaction interface. The terminal's human-computer interaction interface can specifically display a platform interface pre-designated by the service provider for user behavior recognition. The staff member issues the training instruction by clicking on a virtual component representing model training in the designated platform interface. It should be noted that users can also filter sample data by clicking on pre-integrated virtual components on the designated platform interface that indicate different filtering conditions.
[0050] Among them, the training set is used for model training, and the test set is used for model verification.
[0051] The classification label is used to indicate the actual classification result corresponding to each sample data. The classification label can be pre-labeled by the staff. For example, the classification label can be 0 or 1, which is used to refer to the actual interaction behavior type of the user corresponding to the sample data.
[0052] In step 204 , a training set is used to train a preset number of initial models to obtain a preset number of classification models.
[0053] Among them, the initial model refers to the classification model structure that has not yet completed hyperparameter tuning, such as the Random Forest algorithm (RF), Adaptive Boosting algorithm (AdaBoost), Linear Discriminant Analysis algorithm (LDA), Stacked Generalization algorithm (Stacking) and Multilayer Perceptron algorithm (MLP); the classification model refers to a model that has completed training and has the ability to classify sample data.
[0054] In step 206 , the sample data in the test set are input into each classification model to obtain the predicted classification result corresponding to each sample data, and the model attention degree of each sample data is adjusted based on the predicted classification result and the classification label carried by the sample data.
[0055] In this embodiment, the terminal may collect the predicted classification results of each classification model for the same sample data and the actual classification label of the sample data.
[0056] Subsequently, the predicted classification results of each classification model for the same sample data are compared with the corresponding actual classification label to determine whether the sample data is correctly classified. Then, based on the judgment results, the number of classification models whose predicted classification results match the actual classification label is determined. Combined with the actual classification label of the sample data, the data type corresponding to the sample data is determined.
[0057] For example, when there are T classification models and the actual classification label of the sample data is 1, if the number of classification models whose predicted classification results for the sample data are 1 is T, then the data type corresponding to the sample data can be determined to be the target user data TNs; if the number of classification models whose predicted classification results for the sample data are 1 is less than T and greater than T / 2, then the data type corresponding to the sample data can be determined to be high-quality user data TNw; if the number of classification models whose predicted classification results for the sample data are 1 is less than T / 2 and greater than 0, then the data type corresponding to the sample data can be determined to be data FPw with high potential for specific interactive behaviors; if the number of classification models whose predicted classification results for the sample data are 1 is 0, then the data type corresponding to the sample data can be determined to be data FPs with the highest potential for specific interactive behaviors.
[0058] When there are T classification models and the actual classification label of the sample data is 0, if the number of classification models whose predicted classification results for the sample data are 0 is T, then it can be determined that the data type corresponding to the sample data is the data TPs with the highest possibility of specific interaction behavior; if the number of classification models whose predicted classification results for the sample data are 0 is less than T and greater than T / 2, then it can be determined that the data type corresponding to the sample data is data TPw with a high possibility of specific interaction behavior; if the number of classification models whose predicted classification results for the sample data are 0 is less than T / 2 and greater than 0, then it can be determined that the data type corresponding to the sample data is data FNw that is mistakenly classified as data FNw with a high possibility of specific interaction behavior; if the number of classification models whose predicted classification results for the sample data are 0 is 0, then it can be determined that the data type corresponding to the sample data is data FNs that is mistakenly classified as data FNs with the highest possibility of specific interaction behavior.
[0059] In the usage scenario of a banking system, a specific interactive behavior may refer to, for example, a user's ability to return virtual resources.
[0060] When there are five classification models, the process of determining the data type corresponding to the sample data can be done by combining the number of classification models whose predicted classification results match the actual classification labels and the actual classification labels of the sample data using the following table:
[0061] Table 1
[0062]
[0063]
[0064] The number of classification models in the above table and the ratio of the predicted classification results output by each classification model are only used as examples. The number of classification models and the ratio of the predicted classification results output by each classification model can be adjusted based on actual conditions.
[0065] As an example, when there are 5 classification models, the actual classification label of the sample data is 1, and the predicted classification results of the five classification models for the sample data are 1, 1, 1, 1, 1 respectively, it can be determined that the number of classification models whose predicted classification results are consistent with the actual classification label is 5. At this time, it can be determined that the sample data is the target user data TNs.
[0066] Furthermore, based on the data type of each sample data, the initial model attention corresponding to each sample data is adjusted to the model attention corresponding to the data type, so as to update the model attention of the sample data, thereby updating the features of the sample data or the weights of the samples during the model training process. This process uses the attention as the importance coefficient of the sample data and applies it to subsequent model training, so that the classification model is more biased towards difficult-to-classify or misclassified samples during the learning process. Through this series of steps, the attention adjustment of the sample data is completed, providing a more optimized sample weight or feature sampling basis for the model retraining in step 208, thereby improving the classification model's ability to recognize complex samples.
[0067] Step 208: Use the sample data after adjusting the model attention to train each classification model again to obtain a trained classification model.
[0068] Furthermore, the terminal can select these weighted sample data and re-input them into each classification model for training, ensuring that the classification model pays more attention to minority or difficult-to-classify samples during the learning process. During training, the classification model optimizes model parameters based on the adjusted sample importance to better capture the characteristics and boundaries of each sample data. After training is complete, multiple classification models with adjusted and optimized attention are obtained. These classification models demonstrate stronger ability to identify rare or difficult-to-classify samples, thereby improving the overall classification performance of the system.
[0069] In the above-mentioned classification model training method, a classification model composed of multiple initial models is used, which can reduce the random risk through multiple models; by comparing the predicted classification results of multiple classification models, dynamically adjusting the attention, and adjusting the attention intensity of different data samples in model training, the classification model can focus more on minority class samples that are difficult to identify or misclassified, so that the classification model can more fully learn the characteristics of minority class samples and reduce misjudgments and missed judgments.
[0070] In an optional embodiment, after step 202, the method further includes:
[0071] The sample data is preprocessed; the preprocessing process includes at least one of data standardization, missing value processing, balancing processing, outlier processing and noise reduction.
[0072] In this embodiment, preprocessing of sample data is a key step in building an efficient classification model, and its purpose is to convert the original sample data into a normalized form suitable for processing by a machine learning algorithm.
[0073] The preprocessing process needs to solve various problems in the data in a targeted manner based on the data characteristics and business needs required by the machine learning algorithm to ensure the reliability and accuracy of subsequent modeling.
[0074] The entire preprocessing process includes the following core links: Data standardization is an important step to convert features of different dimensions or magnitudes into a unified scale. Since sample data usually contains multiple types of features, such as residence time in seconds and consumption amount in yuan, the numerical ranges of these features vary greatly. If they are not standardized, features with larger values may dominate the model training. Commonly used standardization methods include Z-score standardization and Min-Max standardization. Z-score standardization achieves normalization transformation of data by calculating the standard deviation and mean of the feature values, and is particularly suitable for processing data that approximately obeys a normal distribution. Min-Max standardization linearly transforms the data to a specified interval, usually the range [0,1]. This method can preserve the distribution shape of the original data and is suitable for data with clear boundaries.
[0075] Missing value handling is a solution to the problem of incomplete data. When collecting sample data, missing data often occurs due to system failures, user refusal to provide data, or loopholes in the collection logic. Handling missing values requires different strategies depending on the feature type and the missing value ratio. For numerical features, you can use the mean, median, or mode to fill in the missing value; for categorical features, you can set a separate "missing" category or use the most frequent value to fill in the missing value. When the missing value ratio is high, you may need to consider deleting the feature or using more complex interpolation methods, such as regression prediction based on other features. It is important to note that missing values in the test set must be handled in the same way as in the training set to maintain a consistent data distribution.
[0076] Balancing primarily addresses the imbalanced distribution of sample classes in classification tasks. In user behavior prediction scenarios, a large disparity in the ratio of positive to negative samples is common. For example, in fraud detection, legitimate transactions far outnumber fraudulent ones. This imbalance can cause the model to favor predicting the majority class, impacting the recognition of the critical minority class. Oversampling and undersampling are two key approaches to address this imbalance. Oversampling increases the number of minority class samples by replicating them or generating synthetic samples using algorithms like SMOTE. Undersampling reduces the number of majority class samples through random sampling or clustering. Additionally, class weights can be adjusted at the algorithmic level, or metrics insensitive to class imbalance can be used for evaluation.
[0077] Outlier detection and processing are crucial for ensuring data quality. Outliers in sample data may stem from genuine anomalous behavior or errors during data collection or transmission. Common detection methods include statistically based approaches, such as the interquartile range method; distance-based methods, such as local outlier detection; and density-based methods, such as DBSCAN clustering. The appropriate handling method depends on the nature of the outlier: records with obvious errors can be deleted directly; extreme values that may contain information can be truncated or binned; and significant anomalous behavior may require separate modeling and analysis.
[0078] Noise reduction aims to eliminate random fluctuations and irrelevant interference in data. Noise in sample data can arise from equipment errors, environmental disturbances, or involuntary actions. Sliding average filtering of time series data can effectively smooth short-term fluctuations; wavelet transforms can separate components of different frequencies; and rule-based filtering can eliminate records that are clearly illogical. However, when performing noise reduction, special care must be taken to avoid over-smoothing, which can lead to loss of true behavioral patterns.
[0079] After systematic preprocessing, sample data can better meet the basic assumptions of machine learning algorithms, significantly improving the effectiveness of subsequent modeling. The preprocessing process must maintain consistency in processing logic. All transformation parameters should be derived from the training data and applied to the test data to avoid data leakage. Furthermore, the specific methods and parameters of each preprocessing step should be documented in detail to ensure model reproducibility and interpretability.
[0080] In the above-mentioned classification model training method, by preprocessing the sample data, the data quality and model performance of the sample data can be comprehensively improved. By eliminating the dimensional differences between features, filling data gaps, balancing category distribution, removing abnormal interference, and filtering noise signals, the preprocessed sample data can better meet the input requirements of the machine learning algorithm. This normalization processing can not only significantly improve the prediction accuracy and generalization ability of the classification model at the training site, making the classification model more stable in the test set and actual business scenarios, but also greatly optimize the training efficiency and reduce computing resource consumption.
[0081] In an optional embodiment, step 206 includes:
[0082] Based on the predicted classification results and the classification labels carried by the sample data, determine the number of classification models whose predicted classification results are consistent with the classification labels;
[0083] Divide the sample data into multiple data types based on the classification labels and the number of classification models whose predicted classification results match the classification labels;
[0084] Based on the data type, adjust the model attention corresponding to the sample data.
[0085] Specifically, multiple data types correspond one-to-one with the attention of multiple target models;
[0086] Based on the data type, adjust the model attention corresponding to the sample data, which can include:
[0087] The initial model attention degree corresponding to each sample data is adjusted to the target model attention degree corresponding to the data type of the sample data.
[0088] As an example, the initial model attention corresponding to each sample data can be f i .
[0089] The one-to-one correspondence between the data type of the sample data and the corresponding target model attention can be expressed in the following table:
[0090] Table 2
[0091]
[0092]
[0093] The data types of the sample data and the specific values of the corresponding target model attention in the above table are only used as examples. The data types of the sample data and the specific values of the corresponding target model attention can be adjusted based on actual conditions.
[0094] The above classification model training method adjusts the model's attention according to the data type of each sample data, allowing the classification model to focus more on the most effective features for the data type, thereby improving the accuracy of classification or regression, helping to maximize the model's advantages and reduce ineffective model investment.
[0095] In an optional embodiment, the initial model may adopt at least two of a random forest algorithm, an adaptive boosting algorithm, a linear discriminant analysis algorithm, a stacked generalization algorithm, and a multilayer perceptron algorithm.
[0096] In an optional embodiment, after step 208, the method further includes:
[0097] Obtain data to be classified;
[0098] Input the data to be classified into the trained classification model to obtain the classification results.
[0099] The data to be classified refers to the past behavioral data of specific users that need to be classified and predicted.
[0100] In this embodiment, the data to be classified is identified by a classification model to obtain a classification result.
[0101] In the above embodiment, by combining the optimal classification model formed by historical training, efficient classification and recognition of the data to be classified is achieved, which can improve the classification model's ability to predict specific interactive actions of target users.
[0102] Based on the same inventive concept, the present application also provides a classification model training device for implementing the classification model training method mentioned above. The solution to the problem provided by the device is similar to the solution described in the above method. Therefore, the specific limitations of the one or more classification model training device embodiments provided below can be found in the above-mentioned limitations on the classification model training method, and will not be repeated here.
[0103] In an exemplary embodiment, Figure 3 As shown, a classification model training device 300 is provided, comprising:
[0104] The acquisition module 302 is used to obtain sample data and divide it into a training set and a test set; the sample data carries a classification label;
[0105] A first training module 304 is configured to train a preset number of initial models using a training set to obtain a preset number of classification models;
[0106] Adjustment module 306, which is used to input the sample data in the test set into each classification model, obtain the predicted classification results corresponding to each sample data, and adjust the model attention of each sample data based on the predicted classification results and the classification labels carried by the sample data;
[0107] The second training module 308 is used to retrain each classification model using the sample data after adjusting the model attention to obtain a trained classification model.
[0108] In one embodiment, the acquisition module 302 is further configured to:
[0109] The sample data is preprocessed; the preprocessing process includes at least one of data standardization, missing value processing, balancing processing, outlier processing and noise reduction.
[0110] In one embodiment, the adjustment module 306 is further configured to:
[0111] Based on the predicted classification results and the classification labels carried by the sample data, determine the number of classification models whose predicted classification results are consistent with the classification labels;
[0112] Divide the sample data into multiple data types based on the classification labels and the number of classification models whose predicted classification results match the classification labels;
[0113] Based on the data type, adjust the model attention corresponding to the sample data.
[0114] In one embodiment, multiple data types correspond one-to-one to multiple target model attention levels;
[0115] The adjustment module 306 is further configured to:
[0116] The initial model attention degree corresponding to each sample data is adjusted to the target model attention degree corresponding to the data type of the sample data.
[0117] In one embodiment, the initial model uses at least two of a random forest algorithm, an adaptive boosting algorithm, a linear discriminant analysis algorithm, a stacked generalization algorithm, and a multilayer perceptron algorithm.
[0118] In one embodiment, the second training module 308 is further configured to:
[0119] Obtain data to be classified;
[0120] Input the data to be classified into the trained classification model to obtain the classification results.
[0121] Each module in the above-mentioned apparatus may be implemented in whole or in part by software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0122] Figure 4 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 4 As shown, the electronic device 40 provided in this embodiment includes: at least one processor 401 and a memory 402. Optionally, the device 40 further includes a communication component 403. The processor 401, the memory 402 and the communication component 403 are connected via a bus 404.
[0123] In a specific implementation process, at least one processor 401 executes the computer-executable instructions stored in the memory 402, so that the at least one processor 401 performs the above method.
[0124] The specific implementation process of the processor 401 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.
[0125] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly implemented by a hardware processor or implemented by a combination of hardware and software modules in the processor.
[0126] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory.
[0127] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be classified into address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.
[0128] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0129] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0130] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0131] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0132] The division of units is merely a logical functional division; actual implementations may employ alternative divisions, such as combining or integrating multiple units or components into another system, or omitting or disabling certain features. Furthermore, any direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units, either through an interface, electrical, mechanical, or other means.
[0133] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0134] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0135] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.
[0136] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0137] Finally, it should be noted that those skilled in the art will readily identify other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art not disclosed herein. The present invention is not limited to the precise structure described above and illustrated in the accompanying drawings, and various modifications and variations may be made without departing from the scope thereof. The scope of the present invention is limited solely by the appended claims.
Claims
1. A training method for a classification model, characterized in that: The method comprises: Obtain sample data and divide it into a training set and a test set; the sample data carries a classification label; Using the training set, training a preset number of initial models to obtain a preset number of classification models; Inputting the sample data in the test set into each of the classification models to obtain a predicted classification result corresponding to each of the sample data, and adjusting the model attention of each of the sample data based on the predicted classification result and the classification label carried by the sample data; The classification models are trained again using the sample data after adjusting the model attention to obtain a trained classification model.
2. The method according to claim 1, characterized in that After obtaining the sample data, the method further includes: The behavior sample data is preprocessed; the preprocessing process includes at least one of data standardization, missing value processing, balancing processing, outlier processing and noise reduction.
3. The method according to claim 1, characterized in that The adjusting the model attention of each sample data based on the predicted classification result and the classification label carried by the sample data includes: Based on the predicted classification result and the classification label carried by the sample data, determining the number of classification models in which the predicted classification result is consistent with the classification label; Dividing the sample data into a plurality of data types based on the classification labels and the number of classification models whose predicted classification results are consistent with the classification labels; Based on the data type, the model attention corresponding to the sample data is adjusted.
4. The method according to claim 3, characterized in that The plurality of data types correspond one to one with the plurality of target model attention levels; The adjusting the model attention corresponding to the sample data based on the data type includes: The initial model attention degree corresponding to each sample data is adjusted to the target model attention degree corresponding to the data type of the sample data.
5. The method according to claim 1, wherein The initial model adopts at least two of the random forest algorithm, adaptive boosting algorithm, linear discriminant analysis algorithm, stacked pan-China algorithm and multi-layer perceptron algorithm.
6. The method according to claim 1, wherein After obtaining the trained classification model, the method further includes: Obtain data to be classified; The data to be classified is input into the trained classification model to obtain the classification result.
7. A training device for a classification model, characterized in that: The device comprises: An acquisition module is used to acquire sample data and divide it into a training set and a test set; the sample data carries a classification label; A first training module is configured to use the training set to train a preset number of initial models to obtain a preset number of classification models; An adjustment module, configured to input the sample data in the test set into each of the classification models, obtain a predicted classification result corresponding to each of the sample data, and adjust the model attention of each of the sample data based on the predicted classification result and the classification label carried by the sample data; The second training module is used to retrain each of the classification models using the sample data after adjusting the model attention to obtain a trained classification model.
8. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.