Classification model construction method and device, storage medium and electronic device

By determining the preset sample set and feature dimension weights in the construction of the classification model, combined with the iterative training of the ensemble learning algorithm, the problem of low classification accuracy caused by data imbalance is solved, and the classification accuracy and generalization ability of the model are improved.

CN114330135BActive Publication Date: 2024-08-23STATE GRID ZHEJIANG ELECTRIC POWER CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111667583.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2024-08-23
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

Existing classification model construction methods have low classification accuracy when faced with data imbalance, and cannot effectively handle the category tendency problem with large sample data.

Method used

By determining the feature weights of the preset sample set and feature dimensions, an integrated learning algorithm is used for iterative training, the feature dimensions and sample weights are adjusted, and the model is gradually optimized to improve classification accuracy.

Benefits of technology

In the case of data imbalance, the classification accuracy of the classification model is improved, and the generalization ability of the model is enhanced through the screening of feature dimensions and weight adjustment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114330135B
    Figure CN114330135B
Patent Text Reader

Abstract

The present invention provides a classification model construction method and device, storage medium and electronic device, the method comprising: determining a preset sample set and feature weights corresponding to each preset feature dimension, performing iterative training of a prediction model based on a preset ensemble learning algorithm, and in a current iteration cycle, determining an initial model corresponding to the iteration cycle and a training sample set corresponding to each training feature dimension corresponding to the iteration cycle. The initial model is trained with the training sample set to obtain a prediction model corresponding to the iteration cycle, and the feature weights corresponding to the current training feature dimension are updated to adjust each training feature dimension corresponding to the next iteration cycle. When the iterative training process is finished, the prediction models obtained by training are combined to obtain a classification model. By applying the method of the present invention, the features used for training can be adjusted, and the features that have a greater impact on classification can be used for training to improve the classification accuracy of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data classification, and in particular to a classification model construction method and device, a storage medium and an electronic device. Background Art

[0002] With the development of artificial intelligence technology, machine learning has been widely used in engineering applications in various fields, and classification models are one of the common application models.

[0003] Ensemble learning technology is one of the commonly used technologies for building classification models. It trains multiple classifiers and combines the trained multiple classifiers to obtain the final classification model. In the existing classification model construction process, the training sample set is usually directly used to train each classifier.

[0004] In the actual application process, the collected training samples have more or less data imbalance characteristics, that is, the number of sample data belonging to each category in the training sample set is unbalanced. If the training sample set is directly used for training, the output result of the classification model will tend to be the category with more sample data, making the classification accuracy of the classification model lower. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a classification model construction method to solve the problem of low classification accuracy of the classification model obtained by the existing training method.

[0006] The embodiment of the present invention also provides a classification model construction device to ensure the actual implementation and application of the above method.

[0007] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0008] A classification model construction method, comprising:

[0009] Determine a preset sample set and a feature weight corresponding to each preset feature dimension, wherein the preset sample set includes a plurality of preset samples corresponding to each preset category, and each of the preset samples includes feature data corresponding to each preset feature dimension;

[0010] Based on the preset sample set and the feature weight corresponding to each of the preset feature dimensions, at least one prediction model is obtained, and each of the prediction models is combined to obtain a classification model;

[0011] The obtaining at least one prediction model based on the preset sample set and the feature weight corresponding to each of the preset feature dimensions includes:

[0012] Iterative training of the prediction model is performed based on a preset ensemble learning algorithm. In a current iteration cycle, an initial model and a training sample set corresponding to the current iteration cycle are determined, wherein the training sample set includes a training sample corresponding to each of the preset samples, and each of the training samples includes feature data corresponding to each training feature dimension corresponding to the current iteration cycle in its corresponding preset sample;

[0013] Based on the training sample set, the initial model is trained to obtain a prediction model corresponding to the current iteration cycle;

[0014] Determine whether the current iteration cycle meets the preset end condition. If the current iteration cycle does not meet the preset end condition, determine the respective adjustment feature dimensions corresponding to the current iteration cycle and the feature weights corresponding to each of the adjustment feature dimensions based on the classification results of the initial model during the training process and the feature weights corresponding to each of the training feature dimensions, and enter the next iteration cycle; the adjustment feature dimensions are the feature dimensions in each of the training feature dimensions;

[0015] If the current iteration cycle meets the preset end condition, the iterative training process ends;

[0016] Among them, each of the preset feature dimensions is a training feature dimension corresponding to the first iteration cycle, and each of the adjustment feature dimensions corresponding to each iteration cycle is a training feature dimension corresponding to the next iteration cycle of the iteration cycle.

[0017] In the above method, optionally, the determining of the preset sample set includes:

[0018] Determine a plurality of initial samples corresponding to each of the preset categories;

[0019] Taking each initial sample corresponding to each preset category as a preset sample corresponding to the preset category;

[0020] Determine at least one target category in each of the preset categories;

[0021] For each initial sample corresponding to each target category, construct a synthetic sample corresponding to the initial sample;

[0022] The synthetic samples corresponding to each initial sample corresponding to each target category are used as preset samples corresponding to the target category to form the preset sample set.

[0023] In the above method, optionally, determining the feature weight corresponding to each preset feature dimension includes:

[0024] For each of the preset feature dimensions, determine a mean set and a standard deviation set corresponding to the preset feature dimension, wherein the mean set includes the sample data means corresponding to each of the preset categories, and each of the sample data means is the mean of each feature data corresponding to the preset feature dimension in each preset sample corresponding to the corresponding preset category; the standard deviation set includes the sample data standard deviation corresponding to each of the preset categories, and each of the sample data standard deviation is the standard deviation of each feature data corresponding to the preset feature dimension in each preset sample corresponding to the corresponding preset category;

[0025] Determine the inter-class difference value corresponding to each of the preset feature dimensions based on the mean value set and the standard deviation set corresponding to each of the preset feature dimensions;

[0026] For each of the preset feature dimensions, determine the first difference proportion corresponding to the preset feature dimension, and use the first difference proportion as the feature weight corresponding to the preset feature dimension, the first difference proportion is the ratio of the inter-class difference value corresponding to the preset feature dimension to the first difference sum value, and the first difference sum value is the sum of the inter-class difference values ​​corresponding to each of the preset feature dimensions.

[0027] In the above method, optionally, the above prediction models are combined to obtain a classification model, including:

[0028] For the prediction model corresponding to each iteration cycle, determining the error rate corresponding to the prediction model, and determining the fusion proportion corresponding to the prediction model based on the error rate;

[0029] Based on the fusion proportion corresponding to the prediction model corresponding to each iteration period, the prediction models corresponding to each iteration period are weighted combined, and the model obtained by the weighted combination is used as the classification model.

[0030] In the above method, optionally, the training of the initial model based on the training sample set includes:

[0031] Determine each sample weight corresponding to the current iteration cycle, wherein each sample weight corresponds one-to-one to each preset sample in the preset sample set;

[0032] Determine a training weight corresponding to each training sample in the training sample set, wherein the training weight corresponding to each training sample is a sample weight corresponding to a preset sample corresponding to the training sample;

[0033] The initial model is trained according to each training sample in the training sample set and its corresponding training weight, and the trained initial model is used as the prediction model corresponding to the current iteration cycle.

[0034] The above method, optionally, determines each adjustment feature dimension corresponding to the current iteration cycle and the feature weight corresponding to each adjustment feature dimension based on the classification result of the initial model during the training process and the feature weight corresponding to each training feature dimension, including:

[0035] Based on the classification result, determining a plurality of misclassified samples in the training sample set;

[0036] Determining an error classification ratio, where the error classification ratio is a ratio of the number of samples of the plurality of error classification samples to the number of samples of the training sample set;

[0037] Determine the error classification weight and update feature value corresponding to each training feature dimension corresponding to the current iteration cycle, each updated feature value is the sum of the feature weight corresponding to its corresponding training feature dimension and the target product, and the target product is the product of the error classification weight corresponding to its corresponding training feature dimension and the error classification proportion;

