Data classification method and device
Through the hybrid classification model, combining the advantages of the first model and the second model, and utilizing the individual and group characteristics of the data, the problem of low data classification accuracy under a single model is solved, and higher classification accuracy and stability are achieved.
Patent Information
- Application Number
- CN202410849821.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-10-01
AI Technical Summary
In the existing technology, when a single model is used for data classification, due to different data characteristics in different scenarios, the classification accuracy is low and the stability is poor, and the accuracy of data classification cannot be effectively improved.
Use a hybrid classification model, combining the first model and the second model, by extracting the individual characteristics and group characteristics of the data, using the local tendency of the first model and the overall generalization ability of the second model to classify the data, and when necessary A third model is introduced to improve classification accuracy.
It improves the accuracy and stability of data classification, adapts to data characteristics in different scenarios, and enhances the accuracy of data classification results.
Smart Images

Figure CN118734192A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine learning classification, and in particular to a data classification method and device. Background Art
[0002] With the continuous development of science and technology, more and more enterprises will generate a large amount of data in the process of digitalization. If all data are protected without distinction, it will cause a huge waste of resources for enterprises and affect the operation of business. Therefore, more and more enterprises have a growing demand for data classification.
[0003] At present, the industry usually uses a single model for data classification. However, since data in different scenarios have different data characteristics, using a single model will result in different data classification accuracy in different scenarios, resulting in poor classification stability of the single model, and thus low data classification accuracy.
[0004] In summary, how to improve the accuracy of data classification is a problem that needs to be solved urgently. Summary of the invention
[0005] The embodiments of the present invention provide a data classification method and device to solve the problem of low accuracy of data classification in the prior art.
[0006] In a first aspect, an embodiment of the present invention provides a data classification method, which is applied to a hybrid classification model, wherein the hybrid classification model includes a first model and a second model, and the method includes: extracting individual characteristics of each data to be classified and group characteristics of each data; the group characteristics are determined by K adjacent individual characteristics; inputting the individual characteristics of each data and the group characteristics of each data into the hybrid classification model; for any data, determining the individual characteristics of the data and M adjacent individual characteristics in the first model, and determining the first category corresponding to the data and the probability of the first category based on the categories corresponding to the M adjacent individual characteristics; if the probability of the first category does not meet the first threshold, the individual characteristics of the data and the group characteristics of the data are classified and predicted by each gradient tree sequentially arranged in the second model to obtain the second category corresponding to the data as the output result of the hybrid classification model; if the probability of the first category meets the first threshold, the first category corresponding to the data is used as the output result of the hybrid classification model; the gradient trees sequentially arranged in the second model are gradient boosting decision trees.
[0007] In the above technical scheme, this scheme comprehensively considers the advantages and characteristics of the first model and the second model, so that the individual characteristics and group characteristics of each data are input into the hybrid classification model, and the individual characteristics of each data are first input into the first model, and the local tendency of the first model is used to classify high-density samples. If the classification result of the first model does not meet the first threshold, the overall generalization ability of the second model is used to classify medium-density samples, thereby improving the accuracy of the classification results of the data.
[0008] Optionally, the hybrid classification model also includes a third model; the business rules set in the third model are related to the characteristics of the data; the method also includes: obtaining the probability of the second category corresponding to each data through the second model; if the probability of the second category does not meet the second threshold, the individual characteristics of each data are processed through the third model to obtain the third category corresponding to each data as the output result of the hybrid classification model.
[0009] Optionally, before extracting the individual characteristics of each data to be classified and the group characteristics of each data, it also includes: training the hybrid classification model in the following manner: performing separate training on any monomer model in the hybrid classification model, and adjusting each parameter in the monomer model until the first evaluation indicator of the monomer model is met; any monomer model is the first model, the second model or the third model; the first evaluation indicator is used to characterize the accuracy of the first training output result obtained by each training sample in the separate training of the monomer model; performing overall training on each monomer model that has completed the training, and adjusting the first threshold and the second threshold until the second evaluation indicator of the hybrid classification model is met; the second evaluation indicator is used to characterize the accuracy of the second training output result obtained by each training sample during the overall training.
[0010] Optionally, the second evaluation index is obtained in the following manner: obtaining each first training category as the second training output result of the hybrid classification model obtained by the first model in the hybrid classification model during the overall training of each training sample, each second training category as the second training output result of the hybrid classification model obtained by the second model in the hybrid classification model, and each third training category as the second training output result of the hybrid classification model obtained by the third model in the hybrid classification model; wherein, if the probability of each first training category satisfies the first initial threshold, the probability of each second training category satisfies the second initial threshold; determining the monomer accuracy of the first model according to the accuracy of each first training category; determining the monomer accuracy of the second model according to the accuracy of each second training category; determining the monomer accuracy of the third model according to the accuracy of each third training category; determining the overall accuracy through each first training category, each second training category and each third training category; determining the second evaluation index according to the monomer accuracy of the first model, the monomer accuracy of the second model, the monomer accuracy of the third model, the overall accuracy, and their corresponding weights.
[0011] Optionally, the first model includes multiple first sub-models; the training parameters corresponding to any two first sub-models during the training process are not exactly the same; the first model is trained separately in the following manner, including: separately training any first sub-model in the first model until the third evaluation indicator of the first sub-model is met; and the multiple first sub-models that have completed the individual training are trained as a whole until the first evaluation indicator of the first model is met.
[0012] Optionally, any first sub-model in the first model is trained separately until the third evaluation indicator of the first sub-model is met, including: for any first sub-model, inputting the individual characteristics of each training sample into the first sub-model to obtain each fourth training category; for any training category, determining the single classification accuracy corresponding to the training category from each fourth training category; determining the classification accuracy of the first sub-model through the accuracy of each fourth training category; and determining the third evaluation indicator based on the classification accuracy of the first sub-model and the single classification accuracy corresponding to each training category.
[0013] Optionally, multiple first sub-models that have completed individual training are trained as a whole until the first evaluation indicator of the first model is met, including: inputting individual features of any training sample into the first model to obtain each fifth training category and the probability of each fifth training category output by each first sub-model for the training sample; determining from each fifth training category a training category that is the same as the actual category of the training sample; determining the predicted probability of the training sample based on the probability of the training category that is the same as the actual category and the corresponding third evaluation indicator of the first sub-model; and determining the first evaluation indicator of the first model based on the predicted probability of each training sample.
[0014] Optionally, individual features include any one or more of the following combinations: numerical features, text features, and categorical features; group features include any one or more of the following combinations: average features of individual features of K adjacent training samples, and average features of individual features based on k-means clustering. In a second aspect, an embodiment of the present invention provides a data classification device, which is applied to a hybrid classification model. The hybrid classification model includes a first model and a second model, and includes: an acquisition unit, which extracts individual characteristics of each data to be classified and group characteristics of each data; the group characteristics are determined by K adjacent individual characteristics; a processing unit, which is used to input the individual characteristics of each data and the group characteristics of each data into the hybrid classification model; for any data, the individual characteristics of the data and the M adjacent individual characteristics in the first model are determined, and according to the categories corresponding to the M adjacent individual characteristics, the first category corresponding to the data and the probability of the first category are determined; if the probability of the first category does not meet the first threshold, the individual characteristics of the data and the group characteristics of the data are classified and predicted by each gradient tree sequentially arranged in the second model to obtain the second category corresponding to the data as the output result of the hybrid classification model; if the probability of the first category meets the first threshold, the first category corresponding to the data is used as the output result of the hybrid classification model; the gradient trees sequentially arranged in the second model are gradient boosting decision trees.
[0015] Optionally, the hybrid classification model also includes a third model; the business rules set in the third model are related to the characteristics of the data; the processing unit also includes: obtaining the probability of the second category corresponding to each data through the second model; if the probability of the second category does not meet the second threshold, the individual characteristics of each data are processed through the third model to obtain the third category corresponding to each data as the output result of the hybrid classification model.
[0016] Optionally, the processing unit also includes: training the hybrid classification model in the following manner: performing separate training on any monomer model in the hybrid classification model, and adjusting each parameter in the monomer model until the first evaluation indicator of the monomer model is met; any monomer model is the first model, the second model or the third model; the first evaluation indicator is used to characterize the accuracy of the first training output result obtained by each training sample in the separate training of the monomer model; performing overall training on each monomer model that has completed the training, and adjusting the first threshold and the second threshold until the second evaluation indicator of the hybrid classification model is met; the second evaluation indicator is used to characterize the accuracy of the second training output result obtained by each training sample during the overall training.
[0017] Optionally, the processing unit is specifically used to: obtain, during the overall training of each training sample, each first training category obtained by the first model in the hybrid classification model as the second training output result of the hybrid classification model, each second training category obtained by the second model in the hybrid classification model as the second training output result of the hybrid classification model, and each third training category obtained by the third model in the hybrid classification model as the second training output result of the hybrid classification model; wherein, if the probability of each first training category satisfies the first initial threshold, the probability of each second training category satisfies the second initial threshold; determine the monomer accuracy of the first model according to the accuracy of each first training category; determine the monomer accuracy of the second model according to the accuracy of each second training category; determine the monomer accuracy of the third model according to the accuracy of each third training category; determine the overall accuracy through each first training category, each second training category and each third training category; determine the second evaluation indicator according to the monomer accuracy of the first model, the monomer accuracy of the second model, the monomer accuracy of the third model, the overall accuracy, and their corresponding weights.
[0018] Optionally, the first model includes multiple first sub-models; the training parameters corresponding to any two first sub-models during the training process are not exactly the same; the processing unit is specifically used to: perform individual training on any first sub-model in the first model until the third evaluation indicator of the first sub-model is met; and perform overall training on the multiple first sub-models that have completed individual training until the first evaluation indicator of the first model is met.
[0019] Optionally, the processing unit is specifically used to: for any first sub-model, input the individual characteristics of each training sample into the first sub-model to obtain each fourth training category; for any training category, determine the single classification accuracy corresponding to the training category from each fourth training category; determine the classification accuracy of the first sub-model through the accuracy of each fourth training category; determine the third evaluation indicator based on the classification accuracy of the first sub-model and the single classification accuracy corresponding to each training category.
[0020] Optionally, the processing unit is specifically used to: input the individual characteristics of any training sample into the first model to obtain each fifth training category and the probability of each fifth training category output by each first sub-model for the training sample; determine the training category that is the same as the actual category of the training sample from each fifth training category; determine the predicted probability of the training sample according to the probability of the training category that is the same as the actual category and the corresponding third evaluation indicator of the first sub-model; determine the first evaluation indicator of the first model according to the predicted probability of each training sample.
[0021] Optionally, individual features include any one or more of the following combinations: numerical features, text features, and categorical features; group features include any one or more of the following combinations: average features of individual features of K adjacent training samples, and average features of individual features based on k-means clustering.
[0022] In a third aspect, an embodiment of the present invention further provides a computing device, comprising at least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processor executes the data classification method of the first aspect mentioned above.
[0023] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program executable by a computer device. When the program runs on the computer device, the computer device executes a data classification method according to the first aspect.
[0024] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored on a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer device, the computer device executes the steps of any data classification in the above-mentioned first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0026] Figure 1 A flow chart of a data classification method provided by an embodiment of the present invention;
[0027] Figure 2 A flow chart of a method for separately training a single first sub-model provided by an embodiment of the present invention;
[0028] Figure 3 A flow chart of a training method for a first model provided in an embodiment of the present invention;
[0029] Figure 4 A flow chart of a method for training a hybrid classification model provided by an embodiment of the present invention;
[0030] Figure 5 A schematic diagram of the structure of a data classification device provided by an embodiment of the present invention;
[0031] Figure 6A schematic diagram of the structure of a computing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all 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.
[0033] like Figure 1 FIG. 1 is a flow chart of a data classification method provided by an embodiment of the present invention, and the method comprises the following steps:
[0034] Step 101: extract individual features of each data to be classified and group features of each data.
[0035] In the embodiment of the present invention, since the hybrid classification model includes the first model and the second model, the first model includes multiple first sub-models, wherein the characteristics of the first sub-model are that it focuses on local samples and has a strong local tendency, and the features focus on a small number of features. The advantages of the first sub-model are fast training speed, the use of majority voting method for multi-classification problems, and it is suitable for the determination of large-proportion classification. For example, if the first sub-model is used to classify the data, more than 80% of the 10 nearest data around a data are in category A, indicating that the data is highly likely to be identified as category A. However, in a possible case, the proportions of the 10 nearest samples around a data being identified as category A, category B, and category C are 30%, 30%, and 40%, respectively, indicating that the sample has no tendency. If only the first sub-model is used to classify the data, the classification result that may be obtained is not accurate. In terms of the characteristics and advantages of the first sub-model, the first sub-model is suitable for use when the input data is small or too much. If the input data is of medium quantity, it will cause fitting problems.
[0036] The characteristic of the second model is that it can focus on the overall sample, select more features as input, and solve the problem of generalization of multiple classifications. The advantage of the second model is that it has a strong overall generalization ability and is good at classifying samples when the sample tendencies are relatively balanced. It is suitable for the judgment of more balanced proportion classifications. However, since the second model needs to obtain more features as input, if the input data is small or the amount of data is higher than the set threshold, the output speed of the second model will be lower than the output speed of the first sub-model because the input features of the second model are more than the input features of the first sub-model. Combining the characteristics of the second model and the advantages of the second model, the second model is not suitable for use when the input data is small or too much, and is more suitable for use when the input data is of medium amount.
[0037] Among them, since the first model is not a deep model, it does not need to input too many features, and only needs to input the individual features of each data to be classified. The second model is a deep model with high fitting ability. It not only needs to input the individual features of each data to be classified, but also needs to input the group features of each data to be classified, so as to achieve better classification of each data to be classified. Therefore, it is necessary to first extract the individual features of each data to be classified and the group features of each data. Individual features include any one or more of the following combinations: numerical features, text features, and classification features; group features include any one or more of the following combinations: the average features of individual features of neighboring K training samples, and the average features of individual features based on k-means clustering. After extracting the individual features of each data to be classified and the group features of each data, similarity screening is performed according to each individual feature and each group feature to determine that the similarity between features does not exceed 70%. If it exceeds, one of the features is retained and the remaining features are eliminated until the similarity between all features does not exceed 70%.
[0038] Step 102: input the individual characteristics of each data and the group characteristics of each data into a hybrid classification model.
[0039] In an embodiment of the present invention, after extracting the individual characteristics of each data and the group characteristics of each data, the individual characteristics of each data and the group characteristics of each data are input into a hybrid classification model, so as to facilitate the subsequent rapid and accurate output results, wherein the output result is the category of the data.
[0040] Step 103, for any data, determine the individual features of the data and M adjacent individual features in the first model, and determine the first category corresponding to the data and the probability of the first category according to the categories corresponding to the M adjacent individual features.
[0041] In the embodiment of the present invention, the hybrid classification model in this scheme includes a first model and a second model, wherein the characteristics of the first model are focusing on local samples and local tendencies are relatively strong, and the features are focused on a small number of features. Moreover, the advantages of the first model are fast training speed, using the majority voting method for multi-classification problems, and suitable for the judgment of large-proportion classification. The characteristics of the second model are that it can focus on the overall sample, select more features as input, and can solve the problem of generalization of multiple classifications. The advantage of the second model is that the overall generalization ability is strong, and it is good at classifying samples when the sample tendencies are relatively balanced, which is suitable for the judgment of relatively balanced proportion classification. Since the first model is more suitable for the situation where the number of samples is too large, and the second model is more suitable for the situation where the number of samples is medium, the execution order of the first model and the second model is determined, which can be that the first model first processes the individual features of the data, and if the first model is not suitable for processing the data, then the second model is allowed to process the data and obtain the output result. In this way, the local tendency ability of the first model is first exerted to classify high-density samples, and then the overall generalization ability of the second model is used to classify medium-density samples, so as to improve the accuracy of the classification results of the data to be classified. Therefore, when the individual characteristics of each data and the group characteristics of each data are input into the hybrid classification model, the individual characteristics of each data will be processed by the first model first. Specifically, for any data, the individual characteristics of the data and the M adjacent individual characteristics in the first model are determined, and based on the categories corresponding to the M adjacent individual characteristics, the first category corresponding to the data and the probability of the first category are determined.
[0042] Step 104 , determining whether the probability of the first category meets a first threshold, if so, executing step 105 , if not, executing step 106 .
[0043] In the embodiment of the present invention, when the probability of the first category output by the first model does not meet the first threshold, it means that the output result of the first model does not meet the requirements, and the first model is not applicable to determine the category of the data. When the probability of the first category output by the first model meets the first threshold, it means that the output result of the first model meets the requirements, and the first model is applicable to process the data.
[0044] Step 105: The first categories corresponding to the data are used as output results of the hybrid classification model.
[0045] In the embodiment of the present invention, the first model is suitable for processing each data corresponding to the first category that meets the first threshold, and the first category corresponding to each data is used as the output result of the hybrid classification model.
[0046] Step 106, classify and predict the individual characteristics of the data and the group characteristics of the data through the gradient trees sequentially set in the second model to obtain the second category corresponding to the data as the output result of the hybrid classification model.
[0047] In an embodiment of the present invention, if the first model is not suitable for processing the data corresponding to the first category that does not meet the first threshold, the individual characteristics of the data corresponding to the first category that does not meet the first threshold and the group characteristics of the data are input into the second model, and classification prediction is performed through the gradient trees arranged in sequence in the second model to obtain the second categories corresponding to the data as the output result of the hybrid classification model, wherein the gradient trees arranged in sequence in the second model are gradient boosting decision trees.
[0048] It can be seen from the above steps 101 to 106 that this solution comprehensively considers the advantages and characteristics of the first model and the second model, so that the individual characteristics and group characteristics of each data are input into the hybrid classification model, and the individual characteristics of each data are first input into the first model, and the local tendency of the first model is used to classify high-density samples. If the classification result of the first model does not meet the first threshold, the overall generalization ability of the second model is used to classify medium-density samples, thereby improving the accuracy of the classification results of the data.
[0049] In one possible case, some data is classified by the second model, but the classification results do not meet the requirements, that is, these data are not suitable for processing by the first model, nor are they suitable for processing by the second model. Therefore, it is necessary to introduce a third model. When the data is not suitable for processing by the first model, nor by the second model, the data is processed by the third model.
[0050] Optionally, the hybrid classification model also includes a third model; the business rules set in the third model are related to the characteristics of the data; wherein the third model is a rule constructed by combining business with samples in the language of regular expressions, which can solve specific classification problems, but has poor generalization ability and does not have the ability to learn new samples. In step 106, the individual characteristics of each data and the group characteristics of each data are processed by the second model to obtain the probability of the second category corresponding to each data; if the probability of the second category does not meet the second threshold, the individual characteristics of each data are processed by the third model to obtain the third category corresponding to each data as the output result of the hybrid classification model.
[0051] In the embodiment of the present invention, the hybrid classification model needs to be trained first. After the training is completed, the hybrid classification model can achieve more accurate and rapid determination of the classification results of the data to be classified. The following introduces how the hybrid classification model is trained.
[0052] Optionally, first, it is necessary to train any single model in the hybrid classification model separately, by adjusting each parameter in the single model until the first evaluation index of the single model is met, and the first evaluation index is used to characterize the accuracy of the first training output result obtained by each training sample in the separate training of the single model. Any single model is the first model, the second model or the third model. Then, the single models that have completed the training are trained as a whole, by adjusting the first threshold and the second threshold until the second evaluation index of the hybrid classification model is met, and the second evaluation index is used to characterize the accuracy of the second training output result obtained by each training sample during the overall training. When the hybrid classification model training is completed, by inputting the data into the trained hybrid classification model, a more accurate and rapid classification result can be obtained. In order to facilitate the understanding of this solution, the following first introduces how the first model is trained.
[0053] In an embodiment of the present invention, the first model includes multiple first sub-models, and the values of the corresponding parameters of any two first sub-models during the training process are not exactly the same. The parameters of the first sub-model include K-reference nearest neighbor number and distance formula type; the value of K can be a positive integer such as 1, 2, 3..., and the distance formula type can be Euclidean distance formula, Hamming distance, cosine distance, correlation coefficient distance, chi-square distance, mutual information distance, etc., which are not limited here. First, the multiple first sub-models in the first model need to be trained separately, and then the multiple first sub-models that have completed the separate training are trained as a whole to complete the training of the first model. The following first introduces how a single first sub-model is trained separately.
[0054] like Figure 2 As shown, it is a flow chart of a method for separately training a single first sub-model provided by an embodiment of the present invention, and the method comprises the following steps:
[0055] Step 201: for any first sub-model, input the individual features of each training sample into the first sub-model to obtain each fourth training category.
[0056] In an embodiment of the present invention, individual features are extracted from each training sample, wherein the individual features include numerical features, text features and categorical features. The numerical features represent expenditures and may also represent income. The numerical features are adopted by automatically finding the splitting points of numerical points based on a decision tree, and constraining the upper and lower limits based on determining the upper and lower limits of the WOE of each interval. After the interval splitting points are determined, the WOE values are converted to achieve feature transformation and simplify the training dimension. For example, if the income is divided into 5 intervals, namely [0, 100W], [100W, 500W], [500W, 1000W], [1000W, 5000W], [5000W, 10000W], the WOE value of the interval [0, 100W] is converted, and the corresponding numerical feature is 0.3, the WOE value of the interval [100W, 500W] is converted, and the corresponding numerical feature is 0.4, the WOE value of the interval [500W, 1000W] is converted, and the corresponding numerical feature is 0.5, the WOE value of the interval [1000W, 5000W] is converted, and the corresponding numerical feature is 0.6, and the WOE value of the interval [5000W, 10000W] is converted, and the corresponding numerical feature is 0.7. If the income in the training sample is 101W, the numerical feature in the training sample is 0.4.
[0057] Classification features are used to characterize different types of features in data. For example, if there are 20 training samples, namely (t1, t2, t3, ..., t20), the decision tree model is used to find the classification group, and 6 groups are obtained, namely (t1, t2, t10), (t3, t4, t5), (t6, t7, t15), (t8, t9, t20), (t11, t12, t19), (t13, t17, t14, t16, t18), and then each group is divided into 6 groups through W. OE calculation is used to determine the eigenvalue corresponding to each group, where the eigenvalue of (t1, t2, t10) is 0.3, the eigenvalue of (t3, t4, t5) is 0.4, the eigenvalue of (t6, t7, t15) is 0.6, the eigenvalue of (t8, t9, t20) is 0.7, the eigenvalue of (t11, t12, t19) is 0.8, and the eigenvalue of (t13, t17, t14, t16, t18) is 0.9.
[0058] Text features are used to characterize text features in data. For example, in the text features {X1, X2, X3}, X1 represents rule A, X2 represents rule B, and C represents rule C. Training sample 1 first removes meaningless words such as modal particles such as "ne" and "ah", and then builds the word frequency matrix of the TF_IDF matrix based on the vocabulary distribution of multiple samples, establishes a vector set of industry name and business scope fields, and then determines whether the training sample meets rule A, does not meet rule B, and meets rule C based on the vector set corresponding to training sample 1. If the training sample meets rule C, the text feature of the training sample is {1, 0, 1}.
[0059] For any first sub-model, the individual features of each training sample are input into the first sub-model to obtain the fourth training category corresponding to each training sample.
[0060] Step 202: for any training category, determine the single classification accuracy corresponding to the training category from each fourth training category.
[0061] In the embodiment of the present invention, for any training category, the single classification accuracy corresponding to the training category is determined according to the number of single training categories that are the same as the actual category and the number of single training categories in the training samples. As shown in Formula 1:
[0062] P1=X1 / X2 Formula 1
[0063] Among them, P1 is the single classification accuracy corresponding to the training category, X1 is the number of single training categories that are the same as the actual category, and X2 is the number of single training categories in the training samples.
[0064] The single classification accuracy corresponding to the training category is used to characterize the single classification accuracy corresponding to the training category. For example, multiple training samples are input into the first sub-model, where, for category A, the number of training categories A of the training samples output by the first sub-model is 100, of which 30 are actually categories of the training samples in the 100, and the corresponding single classification accuracy of training category A is 3 / 10.
[0065] Step 203: Determine the classification accuracy of the first sub-model through the accuracy of each fourth training category.
[0066] In the embodiment of the present invention, the classification accuracy of the first sub-model is determined according to the number of training samples with the same category as the actual category and the total number of training samples. See Formula 2:
[0067] P2=X3 / X4 Formula 2
[0068] Among them, P2 is the classification accuracy of the first sub-model, X3 is the number of training samples with the same actual category, and X4 is the total number of training samples.
[0069] The classification accuracy of the first sub-model is used to characterize the classification accuracy of the first sub-model. For example, if 100 training samples are input into the first sub-model, and the number of training samples with the same category as the actual category in the output result is 40, then the classification accuracy of the first sub-model is 40%.
[0070] Step 204: Determine a third evaluation index based on the classification accuracy of the first sub-model and the single classification accuracy corresponding to each training category.
[0071] In the embodiment of the present invention, the third evaluation index is determined according to the classification accuracy of the first sub-model, the first weight, the single classification accuracy corresponding to each training category, the second weight, and the weight of the training category. The first weight is the weight corresponding to the classification accuracy of the first sub-model, and the second weight is the weight corresponding to the single classification accuracy corresponding to each training category, as shown in Formula 3:
[0072] Y3=n1*P2+(n2*P1*n3) Formula 3
[0073] Among them, Y3 is the third evaluation indicator, n1 is the first weight, n2 is the second weight, P1 is the single classification accuracy corresponding to each training category, and P2 is the classification accuracy of the first sub-model.
[0074] Step 205: until the third evaluation index meets the first set threshold, the training of the first sub-model is completed.
[0075] In the embodiment of the present invention, when the third evaluation index meets the first set threshold, it means that the accuracy of the first sub-model meets the requirements and the training of the first sub-model is completed. When the third evaluation index does not meet the first set threshold, it means that the first sub-model needs to continue training.
[0076] It can be seen from the above steps 201 to 205 that when training the first sub-model, taking into account the classification accuracy of the first sub-model and the single classification accuracy corresponding to each training category helps to adjust the first sub-model towards a high recall rate of typical samples, thereby achieving better performance of the trained first sub-model on typical samples.
[0077] In the embodiment of the present invention, after multiple first sub-models are trained individually, it is necessary to perform overall training on the multiple first sub-models that have completed the individual training, so as to obtain the first model. The following describes how the first model is trained.
[0078] like Figure 3 FIG. 1 is a flow chart of a training method for a first model provided by an embodiment of the present invention, and the method comprises the following steps:
[0079] Step 301: Input the individual features of any training sample into the first model to obtain each fifth training category and the probability of each fifth training category output by each first sub-model for the training sample.
[0080] In an embodiment of the present invention, for example, the first model includes a first sub-model, a second sub-model and a third sub-model, wherein training sample 1 is input into the first model, and the fifth training category output by the first sub-model is category A, and the probability of category A is 80%, the fifth training category output by the second sub-model is category B, and the probability of category B is 40%, and the fifth training category output by the third sub-model is category C, and the probability of category C is 30%.
[0081] Step 302: Determine, from each fifth training category, a training category that is the same as the actual category of the training sample.
[0082] In an embodiment of the present invention, for example, the first model includes a first sub-model 1, a first sub-model 2 and a first sub-model 3, wherein the training sample 1 is input into the first model, and the fifth training category output by the first sub-model 1 is category A, and the probability of category A is 80%, the fifth training category output by the first sub-model 2 is category B, and the probability of category B is 40%, and the fifth training category output by the first sub-model 3 is category C, and the probability of category C is 30%, wherein the actual category of the training sample 1 is category A, then the training category that is the same as the actual category of the training category is determined to be category A.
[0083] Step 303: Determine the predicted probability of the training sample according to the probability of the training category that is the same as the actual category and the corresponding third evaluation index of the first sub-model.
[0084] In the embodiment of the present invention, the prediction probability of the training sample is determined based on the probability of the training category that is the same as the actual category, the third evaluation index of the first sub-model corresponding to the training category that is the same as the actual category, the probability of other training categories, and the third evaluation index of the first sub-model corresponding to other training categories. See Formula 4:
[0085] P3=(P4*Y3 (1) ) / (P4*Y3 (1) + P5*Y3 (2) ) Formula 4
[0086] Among them, P4 is the predicted probability of the training sample; Y3 (1) is the third evaluation index of the first sub-model corresponding to the training category whose output is the same as the actual category; P5 is the probability of other training categories; Y3 (2) The third evaluation indicator of the first sub-model corresponding to the output other training categories.
[0087] For example, the first model includes the first sub-model 1, the first sub-model 2 and the first sub-model 3, wherein the training sample 1 is input into the first model, and the fifth training category output by the first sub-model 1 is category A, and the probability of category A is 80%, the fifth training category output by the first sub-model 2 is category B, and the probability of category B is 40%, and the fifth training category output by the first sub-model 3 is category C, and the probability of category C is 30%, wherein the evaluation index of the first sub-model 1 is 0.6, the evaluation index of the first sub-model 2 is 0.7, and the evaluation index of the first sub-model 3 is 0.8. The actual category of the training sample 1 is category A, and the training category that is the same as the actual category of the training category is determined to be category A, and the predicted probability of category A needs to be determined, wherein the predicted probability of category A = (0.6*0.8) / (0.6*0.8+0.7*0.4+0.8*0.3) = 48%.
[0088] Step 304: Determine a first evaluation index of the first model according to the prediction probability of each training sample.
[0089] In the embodiment of the present invention, the average prediction probability is obtained according to the prediction probability of each training sample, and then the information entropy of the first model is determined according to the average prediction probability, which can be seen in Formula 5:
[0090]
[0091] Where u is the information entropy of the first model, is the average prediction probability. The information entropy is inversely proportional to the first evaluation index, that is, the smaller the information entropy, the larger the first evaluation index.
[0092] Step 305: until the first evaluation index meets the second set threshold, the first model training is completed.
[0093] It can be seen from the above steps 301 to 305 that since the first model includes a first sub-model composed of multiple different parameters, in the process of classifying the classified data, it can not only give full play to the local fitting ability of the first sub-model composed of different parameters in different distributions, but also generalize the K nearest neighbor features and reduce the degree of overfitting. Therefore, when the number of samples is relatively small, classification prediction can be achieved with neighbor samples. After the sample size gradually increases, the first model is more suitable for solving the classification of more typical samples, thereby improving the accuracy of the classification results.
[0094] In the embodiment of the present invention, since the second model is a deep model, the training of the second model can be completed by inputting the individual features and group features in each training sample into the second model. The training process of the second model is specifically described below.
[0095] Since the existing model features are based on single features and do not take group features into consideration, the classification results of the existing models are less accurate. This solution not only considers individual features, but also group features. The advantage of group features is that they can be mined. This solution uses group features as high-dimensional extension features to enrich feature dimensions and enhance the generalization ability of the second model.
[0096] In the embodiment of the present invention, in step 201, individual features have been introduced in detail, and group features are introduced below. Specifically, group features include the average features of individual features of neighboring K training samples and the average features of individual features based on k-means clustering. The average features of individual features of neighboring K training samples are obtained by obtaining the average features of K samples neighboring a single sample, and constructing a group feature that is equal to the length of a single feature, where K can be 1, 2...9, which is not limited here, and K is a positive integer greater than 0 and less than 10. For example, there are 10 training samples in total, K=3, and a single training sample has 10 individual features, namely {X1, X2, X3, …, X 10}, where the individual features of sample A are {t1, t2, t3, .., tn}. Find the three samples closest to sample A, whose initial feature distribution is: {t11, t21, t31, .., tn1}, {t12, t22, t32, .., tn2}, {t13, t23, t33, .., tn3}, and then count the average feature as {1 / 3(t11+t12+t13), 1 / 3(t21+t22+t23), …, 1 / 3(tn1+tn2+tn3)}, and take the average feature as the average feature of the individual features of the K neighboring training samples of sample A.
[0097] The average feature of individual features based on k-means clustering is to implement KMEANS clustering on the initial feature combination of the sample, determine which cluster a single sample belongs to, find its cluster center and the average individual feature of the samples in its cluster, and use it as the feature vector of individual features based on k-means clustering. For example, select a fixed K=1,3,5,7,9, etc. (K is not recommended to be too large, and K is defined to be less than 10), obtain the average feature of the K samples adjacent to a single sample, and construct a feature dimension that is equal to the length of a single feature. Through the initial features {t1, t2, t3, .., tn}, find the nearest cluster center point, and its statistical average feature is: {t11', t21', t31', .., tn1'}, which is the average feature of individual features based on k-means clustering.
[0098] The training samples are divided into a training set and a test set according to a set ratio, wherein the individual characteristics and group characteristics of the training set are input into the second model for training, and then the individual characteristics and group characteristics of the test set are input into the second model for testing. After the test is completed, the training of the second model is completed.
[0099] The following describes how to train the third model. The third model determines the category of the data based on the text features in the data. The training samples are divided into a training set and a test set according to a set ratio, and the individual features of the training set are input into the third model for training, and then the individual features of the test set are input into the third model for testing. After the test is completed, the training of the third model is completed.
[0100] In an embodiment of the present invention, after the first model, the second model and the third model are trained, the trained first model, the second model and the third model are constructed into a hybrid classification model, and then the constructed hybrid classification model is trained. The following describes how the hybrid classification model is trained.
[0101] like Figure 4 FIG. 1 is a flow chart of a method for training a hybrid classification model provided by an embodiment of the present invention, and the method comprises the following steps:
[0102] Step 401, obtaining, during the overall training of each training sample, each first training category as the second training output result of the hybrid classification model obtained by the first model in the hybrid classification model, each second training category as the second training output result of the hybrid classification model obtained by the second model in the hybrid classification model, and each third training category as the second training output result of the hybrid classification model obtained by the third model in the hybrid classification model.
[0103] Step 402: Determine the individual accuracy of the first model according to the accuracy of each first training category.
[0104] In the embodiment of the present invention, the monomer accuracy of the first model is determined according to the first training category that is the same as the actual category and the number of the first training categories, wherein the monomer accuracy of the first model is used to characterize the monomer accuracy of the first model. See Formula 6:
[0105] P6=X5 / X6 Formula 6
[0106] Where P6 is the single-unit accuracy of the first model, X5 is the first training category that is the same as the actual category, and X6 is the number of the first training categories.
[0107] Step 403: Determine the individual accuracy of the second model according to the accuracy of each second training category.
[0108] In the embodiment of the present invention, the monomer accuracy of the second model is determined according to the second training category that is the same as the actual category and the number of the second training categories, wherein the monomer accuracy of the second model is used to characterize the monomer accuracy of the second model. Similarly, the monomer accuracy of the second model can be determined by modifying Formula 6.
[0109] Step 404: Determine the individual accuracy of the third model according to the accuracy of each third training category.
[0110] In the embodiment of the present invention, the monomer accuracy of the third model is determined according to the third training category that is the same as the actual category and the number of the third training categories, wherein the monomer accuracy of the third model is used to characterize the monomer accuracy of the third model. Similarly, the monomer accuracy of the third model can be determined by modifying Formula 6.
[0111] Step 405 , determining the overall accuracy through each first training category, each second training category, and each third training category.
[0112] In the embodiment of the present invention, the overall accuracy is determined according to the first training category that is the same as the actual category, the second training category that is the same as the actual category, the third training category that is the same as the actual category, and the number of training samples, wherein the overall accuracy is used to characterize the overall accuracy. Similarly, the overall accuracy can be determined by modifying Formula 6.
[0113] Step 406, determining a second evaluation index according to the single-unit accuracy of the first model, the single-unit accuracy of the second model, the single-unit accuracy of the third model, the overall accuracy, and their corresponding weights.
[0114] In the embodiment of the present invention, the second evaluation index may be determined by Formula 7, as shown in Formula 7:
[0115] Y2=n4*P6+n5*p7+n6*P8+n7*P9 Formula 7
[0116] Among them, Y2 is the second evaluation indicator, n4 is the weight corresponding to the first model, P6 is the single accuracy of the first model, n5 is the weight corresponding to the second model, P7 is the single accuracy of the second model, n6 is the weight corresponding to the third model, P8 is the single accuracy of the third model, n7 is the weight corresponding to the mixed classification model, and P9 is the overall accuracy.
[0117] Step 407: until the second evaluation index meets the third set threshold, the training of the hybrid classification model is completed.
[0118] In an embodiment of the present invention, after determining the second evaluation index, first determine whether the second evaluation index meets the third set threshold. If not, it is necessary to adjust the first threshold and the second threshold of the hybrid classification model. The following describes how to adjust the first threshold and the second threshold. Specifically, if x1 is the first threshold and x2 is the second threshold, the valid range of x1 and x2 is (0, 1) and the initial values of x1 and x2 are both 0.5. If the second evaluation index does not meet the third set threshold, then the training of the hybrid classification model is completed by traversing the valid range until the adjusted x1 and x2 correspond to the second evaluation index of the hybrid classification model that meets the third set threshold. The traversal method is to randomly select the values of x1 and x2 within the valid range by selecting random numbers. Specifically, if the step size of x1 and x2 is 0.1, x1 and x2 can be added or subtracted. Set the random number seed (0, 1) to determine the corresponding x1 or x2 that can be added or subtracted. By obtaining a random number from a random number function, if the random number is in the range of (0, 0.25), it is x1-0.1; if the random number is in the range of (0.25, 0.5), it is x1+0.1; if the random number is in the range of (0.5, 0.75), it is x2-0.1; if the random number is in the range of (0.75, 1), it is x2+0.1. For example, the initial value of x1 and x2 is 0.5. If the random number obtained from the random number function is 0.45, then x1 is 0.4 and x2 is 0.5.
[0119] It can be seen from the above steps 401 to 407 that by training the hybrid classification model, the first threshold and the second threshold can be dynamically adjusted, so that the trained hybrid classification model can classify the data more accurately.
[0120] Optionally, after the hybrid classification model is trained, the data to be classified can be classified through the hybrid classification model. If the hybrid classification model includes a first model and a second model, specifically, extract the individual characteristics of each data to be classified and the group characteristics of each data; input the individual characteristics of each data and the group characteristics of each data into the hybrid classification model; process the individual characteristics of each data through the first model to obtain the first category and the probability of the first category corresponding to each data; if the probability of the first category does not meet the first threshold, process the individual characteristics of each data and the group characteristics of each data through the second model to obtain the second category corresponding to each data as the output result of the hybrid classification model; if the probability of the first category meets the first threshold, the first category corresponding to each data is used as the output result of the hybrid classification model.
[0121] If the hybrid classification model includes the first model, the second model and the third model, specifically, extract the individual characteristics of each data to be classified and the group characteristics of each data; input the individual characteristics of each data and the group characteristics of each data into the hybrid classification model; process the individual characteristics of each data through the first model to obtain the first category and the probability of the first category corresponding to each data; if the probability of the first category meets the first threshold, the first category corresponding to each data is used as the output result of the hybrid classification model. If the probability of the first category does not meet the first threshold, the individual characteristics of each data and the group characteristics of each data are processed through the second model, and the probability of the second category corresponding to each data is obtained through the second model; if the probability of the second category meets the second threshold, the second category corresponding to each data is used as the output result of the hybrid classification model. If the probability of the second category does not meet the second threshold, the individual characteristics of each data are processed through the third model to obtain the third category corresponding to each data as the output result of the hybrid classification model.
[0122] Optionally, set the retraining retest indicators: 1) Concentration indicator: predicting a single classification accounts for more than 70% of the total prediction samples.
[0123] 2) The third model determines that the sample proportion is higher than 50%.
[0124] 3) Randomly check 10% of the samples and calculate the proportion of the actual classification of the closest sample in the training sample that is inconsistent with the predicted classification is greater than 33.3%.
[0125] If any of the above retest indicators is met, the training of the remixed classification model is started.
[0126] Based on the same technical concept, the present application embodiment provides a data classification device, which can be seen in Figure 5 , applied to a hybrid classification model, the hybrid classification model includes a first model and a second model, the device 500 includes: an acquisition unit 501, used to extract individual features of each data to be classified and group features of each data; the group features are determined by K adjacent individual features;
[0127] The processing unit 502 is used to input the individual characteristics of each data and the group characteristics of each data into the hybrid classification model; for any data, determine the individual characteristics of the data and M adjacent individual characteristics in the first model, and determine the first category corresponding to the data and the probability of the first category according to the categories corresponding to the M adjacent individual characteristics; if the probability of the first category does not meet the first threshold, the individual characteristics of the data and the group characteristics of the data are classified and predicted through the gradient trees sequentially set in the second model to obtain the second category corresponding to the data as the output result of the hybrid classification model; if the probability of the first category meets the first threshold, the first category corresponding to the data is used as the output result of the hybrid classification model; the gradient trees sequentially set in the second model are gradient boosting decision trees.
[0128] Optionally, the hybrid classification model also includes a third model; the business rules set in the third model are related to the characteristics of the data; the processing unit 502 also includes: obtaining the probability of the second category corresponding to each data through the second model; if the probability of the second category does not meet the second threshold, the individual characteristics of each data are processed through the third model to obtain the third category corresponding to each data as the output result of the hybrid classification model.
[0129] Optionally, the processing unit 502 also includes: training the hybrid classification model in the following manner: performing separate training on any monomer model in the hybrid classification model, and adjusting each parameter in the monomer model until the first evaluation indicator of the monomer model is met; any monomer model is the first model, the second model or the third model; the first evaluation indicator is used to characterize the accuracy of the first training output result obtained by each training sample in the separate training of the monomer model; performing overall training on each monomer model that has completed the training, and adjusting the first threshold and the second threshold until the second evaluation indicator of the hybrid classification model is met; the second evaluation indicator is used to characterize the accuracy of the second training output result obtained by each training sample during the overall training.
[0130] Optionally, the processing unit 502 is specifically used to: obtain, during the overall training of each training sample, each first training category obtained by the first model in the hybrid classification model as the second training output result of the hybrid classification model, each second training category obtained by the second model in the hybrid classification model as the second training output result of the hybrid classification model, and each third training category obtained by the third model in the hybrid classification model as the second training output result of the hybrid classification model; wherein, if the probability of each first training category satisfies the first initial threshold, the probability of each second training category satisfies the second initial threshold; determine the monomer accuracy of the first model according to the accuracy of each first training category; determine the monomer accuracy of the second model according to the accuracy of each second training category; determine the monomer accuracy of the third model according to the accuracy of each third training category; determine the overall accuracy through each first training category, each second training category and each third training category; determine the second evaluation indicator according to the monomer accuracy of the first model, the monomer accuracy of the second model, the monomer accuracy of the third model, the overall accuracy, and their corresponding weights.
[0131] Optionally, the first model includes multiple first sub-models; the training parameters corresponding to any two first sub-models during the training process are not exactly the same; the processing unit 502 is specifically used to: perform individual training on any first sub-model in the first model until the third evaluation indicator of the first sub-model is met; and perform overall training on the multiple first sub-models that have completed individual training until the first evaluation indicator of the first model is met.
[0132] Optionally, the processing unit 502 is specifically used to: for any first sub-model, input the individual characteristics of each training sample into the first sub-model to obtain each fourth training category; for any training category, determine the single classification accuracy corresponding to the training category from each fourth training category; determine the classification accuracy of the first sub-model through the accuracy of each fourth training category; determine the third evaluation indicator based on the classification accuracy of the first sub-model and the single classification accuracy corresponding to each training category.
[0133] Optionally, the processing unit 502 is specifically used to: input the individual characteristics of any training sample into the first model to obtain each fifth training category and the probability of each fifth training category output by each first sub-model for the training sample; determine the training category that is the same as the actual category of the training sample from each fifth training category; determine the predicted probability of the training sample according to the probability of the training category that is the same as the actual category and the corresponding third evaluation indicator of the first sub-model; determine the first evaluation indicator of the first model according to the predicted probability of each training sample.
[0134] Optionally, individual features include any one or more of the following combinations: numerical features, text features, and categorical features; group features include any one or more of the following combinations: average features of individual features of K adjacent training samples, and average features of individual features based on k-means clustering.
[0135] Based on the same technical concept, the present application embodiment provides a computing device, such as Figure 6 As shown, it includes at least one processor 601 and a memory 602 connected to the at least one processor. The specific connection medium between the processor 601 and the memory 602 is not limited in the embodiment of the present application. Figure 6 For example, the processor 601 and the memory 602 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0136] In the embodiment of the present application, the memory 602 stores instructions that can be executed by at least one processor 601, and the at least one processor 601 can perform the steps of the above-mentioned data classification method by executing the instructions stored in the memory 602.
[0137] Among them, the processor 601 is the control center of the computing device, which can use various interfaces and lines to connect various parts of the computing device, and realize the processing of the data classification method by running or executing instructions stored in the memory 602 and calling data stored in the memory 602.
[0138] Optionally, the processor 601 may include one or more processing units, and the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may also be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.
[0139] Processor 601 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor.
[0140] The memory 602 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 602 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 602 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer device, but is not limited thereto. The memory 602 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0141] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program that can be executed by a computer device. When the program runs on the computer device, the computer device executes the steps of the above-mentioned data classification method.
[0142] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0143] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0144] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0145] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0146] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A data classification method, characterized in that: Applied to a hybrid classification model, the hybrid classification model includes a first model and a second model, the method includes: Extracting individual features of each data to be classified and group features of each data; the group features are determined by K adjacent individual features; Inputting the individual characteristics of each data and the group characteristics of each data into the hybrid classification model; For any data, determine the individual features of the data and M adjacent individual features in the first model, and determine the first category corresponding to the data and the probability of the first category according to the categories corresponding to the M adjacent individual features; If the probability of the first category does not meet the first threshold, the individual characteristics of the data and the group characteristics of the data are classified and predicted by the gradient trees sequentially set in the second model to obtain the second category corresponding to the data as the output result of the hybrid classification model; the gradient trees sequentially set in the second model are gradient boosting decision trees; If the probability of the first category meets the first threshold, the first category corresponding to the data is used as the output result of the hybrid classification model.
2. The method according to claim 1, characterized in that The hybrid classification model also includes a third model; the business rules set in the third model are related to the characteristics of the data; The method further comprises: Obtaining the probabilities of the second categories corresponding to the respective data through the second model; If the probability of the second category does not meet the second threshold, the individual features of the data are processed by the third model to obtain the third category corresponding to each data as the output result of the hybrid classification model.
3. The method according to claim 1 or 2, characterized in that Before extracting the individual features of each data to be classified and the group features of each data, the method further includes: training the hybrid classification model in the following manner: Performing separate training on any single model in the hybrid classification model, by adjusting each parameter in the single model until a first evaluation index of the single model is satisfied; any single model is the first model, the second model or the third model; the first evaluation index is used to characterize the accuracy of the first training output result obtained by each training sample in the separate training of the single model; The individual models that have completed the training are trained as a whole, and the first threshold and the second threshold are adjusted until the second evaluation index of the hybrid classification model is met; the second evaluation index is used to characterize the accuracy of the second training output results obtained by each training sample during the overall training.
4. The method according to claim 3, characterized in that The second evaluation index is obtained by: Obtaining, during overall training, each training sample, each first training category obtained by the first model in the hybrid classification model as the second training output result of the hybrid classification model, each second training category obtained by the second model in the hybrid classification model as the second training output result of the hybrid classification model, and each third training category obtained by the third model in the hybrid classification model as the second training output result of the hybrid classification model; wherein, if the probability of each first training category satisfies the first initial threshold, the probability of each second training category satisfies the second initial threshold; Determining the individual accuracy of the first model according to the accuracy of each first training category; Determining the individual accuracy of the second model according to the accuracy of each second training category; Determining the individual accuracy of the third model according to the accuracy of each third training category; determining the overall accuracy through the first training categories, the second training categories, and the third training categories; The second evaluation index is determined according to the single-unit accuracy of the first model, the single-unit accuracy of the second model, the single-unit accuracy of the third model, the overall accuracy, and their respective corresponding weights.
5. The method according to claim 3, characterized in that The first model includes a plurality of first sub-models; the training parameters corresponding to any two first sub-models during the training process are not completely the same; The first model is trained separately in the following manner, including: Performing separate training on any first sub-model in the first model until a third evaluation index of the first sub-model is met; The multiple first sub-models that have completed individual training are trained as a whole until the first evaluation index of the first model is met.
6. The method according to claim 5, characterized in that Training any first sub-model in the first model separately until the third evaluation index of the first sub-model is met includes: For any first sub-model, inputting individual features of each training sample into the first sub-model to obtain each fourth training category; For any training category, determining a single classification accuracy corresponding to the training category from the fourth training categories; Determining the classification accuracy of the first sub-model by the accuracy of each fourth training category; The third evaluation index is determined according to the classification accuracy of the first sub-model and the single classification accuracy corresponding to each training category.
7. The method according to claim 5, characterized in that The first sub-models that have completed individual training are trained as a whole until the first evaluation index of the first model is met, including: Inputting the individual features of any training sample into the first model, obtaining each fifth training category and the probability of each fifth training category output by each first sub-model for the training sample; Determine, from the fifth training categories, a training category that is the same as the actual category of the training sample; Determining the predicted probability of the training sample according to the probability of the training category being the same as the actual category and the corresponding third evaluation index of the first sub-model; A first evaluation index of the first model is determined according to the prediction probability of each training sample.
8. The method according to claim 3, characterized in that The individual characteristics include any one or a combination of the following: Numerical features, text features, and categorical features; The group characteristics include any one or a combination of the following: The average features of individual features of the neighboring K training samples and the average features of individual features based on k-means clustering.
9. A data classification device, characterized in that: Applied to a hybrid classification model, the hybrid classification model includes a first model and a second model, including: An acquisition unit extracts individual features of each data to be classified and group features of each data; the group features are determined by K adjacent individual features; A processing unit, used for inputting the individual characteristics of each data and the group characteristics of each data into the hybrid classification model; for any data, determining the individual characteristics of the data and M adjacent individual characteristics in the first model, and determining the first category corresponding to the data and the probability of the first category according to the categories corresponding to the M adjacent individual characteristics; if the probability of the first category does not meet the first threshold, the individual characteristics of the data and the group characteristics of the data are classified and predicted by each gradient tree sequentially arranged in the second model to obtain the second category corresponding to the data as the output result of the hybrid classification model; if the probability of the first category meets the first threshold, the first category corresponding to the data is used as the output result of the hybrid classification model; each gradient tree sequentially arranged in the second model is a gradient boosting decision tree.
10. A computing device, characterized in that: The method comprises at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the program is executed by the processing unit, the processing unit executes any one of the methods of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: It stores a computer program executable by a computing device, and when the program is run on the computing device, the computing device executes any one of the methods of claims 1 to 8.
12. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to claim 1 are implemented.