[0038] Determine an update weight corresponding to each training feature dimension corresponding to the current iteration cycle, where the update weight corresponding to each training feature dimension is a ratio of an update feature value corresponding to the training feature dimension to an update sum value, where the update sum value is the sum of update feature values ​​corresponding to each training feature dimension;

[0039] Compare the update weight corresponding to each of the training feature dimensions with the preset weight, and determine the training feature dimension whose corresponding update weight is greater than the preset weight as the adjustment feature dimension corresponding to the current iteration cycle;

[0040] The update weight corresponding to each of the adjustment feature dimensions is determined as the feature weight corresponding to each of the adjustment feature dimensions.

[0041] In the above method, optionally, determining the error classification weight corresponding to each training feature dimension corresponding to the current iteration cycle includes:

[0042] Determine, among the multiple misclassified samples, each misclassified sample corresponding to each preset category;

[0043] For each training feature dimension corresponding to the current iteration cycle, determine the error sample mean set and the error sample standard deviation set corresponding to the training feature dimension; the error sample mean set includes the error data mean corresponding to each of the preset categories, and each of the error data means is the mean of each feature data corresponding to the training feature dimension in each error classification sample corresponding to its corresponding preset category; the error sample standard deviation set includes the error data standard deviation corresponding to each of the preset categories, and each of the error data standard deviation is the standard deviation of each feature data corresponding to the training feature dimension in each error classification sample corresponding to its corresponding preset category;

[0044] Determine the inter-class difference value corresponding to each training feature dimension corresponding to the current iteration cycle based on the error sample mean set and the error sample standard deviation set corresponding to each training feature dimension corresponding to the current iteration cycle;

[0045] For each training feature dimension corresponding to the current iteration cycle, determine the second difference proportion corresponding to the training feature dimension, and use the second difference proportion as the misclassification weight corresponding to the training feature dimension, the second difference proportion being the ratio of the inter-class difference value corresponding to the training feature dimension to the second difference sum value, the second difference sum value being the sum of the inter-class difference values ​​corresponding to each training feature dimension corresponding to the current iteration cycle.

[0046] A classification model building device, comprising:

[0047] A first determining unit, configured to determine a preset sample set and a feature weight corresponding to each preset feature dimension, wherein the preset sample set includes a plurality of preset samples corresponding to each preset category, and each of the preset samples includes feature data corresponding to each preset feature dimension;

[0048] A combining unit, configured to obtain at least one prediction model based on the preset sample set and the feature weight corresponding to each of the preset feature dimensions, and to combine the prediction models to obtain a classification model;

[0049] The combined unit comprises:

[0050] A first determination subunit is used to perform iterative training of a prediction model based on a preset ensemble learning algorithm, and in a current iteration cycle, determine an initial model and a training sample set corresponding to the current iteration cycle, wherein the training sample set includes a training sample corresponding to each of the preset samples, and each of the training samples includes feature data corresponding to each training feature dimension corresponding to the current iteration cycle in its corresponding preset sample;

[0051] A training subunit, configured to train the initial model based on the training sample set to obtain a prediction model corresponding to the current iteration cycle;

[0052] A judgment subunit is used to judge whether the current iteration cycle meets the preset end condition. If the current iteration cycle does not meet the preset end condition, then based on the classification results of the initial model in the training process and the feature weights corresponding to each of the training feature dimensions, each adjustment feature dimension corresponding to the current iteration cycle and the feature weights corresponding to each of the adjustment feature dimensions are determined, and the next iteration cycle is entered; the adjustment feature dimensions are the feature dimensions in each of the training feature dimensions; if the current iteration cycle meets the preset end condition, the iterative training process is terminated;

[0053] Among them, each of the preset feature dimensions is a training feature dimension corresponding to the first iteration cycle, and each of the adjustment feature dimensions corresponding to each iteration cycle is a training feature dimension corresponding to the next iteration cycle of the iteration cycle.

[0054] A storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the classification model building method as described above.

[0055] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to execute the classification model building method as described above.

[0056] A classification model construction method is provided based on the above-mentioned embodiment of the present invention. The method includes: determining a preset sample set and a feature weight corresponding to each preset feature dimension, wherein the preset sample set includes a plurality of preset samples corresponding to each preset category, and each preset sample includes feature data corresponding to each preset feature dimension; performing iterative training based on the preset sample set, the feature weight corresponding to each preset feature dimension, and an integrated learning algorithm to obtain at least one prediction model, and combining each prediction model to obtain a classification model. In the iterative training process, in each iteration cycle except the last iteration cycle, each adjustment feature dimension corresponding to the iteration cycle is determined. In each iteration cycle, training is performed based on the training sample set corresponding to the iteration cycle, wherein the training sample set includes training samples corresponding to each preset sample, and each training sample includes feature data corresponding to each training feature dimension corresponding to the iteration cycle in its corresponding preset sample. The training feature dimensions corresponding to the first iteration cycle are the preset feature dimensions, and the adjustment feature dimensions corresponding to each iteration cycle are the training feature dimensions corresponding to the next iteration cycle of the iteration cycle. By applying the method provided in the embodiment of the present invention, during the iterative training process, the feature data of the feature dimensions contained in the training samples are determined based on the feature weights corresponding to the feature dimensions. The model can be trained using the feature data corresponding to the feature dimensions with greater effects to improve the classification accuracy of the obtained prediction model, thereby improving the classification accuracy of the combined classification model. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0058] Figure 1 A method flow chart of a classification model construction method provided by an embodiment of the present invention;

[0059] Figure 2 A schematic diagram of a process of constructing a synthetic sample provided by an embodiment of the present invention;

[0060] Figure 3 A method flow chart of another method for building a classification model provided by an embodiment of the present invention;

[0061] Figure 4 A schematic diagram of a process for determining a feature weight provided by an embodiment of the present invention;

[0062] Figure 5Another method flow chart of a classification model construction method provided by an embodiment of the present invention;

[0063] Figure 6 A schematic diagram of the structure of a classification model building device provided by an embodiment of the present invention;

[0064] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0065] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0066] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0067] As can be seen from the background technology, imbalanced data is one of the important factors that affect the effect of machine learning models. In reality, the data collected has more or less imbalanced characteristics. If the model is directly trained on this imbalanced data, the learning effect of the model will most likely tend to be biased towards the majority class samples. At present, the evaluation index of the model is usually the average precision. If 90% of the samples in the training set belong to the same category, the classifier may classify all samples into this category. In this case, the final classification accuracy is 90%, but in fact the classifier is invalid. Therefore, the classification accuracy of the classification model obtained by directly training with sample data is low.

[0068] Therefore, an embodiment of the present invention provides a classification model construction method, which can adjust the feature data used for training during the training process, use the feature data corresponding to the feature dimension with a greater effect to train the model, and improve the classification accuracy of the classification model.

[0069] The embodiment of the present invention provides a classification model construction method, which can be applied to a classification model construction system, and its execution subject can be a processor of the system. The method flow chart of the method is as follows: Figure 1 As shown, including:

[0070] S101: Determine a preset sample set and a feature weight corresponding to each preset feature dimension, wherein the preset sample set includes a plurality of preset samples corresponding to each preset category, and each of the preset samples includes feature data corresponding to each preset feature dimension;

[0071] In the method provided by an embodiment of the present invention, when it is necessary to build a classification model, a preset sample set for training the model can be determined, the preset sample set including multiple preset samples corresponding to each preset category that the model needs to learn to classify, each preset sample in the preset sample set contains feature data of each preset feature dimension, and the feature dimension refers to a certain attribute of the object described in the sample. For example, a preset sample describing a user contains relevant data on the user's gender, age, height, weight and home address, and gender, age, height, weight and home address are each feature dimension.

[0072] In the method provided by the embodiment of the present invention, the feature weight corresponding to each preset feature dimension can be determined based on a preset feature weight setting strategy, and the feature weight represents the importance of the feature data corresponding to the preset feature dimension in the classification process.

[0073] S102: performing iterative training of the prediction model based on a preset ensemble learning algorithm;

[0074] In the method provided by the embodiment of the present invention, at least one prediction model can be obtained based on the preset sample set and the feature weights corresponding to each of the preset feature dimensions, and each of the prediction models can be combined to obtain a classification model. Specifically, the prediction model can be iteratively trained based on a preset ensemble learning algorithm, and the prediction model obtained by training in each iteration cycle can be obtained by periodic iterative training.

[0075] S103: In the current iteration cycle, determine the initial model and training sample set corresponding to the current iteration cycle, the training sample set includes training samples corresponding to each of the preset samples, and each of the training samples includes feature data corresponding to each training feature dimension corresponding to the current iteration cycle in its corresponding preset sample;

[0076] In the method provided by the embodiment of the present invention, when entering the current iteration cycle of iterative training, the initial model and training sample set corresponding to the current iteration cycle can be determined. If the current iteration cycle is the first iteration cycle, a pre-built basic model can be used as the initial model, and the basic model can be a decision tree or a neural network model. If the current iteration cycle is not the first iteration cycle, the model with the smallest error rate can be selected as the initial model from the various prediction models trained in the previous iteration cycles, or a basic model can be constructed as the initial model.

[0077] Among them, each preset feature dimension is each training feature dimension corresponding to the first iteration cycle, and each adjustment feature dimension corresponding to each iteration cycle is each training feature dimension corresponding to the next iteration cycle of the iteration cycle. That is, the training sample set corresponding to the first iteration cycle is the preset sample set, and the training sample sets of other iteration cycles are the training sample sets obtained by feature screening based on the preset sample set and each adjustment feature dimension corresponding to the previous iteration cycle.

[0078] S104: Based on the training sample set, the initial model is trained to obtain a prediction model corresponding to the current iteration cycle;

[0079] In the method provided by the embodiment of the present invention, in the current iteration cycle, the corresponding initial model is trained based on its corresponding training sample set, and the trained initial model is used as the prediction model corresponding to the current iteration cycle.

[0080] S105: Determine whether the current iteration cycle meets a preset end condition;

[0081] In the method provided in the embodiment of the present invention, the end condition of the iterative training can be set according to the actual training requirements. For example, the total number of iterations can be preset. If the current number of iterations reaches the preset total number of iterations, the preset end condition is met. The classification accuracy threshold of the prediction model can also be preset. If the classification accuracy of the prediction model obtained by the current training reaches the preset threshold, the preset end condition is met.

[0082] After the prediction model of the current iteration cycle is obtained through training, it is determined whether the current iteration cycle meets the preset end condition. If the current iteration cycle does not meet the preset end condition, the process proceeds to step S106; if it does, the process proceeds to step S107.

[0083] S106: Based on the classification results of the initial model during the training process and the feature weight corresponding to each of the training feature dimensions, determine each of the adjustment feature dimensions corresponding to the current iteration cycle and the feature weight corresponding to each of the adjustment feature dimensions, and enter the next iteration cycle;

[0084] In the method provided by the embodiment of the present invention, if the current iteration cycle does not meet the preset end condition, then the respective adjusted feature dimensions corresponding to the current iteration cycle and the feature weights corresponding to each adjusted feature dimension are determined according to the classification results of the initial model corresponding to the current iteration cycle during the training process and the feature weights corresponding to each training feature dimension. The adjusted feature dimensions corresponding to the current iteration cycle are the feature dimensions among the training feature dimensions corresponding to the current iteration cycle. The classification results of the initial model during the training process are the classification results of the initial model when classifying each training sample.

[0085] S107: End the iterative training process and obtain at least one prediction model;

[0086] In the method provided by the embodiment of the present invention, if the current iteration cycle meets the preset end condition, the iterative training process is ended to obtain the prediction model trained in each iteration cycle. In the actual application process, there are usually multiple iteration cycles in the training process, so multiple prediction models are usually obtained.

[0087] S108: Combining the prediction models to obtain a classification model;

[0088] In the method provided by the embodiment of the present invention, the prediction models trained in each iteration cycle are combined, and the combined model is used as a classification model.

[0089] Based on the method provided by the embodiment of the present invention, multiple prediction models are obtained based on iterative training of an ensemble learning algorithm, and a classification model is obtained by combining the multiple prediction models. In this iterative training scenario, each preset feature dimension corresponding to the preset sample can be determined, and the feature weight corresponding to each preset feature dimension can be determined. During the training process, based on each training feature dimension corresponding to the current iteration cycle, the feature data corresponding to each training feature dimension can be screened out from each feature data contained in the preset sample as a training sample, and the training feature dimension corresponding to the next iteration cycle can be determined based on the classification result of the model during the current iteration cycle training process. Applying the method provided by the embodiment of the present invention, during the iterative training process, the feature dimensions used for training can be continuously adjusted according to the classification results, and the feature data corresponding to the feature dimensions with greater influence can be used to train the model. In the case of unbalanced sample data, the classification accuracy of the prediction model obtained by training can also be improved, thereby improving the classification accuracy of the classification model.

[0090] The ensemble learning algorithm mentioned in the method provided in the embodiment of the present invention refers to a class of algorithms that complete learning tasks by constructing and combining multiple learners, mainly including bagging algorithm, boosting algorithm and the like. Bagging algorithm refers to a guided aggregation (guided aggregation) algorithm, which improves the generalization error by reducing the variance of the base classifier. For example, M different trees can be trained with different subsets of the training set to calculate the final result. Boosting algorithm refers to a class of algorithms that convert weak learners into strong learners through an algorithm set. It mainly trains a series of weak learners, which refers to models that are only slightly better than random guessing, such as smaller decision trees, and are usually trained using weighted data, giving greater weights to misclassified data. The AdaBoost algorithm is one of the classic algorithms in the Boosting algorithm. AdaBoost first initializes a sample weight distribution, and then updates the sample weight distribution in each iteration, so that the prediction model can pay more attention to the learning of misclassified samples to improve the classification accuracy. In the method provided in the embodiment of the present invention, the AdaBoost algorithm can be used for iterative training.

[0091] In the method provided by the embodiment of the present invention, the classification accuracy of the constructed classification model can be improved from three levels, namely, the level for data, the level for features, and the level for classifiers. The level for data mainly refers to oversampling and undersampling. Oversampling is to increase the number of minority class samples, such as copying multiple copies of existing minority class sample data. Undersampling is to reduce the number of majority class samples, for example, randomly extracting samples equal to the number of minority class samples from the majority class samples. The level for features mainly refers to feature selection. The contributions of each dimensional feature of the data sample to the classification result are different. After some redundant features are removed, there is a positive effect on the classification effect. The level for classifiers refers to using ensemble learning to train multiple weak classifiers (prediction models), and finally weighted outputting the results of all weak classifiers (prediction models) as the output results of the strong classifier (classification model).

[0092] Further, based on the method provided in the above embodiment, in the method provided in the embodiment of the present invention, the process of determining the preset sample set mentioned in step S101 includes:

[0093] Determine a plurality of initial samples corresponding to each of the preset categories;

[0094] In the method provided by the embodiment of the present invention, multiple initial samples corresponding to each preset category can be obtained by collecting data, that is, multiple initial sample data classified as belonging to the preset category. Each initial sample also includes feature data corresponding to each preset feature dimension.

[0095] Determine at least one target category in each of the preset categories;

[0096] In the method provided by the embodiment of the present invention, at least one target category can be determined in each preset category based on the number of initial samples corresponding to each preset category. The target category is a category with a smaller number of initial samples. Specifically, the target category can be determined by comparing the number of samples with a preset number threshold.

[0097] For each initial sample corresponding to each target category, construct a synthetic sample corresponding to the initial sample;

[0098] In the method provided in the embodiment of the present invention, a synthetic sample corresponding to each initial sample corresponding to each target category is constructed. Specifically, the sample can be synthesized by using a synthetic minority oversampling technique (SMOTE).

[0099] like Figure 2 As shown in the flowchart, the construction process of the synthetic sample includes:

[0100] S201: For each sample in the minority class, find its k nearest neighbor samples in the minority class;

[0101] For each minority class, that is, each initial sample corresponding to each target category, find multiple corresponding neighbor samples in each initial sample corresponding to the target category.

[0102] S202: Randomly select a target neighbor sample from the neighbor samples, and synthesize a new sample between the sample and the target neighbor sample.

[0103] For each initial sample, randomly select the target neighbor sample B corresponding to the initial sample A from its corresponding neighbor samples, and generate a random number C between 0 and 1, C = rand (0, 1), to synthesize a new sample between A and B. The synthetic sample D corresponding to the initial sample A can be constructed according to: D = A + C (BA).

[0104] Each initial sample corresponding to each of the preset categories is used as a preset sample corresponding to the preset category; and the synthetic sample corresponding to each initial sample corresponding to each of the target categories is used as a preset sample corresponding to the target category to form the preset sample set.

[0105] In the method provided by an embodiment of the present invention, for each preset category, each corresponding initial sample is used as the preset sample corresponding to the preset category. If the preset category is a target category, the synthetic sample corresponding to each corresponding initial sample is also used as the preset sample corresponding to the preset category to obtain the preset sample set.

[0106] Based on the method provided in the embodiment of the present invention, for the minority class in the unbalanced samples, multiple new samples can be synthesized through the SMOTE algorithm to increase the number of samples corresponding to the category, so as to reduce the imbalance of the sample set, which is conducive to improving the classification accuracy of the model.

[0107] In order to better illustrate the method provided by the embodiment of the present invention, based on the method provided by the above embodiment, the general process of the classification model construction method provided by the embodiment of the present invention can be as follows: Figure 3 As shown, including:

[0108] S301: Use the SMOTE algorithm to synthesize a certain number of minority class samples;

[0109] In the method provided in the embodiment of the present invention, a certain number of new samples can be synthesized based on the initial samples for the categories with a small number of samples by using the SMOTE algorithm to obtain a sample set. Figure 2 The instructions provided will not be repeated here.

[0110] S302: Calculate the distribution of each dimension feature of the sample set on samples of different categories;

[0111] In the method provided by the embodiment of the present invention, the distribution of each dimension of feature on samples of different categories can be calculated through each feature data corresponding to each dimension of feature in the sample set, that is, each feature data corresponding to each preset feature dimension.

[0112] S303: assigning different classification weights to different dimensional features according to distribution conditions;

[0113] In the method provided in the embodiment of the present invention, the classification weight corresponding to each preset feature dimension, that is, the feature weight in the above embodiment, can be determined according to the distribution of the feature data of each preset feature dimension in each category.

[0114] S304: Use the AdaBoost algorithm to classify the unbalanced samples.

[0115] In the method provided by the embodiment of the present invention, each initial model can be trained with a sample set containing unbalanced sample data by using the AdaBoost algorithm to obtain each prediction model.

[0116] In order to better illustrate the method provided by the embodiment of the present invention, on the basis of the method provided by the above embodiment, in the method provided by the embodiment of the present invention, Figure 1The process of determining the feature weight corresponding to each preset feature dimension mentioned in step S101 of the method shown, that is, the process of steps S302 and S303 mentioned in the above embodiment, includes:

[0117] For each of the preset feature dimensions, determine a mean set and a standard deviation set corresponding to the preset feature dimension, wherein the mean set includes the sample data means corresponding to each of the preset categories, and each of the sample data means is the mean of each feature data corresponding to the preset feature dimension in each preset sample corresponding to the corresponding preset category; the standard deviation set includes the sample data standard deviation corresponding to each of the preset categories, and each of the sample data standard deviation is the standard deviation of each feature data corresponding to the preset feature dimension in each preset sample corresponding to the corresponding preset category;

[0118] Determine the inter-class difference value corresponding to each of the preset feature dimensions based on the mean value set and the standard deviation set corresponding to each of the preset feature dimensions;

[0119] For each of the preset feature dimensions, determine the first difference proportion corresponding to the preset feature dimension, and use the first difference proportion as the feature weight corresponding to the preset feature dimension, the first difference proportion is the ratio of the inter-class difference value corresponding to the preset feature dimension to the first difference sum value, and the first difference sum value is the sum of the inter-class difference values ​​corresponding to each of the preset feature dimensions.

[0120] In the method provided in the embodiment of the present invention, the principle process of determining the feature dimension corresponding to each preset feature dimension can be as follows: Figure 4 As shown, including:

[0121] Use Gauss probability density function to describe the distribution of each type of feature (preset feature dimension) in the feature set (preset sample set);

[0122] In the method provided in the embodiment of the present invention, the Gauss probability density function refers to a Gaussian probability density function, and its function expression is as follows:

[0123]

[0124] Among them, σ represents the standard deviation of all feature data corresponding to the Gauss probability density function, and μ represents the corresponding mean. When describing the distribution of a preset feature dimension in a certain category, all feature data corresponding to the function are the feature data corresponding to the preset feature dimension in each preset sample corresponding to the category. For data in a certain Gauss probability density function, the closer the value to the mean μ is, the greater the probability of taking the value, and the farther the value from the mean μ is, the smaller the probability of taking the value. The standard deviation σ represents the degree of data dispersion. The larger σ is, the more dispersed the data is, and the smaller σ is, the more concentrated the data is.

[0125] The inter-class differences of each dimension feature are measured by comparing the Gauss probability density functions of different categories;

[0126] In the method provided by the embodiment of the present invention, for each preset feature dimension, the inter-class difference corresponding to each preset feature dimension can be measured by the mean and standard deviation in the Gauss probability density function of each preset category. The inter-class difference corresponding to the preset feature dimension can be determined according to the following formula:

[0127]

[0128] Among them, d k Indicates the inter-class difference of the k-th dimension feature (k-th preset feature dimension), n is the number of categories, μ i represents the mean value of the feature data corresponding to the kth preset feature dimension in each preset sample corresponding to the i-th preset category, μ j Similarly. i Indicates the standard deviation of the feature data corresponding to the kth preset feature dimension in each preset sample corresponding to the i-th preset category, σ j Same reason.

[0129] According to the size of the difference between classes, the classification weight value is assigned to each dimension feature.

[0130] In the method provided in the embodiment of the present invention, the feature weight corresponding to each preset feature dimension, that is, the feature classification weight value of each feature, can be determined according to the size relationship between the inter-class differences corresponding to each preset feature dimension. Specifically, the feature weight can be determined using the following formula:

[0131]

[0132] Among them, w k represents the classification weight of the k-th dimension feature, that is, the feature weight, and z represents the number of dimensions of the feature, that is, the number of each preset feature dimension. In the method provided by the embodiment of the present invention, according to the distribution of each dimensional feature on samples of different categories, features with large distribution differences are assigned higher classification weights, and features with similar distributions are assigned lower classification weights.

[0133] Based on the above principle, in the method provided by the embodiment of the present invention, the mean set and standard deviation set corresponding to each preset feature dimension are determined. For each preset feature dimension, based on the mean set and standard deviation set corresponding to the preset feature dimension, the inter-class difference value corresponding to the preset feature dimension can be calculated by the principle shown in the above formula 2. According to the inter-class difference values ​​corresponding to each preset feature dimension, the first difference proportion corresponding to each preset feature dimension, that is, the feature weight corresponding to each preset feature dimension, can be calculated by the principle shown in the above formula 3.

[0134] In order to better illustrate the method provided by the embodiment of the present invention, Figure 1 On the basis of the method shown, in the method provided by the embodiment of the present invention, the process of combining the prediction models mentioned in step S108 to obtain the classification model includes:

[0135] For the prediction model corresponding to each iteration cycle, determining the error rate corresponding to the prediction model, and determining the fusion proportion corresponding to the prediction model based on the error rate;

[0136] In the method provided in the embodiment of the present invention, the AdaBoost algorithm is used for iterative training. The training process is weighted training, that is, each training sample used for training the model corresponds to a training weight, and training is performed according to each training weight during the training process. And in each iteration cycle t, for the prediction model h obtained by the training in the iteration cycle t , will determine the error rate corresponding to the prediction model. t The error rate can be determined by the following formula:

[0137]

[0138] Among them, ε t represents the error rate of the prediction model corresponding to the tth iteration cycle, D t (i) indicates the prediction model h in the training process of the tth iteration cycle t The training weights corresponding to the misclassified training samples. i represents the sample input of the training sample, y i Represents the sample output of the training sample.

[0139] Based on the error rate of each prediction model, the fusion weight corresponding to each prediction model can be determined. Specifically, it can be calculated using the following formula:

[0140]

[0141] Among them, α t Indicates the fusion weight corresponding to the prediction model trained in the t-th iteration cycle.

[0142] Based on the fusion proportion corresponding to the prediction model corresponding to each iteration period, the prediction models corresponding to each iteration period are weighted combined, and the model obtained by the weighted combination is used as the classification model.

[0143] In the method provided in the embodiment of the present invention, each prediction model can be weighted and combined according to the following formula to obtain a classification model.

[0144] Among them, S is the number of iteration cycles, and g(x) is the classification model obtained by combination.

[0145] In order to better illustrate the method provided by the embodiment of the present invention, on the basis of the method provided by the above embodiment, in the method provided by the embodiment of the present invention, the training of the initial model based on the training sample set mentioned in step S104 includes:

[0146] Determine each sample weight corresponding to the current iteration cycle, wherein each sample weight corresponds one-to-one to each preset sample in the preset sample set;

[0147] In the method provided by the embodiment of the present invention, the AdaBoost algorithm is used to perform iterative training of the model. During the entire iterative training process, the sample weight corresponding to each preset sample can be initialized first. For example, the sample weight of each sample in the preset sample set T{x, y|x∈X, y∈Y} with a capacity of m is initialized to 1 / m, that is, in the first iteration cycle of the AdaBoost algorithm, the weights of all samples are:

[0148] D1(i)=1 / m

[0149] Wherein, D1(i) represents the sample weight corresponding to the i-th preset sample in the first iteration cycle.

[0150] In each iteration cycle, the sample weights corresponding to each preset sample will be updated according to the prediction model trained in the current iteration cycle and the sample weights corresponding to the current iteration cycle to obtain the sample weights corresponding to the next iteration cycle. The updating principle formula can be shown as follows:

[0151]

[0152] Among them, D t (i) is the sample weight corresponding to the i-th preset sample in iteration cycle t, D t+1(i) is the sample weight corresponding to the i-th preset sample after update, that is, the sample weight corresponding to the i-th preset sample in the iteration cycle t+1. Based on the above principle, the sample weight corresponding to the wrongly classified samples can be increased, and the weight of the correctly classified samples can be reduced, so that the wrongly classified samples are highlighted to obtain a new sample distribution, and these wrongly classified samples will be considered more in the next training.

[0153] Determine a training weight corresponding to each training sample in the training sample set, wherein the training weight corresponding to each training sample is a sample weight corresponding to a preset sample corresponding to the training sample;

[0154] In the method provided by the embodiment of the present invention, the training weight of the corresponding training sample can be determined based on the sample weight corresponding to each preset sample.

[0155] The initial model is trained according to each training sample in the training sample set and its corresponding training weight, and the trained initial model is used as the prediction model corresponding to the current iteration cycle.

[0156] In the method provided by the embodiment of the present invention, the initial model is trained based on each training sample and the training weight corresponding to each training sample to obtain the prediction model corresponding to the iteration cycle.

[0157] Further, on the basis of the method provided in the above embodiment, in the method provided in the embodiment of the present invention, the process mentioned in step S106 of determining each adjustment feature dimension corresponding to the current iteration cycle and the feature weight corresponding to each adjustment feature dimension based on the classification result of the initial model during the training process and the feature weight corresponding to each training feature dimension includes:

[0158] Based on the classification result, determining a plurality of misclassified samples in the training sample set;

[0159] In the method provided by the embodiment of the present invention, each misclassified sample can be determined based on the classification result of each training sample during the training process of the initial model of the current iteration cycle, that is, the sample that is misclassified by the initial model during the training process.

[0160] Determining an error classification ratio, where the error classification ratio is a ratio of the number of samples of the plurality of error classification samples to the number of samples of the training sample set;

[0161] In the method provided by the embodiment of the present invention, the number of misclassified samples can be counted, and the ratio of the number of samples to the total number of training samples in the training sample set is used as the misclassification proportion.

[0162] Determine the error classification weight and update feature value corresponding to each training feature dimension corresponding to the current iteration cycle, each updated feature value is the sum of the feature weight corresponding to its corresponding training feature dimension and the target product, and the target product is the product of the error classification weight corresponding to its corresponding training feature dimension and the error classification proportion;

[0163] In the method provided by the embodiment of the present invention, based on the principle of determining the feature weight corresponding to the feature dimension, the error classification weight corresponding to each training feature dimension can be determined, and the product of the error classification weight and the error classification proportion corresponding to each training feature dimension can be used as the target product corresponding to the training feature dimension. The sum of the feature weight corresponding to each training feature dimension and the target product corresponding to it can be used as the updated feature value corresponding to each training feature dimension.

[0164] Determine an update weight corresponding to each training feature dimension corresponding to the current iteration cycle, where the update weight corresponding to each training feature dimension is a ratio of an update feature value corresponding to the training feature dimension to an update sum value, where the update sum value is the sum of update feature values ​​corresponding to each training feature dimension;

[0165] In the method provided by the embodiment of the present invention, the updated feature values ​​corresponding to each training feature dimension can be added, and the sum of the additions can be used as the updated sum value. For each training feature dimension, the corresponding update weight can be determined according to the ratio of its corresponding updated feature value to the updated sum value. Specifically, the update weight corresponding to each training feature dimension can be determined according to the following formula:

[0166]

[0167] Among them, w k,t+1 represents the update weight corresponding to the kth training feature dimension, w k,t represents the feature weight corresponding to the kth training feature dimension, w k,false represents the misclassification weight corresponding to the kth training feature dimension, β represents the misclassification proportion, and n represents the number of training feature dimensions. According to the above principle, the weight of the feature dimension with large inter-class differences in feature distribution in the misclassified samples can be increased, and the weight of the feature dimension with small inter-class differences in feature distribution in the misclassified samples can be reduced.

[0168] Compare the update weight corresponding to each of the training feature dimensions with the preset weight, and determine the training feature dimension whose corresponding update weight is greater than the preset weight as the adjustment feature dimension corresponding to the current iteration cycle;

[0169] In the method provided by the embodiment of the present invention, a weight threshold can be set according to the measure of the influence of the feature dimension, and the update weight corresponding to each current training feature dimension can be compared with the preset weight. The training feature dimension with an update weight greater than the preset weight is determined as an adjusted feature dimension, and its corresponding feature data can still be used for model training, while the training feature dimension with an update weight less than or equal to the preset weight is no longer used for model training. The screening formula for feature dimensions is as follows:

[0170] columns t+1 ={column i |if w i,t+1 >τ}

[0171] (Formula 9)

[0172] Among them, columns t+1 Indicates the adjustment of feature dimension set, column i Represents the set of training feature dimensions, and τ represents the preset weight.

[0173] The update weight corresponding to each of the adjustment feature dimensions is determined as the feature weight corresponding to each of the adjustment feature dimensions.

[0174] In the method provided by the embodiment of the present invention, the update weight corresponding to each adjusted feature dimension is determined as the feature weight corresponding to the adjusted feature dimension.

[0175] Further, based on the method provided in the above embodiment, in the method provided in the embodiment of the present invention, the process of determining the error classification weight corresponding to each training feature dimension corresponding to the current iteration cycle includes:

[0176] Determine, among the multiple misclassified samples, each misclassified sample corresponding to each preset category;

[0177] In the method provided by the embodiment of the present invention, each misclassified sample corresponding to each preset category can be determined based on the preset category corresponding to each misclassified sample.

[0178] For each training feature dimension corresponding to the current iteration cycle, determine the error sample mean set and the error sample standard deviation set corresponding to the training feature dimension; the error sample mean set includes the error data mean corresponding to each of the preset categories, and each of the error data means is the mean of each feature data corresponding to the training feature dimension in each error classification sample corresponding to its corresponding preset category; the error sample standard deviation set includes the error data standard deviation corresponding to each of the preset categories, and each of the error data standard deviation is the standard deviation of each feature data corresponding to the training feature dimension in each error classification sample corresponding to its corresponding preset category;

[0179] In the method provided by an embodiment of the present invention, for each training feature dimension, the mean and standard deviation of the feature data corresponding to the training feature dimension in each erroneous classification sample corresponding to each preset category can be calculated, and the mean and standard deviation are used as the mean and standard deviation of the erroneous data corresponding to the preset category and the training feature dimension, so as to obtain a set of erroneous sample means and a set of erroneous sample standard deviations corresponding to each training feature dimension.

[0180] Determine the inter-class difference value corresponding to each training feature dimension corresponding to the current iteration cycle based on the error sample mean set and the error sample standard deviation set corresponding to each training feature dimension corresponding to the current iteration cycle;

[0181] In the method provided by the embodiment of the present invention, the inter-class difference value corresponding to each training feature dimension can be determined based on the principle shown in Formula 2 in the above embodiment. When the inter-class difference value corresponding to a certain training feature dimension is calculated by applying the principle shown in Formula 2, the mean corresponding to the preset category is the mean of the erroneous data corresponding to the preset category in the set of erroneous sample means corresponding to the training feature dimension, and the standard deviation corresponding to the preset category is the standard deviation of the erroneous data corresponding to the preset category in the set of erroneous data standard deviations corresponding to the training feature dimension.

[0182] For each training feature dimension corresponding to the current iteration cycle, determine the second difference proportion corresponding to the training feature dimension, and use the second difference proportion as the misclassification weight corresponding to the training feature dimension, the second difference proportion being the ratio of the inter-class difference value corresponding to the training feature dimension to the second difference sum value, the second difference sum value being the sum of the inter-class difference values ​​corresponding to each training feature dimension corresponding to the current iteration cycle.

[0183] In the method provided in the embodiment of the present invention, based on the principle shown in Formula 3 in the above embodiment, the second difference proportion corresponding to each training feature dimension can be calculated and used as the corresponding misclassification weight.

[0184] In order to better illustrate the method provided by the embodiment of the present invention, Figure 5 As shown in the flowchart, the embodiment of the present invention provides another classification model construction method, so as to further briefly explain the classification model construction process provided by the embodiment of the present invention. Figure 5 As shown in Figure 1, the construction process of the classification model includes:

[0185] S401: Initialize sample weights;

[0186] For each preset sample in the preset sample set, the corresponding sample weight is initialized. For each preset feature dimension, the corresponding feature weight is initialized according to the principles shown in Formula 2 and Formula 3 provided in the above embodiment.

[0187] S402: Setting the number of iterations and feature weight thresholds;

[0188] The number of iterations and feature weight thresholds can be set according to actual training requirements.

[0189] S403: Obtaining a prediction model and error rate under the current sample weight distribution;

[0190] According to the preset iterative training algorithm, under the current sample weight distribution, a prediction model is trained and the error rate of the prediction model is determined. The principle of the process can be found in the description provided in conjunction with formula 4 in the above embodiment, and will not be repeated here.

[0191] S404: Obtaining the proportion of the current prediction model in all prediction models;

[0192] According to the error rate of the current prediction model, the corresponding fusion weight is determined. The principle of the process can be found in the description provided in the above embodiment in combination with Formula 5, which will not be repeated here.

[0193] S405: Update sample weight distribution according to the classification result of the current prediction model;

[0194] Referring to the description provided above in combination with Formula 7, the sample weight distribution is updated according to the classification result of the current prediction model and the current sample weight distribution, that is, the sample weight corresponding to each preset sample is updated.

[0195] S406: Update feature weights according to the classification results of the current prediction model;

[0196] Referring to the description provided above in combination with Formula 8 and Formula 9, the feature weights of the feature dimensions are updated according to the classification results of the current prediction model and the current feature weight distribution, and the feature dimensions are screened according to the updated feature weights to obtain new feature dimension distribution and feature weight distribution.

[0197] S407: Determine whether the number of iteration rounds has been reached;

[0198] It is determined whether the number of iterative trainings has reached the preset number of iterations. If so, the process proceeds to step S408. If not, the process from S403 to S406 is performed again according to the updated sample weight distribution, feature dimension distribution, and feature weight distribution to obtain a new prediction model through iterative training.

[0199] S408: According to the weight of each prediction model, each trained prediction model is combined into a strong prediction model.

[0200] After the iterative training is completed, the various prediction models can be combined in combination with the principle shown in Formula 6 mentioned above to obtain a strong prediction model, which is used as the final classification model.

[0201] and Figure 1 Corresponding to the classification model construction method shown in FIG. 1 , the embodiment of the present invention further provides a classification model construction device for Figure 1 The specific implementation of the method shown in is shown in the structural diagram Figure 6 As shown, including:

[0202] A first determining unit 501 is used to determine a preset sample set and a feature weight corresponding to each preset feature dimension, wherein the preset sample set includes a plurality of preset samples corresponding to each preset category, and each of the preset samples includes feature data corresponding to each preset feature dimension;

[0203] A combining unit 502 is used to obtain at least one prediction model based on the preset sample set and the feature weight corresponding to each of the preset feature dimensions, and to combine the prediction models to obtain a classification model;

[0204] The combination unit 502 includes: a first determination subunit 503, which is used to perform iterative training of the prediction model based on a preset ensemble learning algorithm, and in a current iteration cycle, determine an initial model and a training sample set corresponding to the current iteration cycle, wherein the training sample set includes a training sample corresponding to each of the preset samples, and each of the training samples includes feature data corresponding to each training feature dimension corresponding to the current iteration cycle in its corresponding preset sample;

[0205] A training subunit 504 is used to train the initial model based on the training sample set to obtain a prediction model corresponding to the current iteration cycle;

[0206] The judgment subunit 505 is used to judge whether the current iteration cycle meets the preset end condition. If the current iteration cycle does not meet the preset end condition, then based on the classification result of the initial model in the training process and the feature weight corresponding to each of the training feature dimensions, the respective adjustment feature dimensions corresponding to the current iteration cycle and the feature weight corresponding to each of the adjustment feature dimensions are determined, and the next iteration cycle is entered; the adjustment feature dimensions are the feature dimensions in each of the training feature dimensions; if the current iteration cycle meets the preset end condition, the iterative training process is terminated;

[0207] Among them, each of the preset feature dimensions is a training feature dimension corresponding to the first iteration cycle, and each of the adjustment feature dimensions corresponding to each iteration cycle is a training feature dimension corresponding to the next iteration cycle of the iteration cycle.

[0208] Based on the device provided by the embodiment of the present invention, multiple prediction models are obtained based on iterative training of the ensemble learning algorithm, and a classification model is obtained by combining the multiple prediction models. In this iterative training scenario, each preset feature dimension corresponding to the preset sample can be determined, and the feature weight corresponding to each preset feature dimension can be determined. During the training process, based on each training feature dimension corresponding to the current iteration cycle, the feature data corresponding to each training feature dimension can be screened out from the feature data contained in the preset sample as a training sample, and the training feature dimension corresponding to the next iteration cycle can be determined based on the classification result of the model during the current iteration cycle training process. Using the device provided by the embodiment of the present invention, during the iterative training process, the feature dimensions used for training can be continuously adjusted according to the classification results, and the model can be trained using the feature data corresponding to the feature dimensions with greater influence. In the case of unbalanced sample data, the classification accuracy of the prediction model obtained by training can also be improved, thereby improving the classification accuracy of the classification model.

[0209] On the basis of the device provided in the above-mentioned embodiment, in the device provided in the embodiment of the present invention, the first determination unit 501 includes: a second determination subunit, used to determine multiple initial samples corresponding to each of the preset categories; taking each initial sample corresponding to each of the preset categories as a preset sample corresponding to the preset category; determining at least one target category in each of the preset categories; a third determination subunit, used to construct a synthetic sample corresponding to each initial sample corresponding to each of the target categories; taking the synthetic sample corresponding to each initial sample corresponding to each of the target categories as the preset sample corresponding to the target category to form the preset sample set.

[0210] On the basis of the device provided by the above embodiment, in the device provided by the embodiment of the present invention, the first determining unit 501 includes: a fourth determining subunit, used to determine, for each of the preset feature dimensions, a mean set and a standard deviation set corresponding to the preset feature dimension, the mean set includes the sample data mean corresponding to each of the preset categories, and each of the sample data mean is the mean of each feature data corresponding to the preset feature dimension in each preset sample corresponding to the corresponding preset category; the standard deviation set includes the sample data standard deviation corresponding to each of the preset categories, and each of the sample data standard deviation is the standard deviation of each feature data corresponding to the preset feature dimension in each preset sample corresponding to the corresponding preset category; based on the mean set and the standard deviation set corresponding to each of the preset feature dimensions, determine the inter-class difference value corresponding to each of the preset feature dimensions; a fifth determining subunit, used to determine, for each of the preset feature dimensions, a first difference proportion corresponding to the preset feature dimension, and use the first difference proportion as the feature weight corresponding to the preset feature dimension, the first difference proportion being the ratio of the inter-class difference value corresponding to the preset feature dimension to the first difference sum value, and the first difference sum value being the sum of the inter-class difference values ​​corresponding to each of the preset feature dimensions.

[0211] On the basis of the device provided in the above-mentioned embodiment, in the device provided in the embodiment of the present invention, the combination unit 502 includes: a sixth determination subunit, used to determine the error rate corresponding to the prediction model corresponding to each of the iteration cycles, and determine the fusion proportion corresponding to the prediction model based on the error rate; a weighted combination subunit, used to perform weighted combination of the prediction models corresponding to each of the iteration cycles based on the fusion proportion corresponding to the prediction model corresponding to each of the iteration cycles, and use the model obtained by the weighted combination as the classification model.

[0212] On the basis of the device provided in the above-mentioned embodiment, in the device provided in the embodiment of the present invention, the training subunit includes: a seventh determination subunit, used to determine the weights of each sample corresponding to the current iteration cycle, and each sample weight corresponds one-to-one to each preset sample in the preset sample set; determine the training weight corresponding to each training sample in the training sample set, and the training weight corresponding to each training sample is the sample weight corresponding to the preset sample corresponding to the training sample; a weighted training subunit, used to train the initial model according to each training sample in the training sample set and its corresponding training weight, and use the trained initial model as the prediction model corresponding to the current iteration cycle.

[0213] On the basis of the device provided in the above embodiment, in the device provided in the embodiment of the present invention, the judging subunit includes: an eighth determining subunit, used to determine a plurality of misclassified samples in the training sample set based on the classification result; determine the misclassification proportion, wherein the misclassification proportion is the ratio of the number of samples of the plurality of misclassified samples to the number of samples of the training sample set; a ninth determining subunit, used to determine the misclassification weight and the updated feature value corresponding to each training feature dimension corresponding to the current iteration cycle, wherein each updated feature value is the sum of the feature weight corresponding to the corresponding training feature dimension and the target product, wherein the target product is the misclassification weight corresponding to the corresponding training feature dimension. The product of the class weight and the misclassification proportion; determining the update weight corresponding to each training feature dimension corresponding to the current iteration cycle, the update weight corresponding to each training feature dimension is the ratio of the update feature value corresponding to the training feature dimension to the update sum value, and the update sum value is the sum of the update feature values ​​corresponding to each training feature dimension; a comparison subunit is used to compare the update weight corresponding to each training feature dimension with the preset weight, and determine the training feature dimension whose corresponding update weight is greater than the preset weight as the adjustment feature dimension corresponding to the current iteration cycle; determine the update weight corresponding to each adjustment feature dimension as the feature weight corresponding to each adjustment feature dimension.

[0214] On the basis of the device provided by the above-mentioned embodiment, in the device provided by the embodiment of the present invention, the ninth determination subunit includes: a tenth determination subunit, which is used to determine, among the multiple erroneously classified samples, each erroneously classified sample corresponding to each of the preset categories; for each training feature dimension corresponding to the current iteration cycle, determine the set of error sample means and the set of error sample standard deviations corresponding to the training feature dimension; the set of error sample means includes the mean of error data corresponding to each of the preset categories, and each of the error data means is the mean of each feature data corresponding to the training feature dimension in each erroneously classified sample corresponding to the corresponding preset category; the set of error sample standard deviations includes the standard deviation of error data corresponding to each of the preset categories, and each of the error data standard deviations is The standard deviation of each feature data corresponding to the training feature dimension in each erroneous classification sample corresponding to the preset category should be determined; the eleventh determination subunit is used to determine the inter-class difference value corresponding to each training feature dimension corresponding to the current iteration cycle based on the set of erroneous sample means and the set of erroneous sample standard deviations corresponding to each training feature dimension corresponding to the current iteration cycle; for each training feature dimension corresponding to the current iteration cycle, determine the second difference proportion corresponding to the training feature dimension, and use the second difference proportion as the error classification weight corresponding to the training feature dimension, the second difference proportion is the ratio of the inter-class difference value corresponding to the training feature dimension to the second difference sum value, and the second difference sum value is the sum of the inter-class difference values ​​corresponding to each training feature dimension corresponding to the current iteration cycle.

[0215] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the classification model building method as described above.

[0216] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Figure 7 As shown, it specifically includes a memory 601 and one or more instructions 602, wherein the one or more instructions 602 are stored in the memory 601 and are configured to be executed by one or more processors 603 to perform the following operations:

[0217] Determine a preset sample set and a feature weight corresponding to each preset feature dimension, wherein the preset sample set includes a plurality of preset samples corresponding to each preset category, and each of the preset samples includes feature data corresponding to each preset feature dimension;

[0218] Based on the preset sample set and the feature weight corresponding to each of the preset feature dimensions, at least one prediction model is obtained, and each of the prediction models is combined to obtain a classification model;

[0219] The obtaining at least one prediction model based on the preset sample set and the feature weight corresponding to each of the preset feature dimensions includes:

[0220] Iterative training of the prediction model is performed based on a preset ensemble learning algorithm. In a current iteration cycle, an initial model and a training sample set corresponding to the current iteration cycle are determined, wherein the training sample set includes a training sample corresponding to each of the preset samples, and each of the training samples includes feature data corresponding to each training feature dimension corresponding to the current iteration cycle in its corresponding preset sample;

[0221] Based on the training sample set, the initial model is trained to obtain a prediction model corresponding to the current iteration cycle;

[0222] Determine whether the current iteration cycle meets the preset end condition. If the current iteration cycle does not meet the preset end condition, determine the respective adjustment feature dimensions corresponding to the current iteration cycle and the feature weights corresponding to each of the adjustment feature dimensions based on the classification results of the initial model during the training process and the feature weights corresponding to each of the training feature dimensions, and enter the next iteration cycle; the adjustment feature dimensions are the feature dimensions in each of the training feature dimensions;

[0223] If the current iteration cycle meets the preset end condition, the iterative training process ends;

[0224] Among them, each of the preset feature dimensions is a training feature dimension corresponding to the first iteration cycle, and each of the adjustment feature dimensions corresponding to each iteration cycle is a training feature dimension corresponding to the next iteration cycle of the iteration cycle.

[0225] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0226] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0227] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A classification model construction method, characterized in that: include: Determine a preset sample set and a feature weight corresponding to each preset feature dimension, wherein the preset sample set includes a plurality of preset samples corresponding to each preset category, and each of the preset samples includes feature data corresponding to each preset feature dimension; Based on the preset sample set and the feature weight corresponding to each of the preset feature dimensions, at least one prediction model is obtained, and each of the prediction models is combined to obtain a classification model; The obtaining at least one prediction model based on the preset sample set and the feature weight corresponding to each of the preset feature dimensions includes: Iterative training of the prediction model is performed based on a preset ensemble learning algorithm. In a current iteration cycle, an initial model and a training sample set corresponding to the current iteration cycle are determined, wherein the training sample set includes a training sample corresponding to each of the preset samples, and each of the training samples includes feature data corresponding to each training feature dimension corresponding to the current iteration cycle in its corresponding preset sample; Based on the training sample set, the initial model is trained to obtain a prediction model corresponding to the current iteration cycle; Determine whether the current iteration cycle meets the preset end condition. If the current iteration cycle does not meet the preset end condition, determine the respective adjustment feature dimensions corresponding to the current iteration cycle and the feature weights corresponding to each of the adjustment feature dimensions based on the classification results of the initial model during the training process and the feature weights corresponding to each of the training feature dimensions, and enter the next iteration cycle; the adjustment feature dimensions are the feature dimensions in each of the training feature dimensions; If the current iteration cycle meets the preset end condition, the iterative training process ends; Among them, each of the preset feature dimensions is a training feature dimension corresponding to the first iteration cycle, and each of the adjustment feature dimensions corresponding to each iteration cycle is a training feature dimension corresponding to the next iteration cycle of the iteration cycle.

2. The method according to claim 1, characterized in that The step of determining a preset sample set includes: Determine a plurality of initial samples corresponding to each of the preset categories; Taking each initial sample corresponding to each of the preset categories as a preset sample corresponding to the preset category; Determine at least one target category in each of the preset categories; For each initial sample corresponding to each target category, construct a synthetic sample corresponding to the initial sample; The synthetic samples corresponding to each initial sample corresponding to each target category are used as preset samples corresponding to the target category to form the preset sample set.

3. The method according to claim 1, characterized in that The determining of the feature weight corresponding to each preset feature dimension includes: For each of the preset feature dimensions, determine a mean set and a standard deviation set corresponding to the preset feature dimension, wherein the mean set includes the sample data means corresponding to each of the preset categories, and each of the sample data means is the mean of each feature data corresponding to the preset feature dimension in each preset sample corresponding to the corresponding preset category; the standard deviation set includes the sample data standard deviation corresponding to each of the preset categories, and each of the sample data standard deviation is the standard deviation of each feature data corresponding to the preset feature dimension in each preset sample corresponding to the corresponding preset category; Determine the inter-class difference value corresponding to each of the preset feature dimensions based on the mean value set and the standard deviation set corresponding to each of the preset feature dimensions; For each of the preset feature dimensions, determine the first difference proportion corresponding to the preset feature dimension, and use the first difference proportion as the feature weight corresponding to the preset feature dimension, the first difference proportion is the ratio of the inter-class difference value corresponding to the preset feature dimension to the first difference sum value, and the first difference sum value is the sum of the inter-class difference values ​​corresponding to each of the preset feature dimensions.

4. The method according to claim 1, characterized in that: The said combining the prediction models to obtain a classification model comprises: For the prediction model corresponding to each iteration cycle, determining the error rate corresponding to the prediction model, and determining the fusion proportion corresponding to the prediction model based on the error rate; Based on the fusion proportion corresponding to the prediction model corresponding to each iteration period, the prediction models corresponding to each iteration period are weighted combined, and the model obtained by the weighted combination is used as the classification model.

5. The method according to claim 1, characterized in that The step of training the initial model based on the training sample set includes: Determine each sample weight corresponding to the current iteration cycle, wherein each sample weight corresponds one-to-one to each preset sample in the preset sample set; Determine a training weight corresponding to each training sample in the training sample set, wherein the training weight corresponding to each training sample is a sample weight corresponding to a preset sample corresponding to the training sample; The initial model is trained according to each training sample in the training sample set and its corresponding training weight, and the trained initial model is used as the prediction model corresponding to the current iteration cycle.

6. The method according to claim 1, characterized in that The determining, based on the classification result of the initial model in the training process and the feature weight corresponding to each of the training feature dimensions, each of the adjustment feature dimensions corresponding to the current iteration cycle and the feature weight corresponding to each of the adjustment feature dimensions comprises: Based on the classification result, determining a plurality of misclassified samples in the training sample set; Determining an error classification ratio, where the error classification ratio is a ratio of the number of samples of the plurality of error classification samples to the number of samples of the training sample set; Determine the error classification weight and update feature value corresponding to each training feature dimension corresponding to the current iteration cycle, each updated feature value is the sum of the feature weight corresponding to its corresponding training feature dimension and the target product, and the target product is the product of the error classification weight corresponding to its corresponding training feature dimension and the error classification proportion; Determine an update weight corresponding to each training feature dimension corresponding to the current iteration cycle, where the update weight corresponding to each training feature dimension is a ratio of an update feature value corresponding to the training feature dimension to an update sum value, where the update sum value is the sum of update feature values ​​corresponding to each training feature dimension; Compare the update weight corresponding to each of the training feature dimensions with the preset weight, and determine the training feature dimension whose corresponding update weight is greater than the preset weight as the adjustment feature dimension corresponding to the current iteration cycle; The update weight corresponding to each of the adjustment feature dimensions is determined as the feature weight corresponding to each of the adjustment feature dimensions.

7. The method according to claim 6, characterized in that The determining the error classification weight corresponding to each training feature dimension corresponding to the current iteration cycle includes: Determine, among the multiple misclassified samples, each misclassified sample corresponding to each preset category; For each training feature dimension corresponding to the current iteration cycle, determine the error sample mean set and the error sample standard deviation set corresponding to the training feature dimension; the error sample mean set includes the error data mean corresponding to each of the preset categories, and each of the error data means is the mean of each feature data corresponding to the training feature dimension in each error classification sample corresponding to its corresponding preset category; the error sample standard deviation set includes the error data standard deviation corresponding to each of the preset categories, and each of the error data standard deviation is the standard deviation of each feature data corresponding to the training feature dimension in each error classification sample corresponding to its corresponding preset category; Determine the inter-class difference value corresponding to each training feature dimension corresponding to the current iteration cycle based on the error sample mean set and the error sample standard deviation set corresponding to each training feature dimension corresponding to the current iteration cycle; For each training feature dimension corresponding to the current iteration cycle, determine the second difference proportion corresponding to the training feature dimension, and use the second difference proportion as the misclassification weight corresponding to the training feature dimension, the second difference proportion being the ratio of the inter-class difference value corresponding to the training feature dimension to the second difference sum value, the second difference sum value being the sum of the inter-class difference values ​​corresponding to each training feature dimension corresponding to the current iteration cycle.

8. A classification model building device, characterized in that: include: A first determining unit, configured to determine a preset sample set and a feature weight corresponding to each preset feature dimension, wherein the preset sample set includes a plurality of preset samples corresponding to each preset category, and each of the preset samples includes feature data corresponding to each preset feature dimension; A combining unit, configured to obtain at least one prediction model based on the preset sample set and the feature weight corresponding to each of the preset feature dimensions, and to combine the prediction models to obtain a classification model; The combined unit comprises: A first determination subunit is used to perform iterative training of a prediction model based on a preset ensemble learning algorithm, and in a current iteration cycle, determine an initial model and a training sample set corresponding to the current iteration cycle, wherein the training sample set includes a training sample corresponding to each of the preset samples, and each of the training samples includes feature data corresponding to each training feature dimension corresponding to the current iteration cycle in its corresponding preset sample; A training subunit, configured to train the initial model based on the training sample set to obtain a prediction model corresponding to the current iteration cycle; A judgment subunit is used to judge whether the current iteration cycle meets the preset end condition. If the current iteration cycle does not meet the preset end condition, then based on the classification results of the initial model in the training process and the feature weights corresponding to each of the training feature dimensions, each adjustment feature dimension corresponding to the current iteration cycle and the feature weights corresponding to each of the adjustment feature dimensions are determined, and the next iteration cycle is entered; the adjustment feature dimensions are the feature dimensions in each of the training feature dimensions; if the current iteration cycle meets the preset end condition, the iterative training process is terminated; Among them, each of the preset feature dimensions is a training feature dimension corresponding to the first iteration cycle, and each of the adjustment feature dimensions corresponding to each iteration cycle is a training feature dimension corresponding to the next iteration cycle of the iteration cycle.

9. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the classification model building method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: It comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to execute the classification model building method as described in any one of claims 1 to 7.