WO2019169700A1 - 一种数据分类方法、装置、设备及计算机可读存储介质 - Google Patents

一种数据分类方法、装置、设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2019169700A1
WO2019169700A1 PCT/CN2018/083818 CN2018083818W WO2019169700A1 WO 2019169700 A1 WO2019169700 A1 WO 2019169700A1 CN 2018083818 W CN2018083818 W CN 2018083818W WO 2019169700 A1 WO2019169700 A1 WO 2019169700A1
Authority
WO
WIPO (PCT)
Prior art keywords
sample
classification
data
samples
class
Prior art date
Application number
PCT/CN2018/083818
Other languages
English (en)
French (fr)
Inventor
伍文岳
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019169700A1 publication Critical patent/WO2019169700A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/217Validation; Performance evaluation; Active pattern learning techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/24317Piecewise classification, i.e. whereby each classification requires several discriminant rules

Definitions

  • the present application relates to the field of information processing technologies, and in particular, to a data classification method, apparatus, device, and computer readable storage medium.
  • the embodiment of the present application provides a data classification method, device, device, and computer readable storage medium, which utilizes model nesting to classify data and improve the accuracy of the prediction result.
  • an embodiment of the present application provides a data classification method, where the method includes:
  • the training sample set comprising a mixed sample set and a plurality of class majority class sample sets mixed by a plurality of types of minority class sample sets, the sample quantity of the mixed sample set and the set of the majority class sample of each class
  • the sample size approaches equilibrium
  • the second classification model is used to perform secondary prediction classification on the data to be classified to obtain a classification result
  • the first prediction result is a classification result.
  • the embodiment of the present application further provides a data classification device, where the data classification device includes a unit for implementing the data classification method according to the first aspect.
  • the embodiment of the present application further provides a computer device, including a memory, and a processor connected to the memory;
  • the memory is for storing a computer program implementing a data classification method
  • the processor is operative to execute a computer program stored in the memory to perform the method of the first aspect described above.
  • an embodiment of the present application provides a computer readable storage medium, where the one or more computer programs are stored, and the one or more computer programs can be processed by one or more The apparatus is executed to implement the method described in the first aspect above.
  • the present application provides a data classification method, apparatus, device, and computer readable storage medium.
  • the first classification model is obtained by machine learning by mixing all the minority sample sets to form a new sample set together with the majority sample set. The problem that the sample size of the minority class sample set and the majority class sample set is unbalanced is solved.
  • the second classification model is retrained by using all the minority sample sets as a new sample, and the combined prediction data is obtained by combining the first classification model and the second classification model.
  • the type solves the problem of inaccurate prediction of a few types of data.
  • FIG. 1 is a schematic flowchart diagram of a data classification method according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of a sub-flow of a data classification method according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of another sub-flow of a data classification method according to an embodiment of the present application.
  • FIG. 4 is a schematic block diagram of a data classification apparatus according to an embodiment of the present application.
  • FIG. 5 is a schematic block diagram showing a subunit structure of a data classification apparatus according to an embodiment of the present application.
  • FIG. 6 is a schematic block diagram showing another subunit structure of a data classification apparatus according to an embodiment of the present application.
  • FIG. 7 is a schematic block diagram showing the structure of a computer device according to an embodiment of the present application.
  • FIG. 1 is a schematic flowchart diagram of a data classification method according to an embodiment of the present application. The method includes steps S101 to S107.
  • class sample sets refer to a collection of certain types of data with a large sample size.
  • a few class sample sets refer to a collection of a certain type of data with a very small number of samples.
  • the number of samples of most class samples and a small number of sample sets varies greatly. For example, when the sample size ratio of the two sample sets is greater than or equal to 5, the two sample sets can be divided into a majority class sample set and a minority class sample set.
  • sample size of different types of sample sets differs greatly. If the sample set with large difference in sample size is used for model training direct prediction, for example, samples of five types of sample sets A, B, C, D, and E, A and B The number is balanced and very large, but the number of B, C, and D samples is balanced but very small. If A, B, C, D, and E are directly trained as models of independent samples, the predicted results of the model are obtained. , B, C, D or E) The accuracy is not high, so the sample size needs to be equalized.
  • sample size of each type of majority sample is much larger than the sample size of each type of minority sample, but the sum of the sample sizes of all the minority samples can be combined with any one.
  • the sample size of most types of samples is equivalent. Therefore, a small number of samples can be mixed as a new type of sample, that is, a mixed sample set to solve the problem of sample imbalance.
  • the number of samples of the two types of samples is equivalent to the number of samples of the first type of samples having a smaller number of samples exceeding 90% of the number of samples of the larger number of samples.
  • step S101 includes sub-steps S1011-S1017:
  • S1012 classify the data into labels, and obtain a plurality of class majority sample original sets and a plurality of class minority class original sets.
  • S1017 randomly extract, from each of the majority class sample sets, samples corresponding to the total number of the mixed samples to form a majority class sample set of the corresponding type, so that the sample size of each type of majority class sample set and the mixed sample The total number of mixed samples of the set approaches equilibrium to obtain the set of majority class samples of the class.
  • a plurality of types of minority samples are mixed to form a mixed sample set, and then samples corresponding to the number of the mixed sample sets are extracted from each type of majority sample to form a majority type sample set of the corresponding type, and finally each type of majority class can be made.
  • the sample set and the number of samples of the mixed sample set approach equilibrium.
  • the number of samples of each of the minority samples in the original collection of several types of minority samples collected is small, the number of each of the minority samples may vary, although the difference does not Abnormally obvious, but in order to minimize the difference in the number of samples of each type of minority class, and not to discard too many minority samples, all the minority samples with the number lower than or equal to the average are selected, and greater than the average A small number of samples are sampled with an average number of samples, and finally mixed to form a mixed sample.
  • the first classification model is based on the majority class sample set and the minority class sample set, and can be used to predict which type of majority class sample set the data belongs to or belong to the mixed sample set.
  • step S102 includes sub-steps S1021-S1024:
  • the training sample set is divided into a first training set and a first verification set.
  • S1023 Train the first training set to obtain a first classification model that is used to predict that the to-be-classified data belongs to one of the plurality of types of majority class sample sets or belongs to the new type.
  • a mixed label data is given a new label, and the mixed mixed sample set is used as a new type of data, and other majority sample sets are separately used as model training for several independent types of samples. Therefore, the first classification model can be used to predict whether the data belongs to the type of new label (ie new type) or one of several majority classes.
  • the training process of the first classification model that is, the process of step S1023, generally includes: performing feature extraction on each sample in the first training set to form a feature vector corresponding to each sample;
  • the first classification model is obtained by training the label category of the corresponding sample.
  • the first classification model is verified by using the first verification set to obtain a first classification model with high classification result accuracy, and the training sample set is divided into a first training set and a first verification set respectively. Training and model checking can improve the accuracy of data prediction.
  • the mixed sample set needs to be divided into the second training set and the second check set to perform model training and model checking respectively, so as to obtain a second classification model with high prediction accuracy, so as to improve the accuracy of data prediction.
  • the method includes the following steps: dividing the mixed sample set into a second training set and a second check set; and training the second training set to obtain one of the mixed sample sets that can be used to predict that the data to be classified belongs to a second classification model of a type corresponding to the minority sample set; the second classification model is verified by the second verification set.
  • the training process of the second classification model is consistent with the training process of the first classification model, and will not be described here.
  • the first classification model may predict that the data to be classified belongs to one of the types corresponding to the plurality of types of majority sample sets or the new type corresponding to the mixed sample set.
  • S105 Determine, according to the first prediction result, whether the second classification model needs to perform secondary prediction classification on the to-be-classified data.
  • the second classification model is used to perform secondary prediction classification on the to-be-classified data to obtain a classification result.
  • the second classification model is used to perform secondary prediction classification on the to-be-classified data, and the obtained classification result is that the to-be-classified data belongs to one of the types of the minority class sample sets.
  • the determining, according to the first prediction result, whether the second classification model needs to perform the second prediction classification on the data to be classified specifically includes: if the first prediction result is a prediction center Determining that the classified data belongs to one of the types of the plurality of types of sample sets, and determining that the second classification model is not required to perform secondary prediction classification on the to-be-classified data; To predict that the to-be-classified data belongs to the new type, it is determined that the second classification model needs to perform secondary prediction classification on the to-be-classified data.
  • the prediction result is the last accurate classification.
  • the first classification model predicts that the data to be classified belongs to a new type corresponding to the mixed sample set
  • the mixed sample set includes several types of minority type samples
  • the data to be classified needs to be performed by the second classification model.
  • the secondary prediction classification locates the minority data of the new type of mixed sample set by the data to be classified to obtain the final accurate classification result.
  • the data classification method of the embodiment of the present application can be applied to predicting a user according to behavior data of a user.
  • users with bachelor's degree and college degree are more common.
  • users with master's degree, doctoral degree, middle school education, and primary school education are more common.
  • They will obtain behavior data of users with various qualifications, and will have users with master's degree.
  • the behavioral data of users with doctoral degrees, users with secondary education, and users with primary education are integrated into a mixed sample set (with other qualifications), and the behavior data of the undergraduate group and the group with the junior degree
  • a majority class sample set the number of samples of the mixed sample set is equal to the number of the majority sample set, and then the first classification model is established according to the three sample sets, and the second classification is established according to the mixed sample set belonging to other academic qualifications.
  • the first classification model predicting whether the user is a bachelor's degree, a college degree or other academic qualification through a user's behavior data, and if it is another academic qualification, the second classification model is also required to predict that the user is a master's degree, a doctoral degree.
  • the present application provides a data classification method, which combines all the minority sample sets to form a new sample set together with the majority class sample set as a training sample for machine learning to obtain a first classification model, and solves a minority class sample set and a majority class sample.
  • FIG. 4 is a schematic block diagram of a data classification apparatus 100 according to an embodiment of the present application.
  • the data classification device 100 includes an acquisition unit 101, a first learning unit 102, a second learning unit 103, a first prediction unit 104, a determination unit 105, a second prediction unit 106, and a determination unit 107.
  • the obtaining unit 101 is configured to acquire a training sample set, where the training sample set includes a mixed sample set and a plurality of class majority class sample sets, which are a mixture of a plurality of types of minority class sample sets, and the sample quantity of the mixed sample set and each class The sample size of most class sample sets approaches equilibrium.
  • the first learning unit 102 is configured to perform machine learning on the training sample set to obtain a first classification model.
  • the second learning unit 103 is configured to perform machine learning on the mixed sample set to obtain a second classification model.
  • the first prediction unit 104 is configured to perform prediction classification on the classification data by using the first classification model to obtain a first prediction result.
  • the determining unit 105 is configured to determine, according to the first prediction result, whether the second classification model needs to perform secondary prediction classification on the to-be-classified data.
  • the second prediction unit 106 is configured to perform secondary prediction classification on the data to be classified by using the second classification model, and then perform secondary prediction classification on the data to be classified by using the second classification model to obtain a classification. result.
  • the determining unit 107 is configured to determine that the first prediction result is a classification result if the second classification model is not required to perform secondary prediction classification on the to-be-classified data.
  • the obtaining unit 101 includes the following subunits:
  • the collecting subunit 1011 is configured to collect data with tags.
  • the classification sub-unit 1012 is configured to classify the data into labels, and obtain a plurality of types of majority sample original sets and a plurality of types of minority sample original sets.
  • the first calculating sub-unit 1013 is configured to separately calculate the total number of samples of the original set of each of the minority class samples.
  • the obtaining subunit 1014 is configured to obtain a minimum total number of samples.
  • the second calculating subunit 1015 is configured to calculate an average sample size of the original set of the plurality of types of minority samples.
  • a first forming subunit 1016 configured to extract a sample of the average sample size from a raw set of a small number of samples whose total number of samples is greater than the average number of samples, and mix the remaining set of sample original sets to form the mixed sample set.
  • the third calculation subunit 1017 is configured to calculate a total number of mixed samples of the mixed sample set.
  • a second forming subunit 1018 configured to randomly extract, from each of the majority class sample sets, samples corresponding to the total number of the mixed samples to form a majority class sample set of the corresponding type, so that each type of the majority class sample set The sample size is closer to the total number of mixed samples of the mixed sample set to obtain the plurality of types of majority class sample sets.
  • the first learning unit 102 includes the following subunits:
  • the subunit 1021 is assigned to assign the mixed sample set to a new type of sample set.
  • the first dividing subunit 1022 is configured to divide the training sample set into a first training set and a first check set.
  • the first training sub-unit 1023 is configured to train the first training set to obtain one type that is applicable to the to-be-classified data belonging to the plurality of types of majority class sample sets or the first category that belongs to the new type. model.
  • the first parity subunit 1024 is configured to verify the first classification model by using the first verification set.
  • the second learning unit 103 includes the following subunits:
  • a second dividing subunit configured to divide the mixed sample set into a second training set and a second check set.
  • a second training subunit configured to train the second training set to obtain a second classification model that can be used to predict a type of the sample data to be classified that belongs to one of the minority sample sets in the mixed sample set.
  • a second parity subunit configured to verify the second classification model by using the second verification set.
  • the determining unit 105 is specifically configured to: if the first prediction result is that the data to be classified belongs to one of the types of the plurality of types of sample sets, determining that the second classification model is not required to be used Performing a second prediction classification on the data to be classified; if the first prediction result is that the data to be classified belongs to the new type, determining that the data to be classified needs to be performed by using the second classification model Sub-prediction classification.
  • the second prediction unit 106 is specifically configured to: perform second prediction classification on the to-be-classified data by using the second classification model, and obtain that the to-be-classified data belongs to one of the types of the minority-class sample sets. Classification results.
  • the above data sorting apparatus 100 can be implemented in the form of a computer program that can be run on a computer device as shown in FIG.
  • FIG. 7 is a schematic block diagram showing the structure of a computer device 200 according to an embodiment of the present application.
  • the computer device 200 can be a terminal or a server, wherein the terminal can be a communication-enabled electronic device such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device.
  • the server can be a standalone server or a server cluster consisting of multiple servers.
  • the computer device 200 includes a processor 202, a memory, and a network interface 205 connected by a system bus 201, wherein the memory can include a non-volatile storage medium 203 and an internal memory 204.
  • the non-volatile storage medium 203 of the computer device 200 can store an operating system 2031 and a computer program 2032 that, when executed, can cause the processor 202 to perform a data classification method.
  • the internal memory 204 provides an environment for the operation of the computer program 2032 in the non-volatile storage medium 203.
  • the processor 202 of the computer device 200 is used to provide computing and control capabilities to support the operation of the entire computer device 200.
  • the network interface 205 of the computer device 200 is used to perform network communications, such as transmitting assigned tasks, receiving data, and the like.
  • Obtaining a training sample set comprising a mixed sample set and a plurality of class majority class sample sets mixed by a plurality of types of minority class sample sets, the sample quantity of the mixed sample set and the set of the majority class sample of each class
  • the number of samples approaches an equilibrium; machine learning is performed on the training sample set to obtain a first classification model; machine learning is performed on the mixed sample set to obtain a second classification model; and the first classification model is used to perform classification classification on the classified data.
  • the processor 202 performs the following operations when the step of acquiring the training sample set is implemented:
  • Collecting data with tags classifying the data according to tags, obtaining a plurality of class original sample sets and a plurality of class minority sample original sets; respectively calculating the total number of samples of each class of minority sample original sets, obtaining the minimum a total number of samples; calculating an average number of samples of the original set of the plurality of types of minority samples; and extracting the sample of the average sample size from the original set of the minority samples of the total number of samples by the total number of samples and the remaining minority samples
  • the original set is mixed to form the mixed sample set; the total number of mixed samples of the mixed sample set is calculated; and each sample corresponding to the total number of the mixed samples is randomly extracted from each of the majority sample sets to form a majority of the corresponding type
  • the set of class samples is such that the sample size of each type of majority class sample set approaches the equilibrium total number of mixed samples of the mixed sample set to obtain the plurality of class majority class sample sets.
  • the processor 202 performs the following operations when performing the step of performing machine learning on the mixed sample set to obtain the first classification model:
  • the data belongs to one of the types corresponding to the plurality of types of majority class sample sets or the first classification model belonging to the new type; and the first classification model is verified by using the first verification set.
  • the processor 202 performs the following operations when performing the step of determining, according to the first prediction result, whether the second classification model needs to perform secondary prediction classification on the to-be-classified data:
  • the first prediction result is that the data to be classified belongs to one of the types of the plurality of types of sample sets, determining that the second classification model is not required to perform the second If the first prediction result is that the data to be classified belongs to the new type, it is determined that the second classification model is required to perform secondary prediction classification on the data to be classified.
  • the processor 202 performs the following operations when performing the step of performing secondary prediction classification on the to-be-classified data by using the second classification model to obtain a classification result:
  • the second classification model is used to perform secondary prediction classification on the to-be-classified data, and the classification result that the to-be-classified data belongs to one of the types of minority sample collections is obtained.
  • the embodiment of the computer device shown in FIG. 7 does not constitute a limitation on the specific configuration of the computer device.
  • the computer device may include more or fewer components than illustrated. Or combine some parts, or different parts.
  • the computer device may include only a memory and a processor. In such an embodiment, the structure and function of the memory and the processor are the same as those of the embodiment shown in FIG. 7, and details are not described herein again.
  • the application further provides a computer readable storage medium storing one or more computer programs, the one or more computer programs being executable by one or more processors, All of the embodiments of the above data classification method can be implemented by one or more programs being executed by one or more processors.
  • the computer readable storage medium may be an internal storage unit of the aforementioned device, such as a hard disk or memory of the device.
  • the computer readable storage medium may also be an external storage device of the device, such as a plug-in hard disk equipped on the device, a smart memory card (SMC), and a secure digital (SD) card. , Flash Card, etc.
  • the computer readable storage medium may also include both an internal storage unit of the device and an external storage device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请实施例提供一种数据分类方法、装置、设备及计算机可读存储介质。本申请实施例通过将所有少数类样本集合混合形成一个新的样本集合与多数类样本集合一起作为训练样本进行机器学习得到第一分类模型,解决了少数类样本集合与多数类样本集合样本数量不均衡的问题,通过所有少数类样本集合作为新的样本重新训练得到第二分类模型,通过第一分类模型和第二分类模型的结合预测数据的类型,解决了对少数类数据预测不准确的问题。

Description

一种数据分类方法、装置、设备及计算机可读存储介质
本申请要求于2018年03月08日提交中国专利局、申请号为201810191039.4、申请名称为“一种数据分类方法、装置、设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及信息处理技术领域,尤其涉及一种数据分类方法、装置、设备及计算机可读存储介质。
背景技术
目前在数据建模将数据分类的过程中,特别是多分类的情况下,往往会存在各类样本呈现类不均衡问题,当各类的训练样本数量差异相当大时,直接利用不均衡的样本进行训练得到分类模型的话,由于各类样本数量的不均衡性,模型训练的结果可能很不理想,那么利用训练得到的模型进行预测而获得的预测结果也不理想,甚至预测结果是相反的。
目前比较普遍的做法是将数量较少的那些样本通过产生新样本的方法来使得样本数量增加,以达到与数量较多的样本数量均衡的水平,但由于新样本不是真实的样本,且产生的新样本不能过多,因此需要放弃较多数样本中的大部分样本分样本,但由于丢弃了大部分样本,建立的数据模型其预测结果可能会不准确。
发明内容
本申请实施例提供了一种数据分类方法、装置、设备及计算机可读存储介质,利用模型嵌套的方式对数据进行分类,提高预测结果的准确性。
第一方面,本申请实施例提供了一种数据分类方法,该方法包括:
获取训练样本集合,所述训练样本集合包括由若干类少数类样本集合混合而成的混合样本集合和若干类多数类样本集合,所述混合样本集合的样本数量与每一类多数类样本集合的样本数量趋近均衡;
对所述训练样本集合进行机器学习得到第一分类模型;
对所述混合样本集合进行机器学习得到第二分类模型;
利用所述第一分类模型对待分类数据进行预测分类,得到第一预测结果;
根据所述第一预测结果判断是否需要利用所述第二分类模型对所述待分类数据进行二次预测分类;
若是,则利用所述第二分类模型对所述待分类数据进行二次预测分类以得到分类结果;
若否,则确定所述第一预测结果为分类结果。
第二方面,本申请实施例还提供了一种数据分类装置,所述数据分类装置包括用于实现第一方面所述的数据分类方法的单元。
第三方面,本申请实施例还提供了一种计算机设备,包括存储器,以及与所述存储器相连的处理器;
所述存储器用于存储实现数据分类方法的计算机程序;
所述处理器用于运行所述存储器中存储的计算机程序,以执行如上述第一方面所述的方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上计算机程序,所述一个或者一个以上计算机程序可被一个或者一个以上的处理器执行,以实现上述第一方面所述的方法。
本申请提供了数据分类方法、装置、设备及计算机可读存储介质,通过将所有少数类样本集合混合形成一个新的样本集合与多数类样本集合一起作为训练样本进行机器学习得到第一分类模型,解决了少数类样本集合与多数类样本集合样本数量不均衡的问题,通过所有少数类样本集合作为新的样本重新训练得到第二分类模型,通过第一分类模型和第二分类模型的结合预测数据的类型,解决了对少数类数据预测不准确的问题。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种数据分类方法的流程示意图;
图2是本申请实施例提供的一种数据分类方法的子流程示意图;
图3是本申请实施例提供的一种数据分类方法的另一子流程示意图;
图4是本申请实施例提供的一种数据分类装置的示意性框图;
图5是本申请实施例提供的一种数据分类装置的子单元结构示意性框图;
图6是本申请实施例提供的一种数据分类装置的另一子单元结构示意性框图;
图7是本申请实施例提供的一种计算机设备的结构示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
也应当理解,尽管术语第一、第二等可以在此用来描述各种元素,但这些元素不应该受限于这些术语,这些术语仅用来将这些元素彼此区分开。
图1为本申请实施例提供的一种数据分类方法的流程示意图。该方法包括步骤S101~S107。
S101,获取训练样本集合,所述训练样本集合包括由若干类少数类样本集合混合而成的混合样本集合和若干类多数类样本集合,所述混合样本集合的样本数量与每一类多数类样本集合的样本数量趋近均衡。
多数类样本集合指的是样本数量大的某一类数据的集合,少数类样本集合指的是样本数量非常少的某一类数据的集合,多数类样本集合和少数类样本集 合的数量差异巨大,例如,当两个样本集合的样本数量比值大于或等于5时,可以将这两个样本集合分为多数类样本集合和少数类样本集合。
不同类型的样本集合的样本数量相差较大,如果利用样本数量差异较大的样本集合进行模型训练直接预测,例如,五类样本集合A、B、C、D、和E,A和B的样本数量均衡且非常多,但B、C和D样本数量均衡但非常少,如果直接将A、B、C、D和E作为独立的一类样本进行模型训练,得到的模型其预测结果(属于A、B、C、D或E)准确率不高,因此需要将样本数量均衡化。
在样本采集的过程中会出现这样一种情况:每一类多数类样本的样本数量远远大于每一类少数类样本的样本数量,但所有少数类样本的样本数量之和能够与任意一类多数类样本的样本数量相当,因此,可以将少数类样本混合作为一个新类型的样本,即混合样本集合,以解决样本不均衡的问题。
在本申请实施例中,两类样本的样本数量相当指的数量较少的一类样本的样本数量达到数量较多的一类样本的样本数量的90%以上。
具体地,如图2所示,步骤S101包括子步骤S1011-S1017:
S1011,采集带有标签的数据。
S1012,将所述数据按标签进行分类,得到若干类多数类样本原始集合和若干类少数类样本原始集合。
S1013,分别计算每一类少数类样本原始集合的样本总数量,获取最小样本总数量。
S1014,计算所述若干类少数类样本原始集合的平均样本数量。
S1015,从样本总数量大于所述平均样本数量的少数类样本原始集合中抽取所述平均样本数量的样本与剩余的少数类样本原始集合混合,形成所述混合样本集合。
S1016,计算所述混合样本集合的混合样本总数量。
S1017,分别从每一个多数类样本集合中随机抽取与所述混合样本总数量相当的样本分别形成对应类型的多数类样本集合,以使每一类多数类样本集合的样本数量与所述混合样本集合的混合样本总数量趋近均衡,以得到所述若干类多数类样本集合。
以上通过将若干类少数类样本混合形成混合样本集合,而后从每一类多数类样本中抽取与该混合样本集合数量相当的样本形成对应类型的多数类样本集合,最终能够使得每一类多数类样本集合以及该混合样本集合的样本数量趋近均衡。
在本申请实施例中,采集到的若干类少数类样本原始集合中的每一类少数类样本的样本数量虽然较少,但每一类少数类样本的数目也会存在差异,虽然差异不会异常明显,但为了尽可能地缩小每一类少数类样本的数量差异,同时也不丢弃过多的少数类样本,将数量低于或等于平均值的少数类样本全部选取,而大于平均值的少数类样本选取平均值数量的样本,最终混合形成了混合样本。
S102,对所述训练样本集合进行机器学习得到第一分类模型。
第一分类模型是基于多数类样本集合和少数类样本集合得到的,可用于预测数据属于哪一类多数类样本集合或属于混合样本集合。
在本申请实施例中,如图3所示,步骤S102包括子步骤S1021-S1024:
S1021,将所述混合样本集合赋为一种新类型的样本集合。
S1022,将所述训练样本集合分为第一训练集合和第一校验集合。
S1023,将所述第一训练集合进行训练得到可用于预测待分类数据属于所述若干类多数类样本集合对应的其中一种类型或属于所述新类型的第一分类模型。
S1024,利用所述第一校验集合校验所述第一分类模型。
在本申请实施例中,给混合样本数据赋予一个新标签,将混合而成的混合样本集合作为一种新类型的数据,与其他的多数类样本集合分别作为几种独立种类的样本进行模型训练,因此第一分类模型可以用来预测数据属于新标签的种类(即新类型)还是若干多数类中的其中一类。
第一分类模型的训练过程,即步骤S1023的过程,一般包括:对所述第一训练集合中的每个样本进行特征提取以形成所述每个样本对应的特征向量;对所述特征向量和对应样本的标签类别进行训练得到第一分类模型。
利用所述第一校验集合校验所述第一分类模型是为了得到分类结果准确率高的第一分类模型,通过将训练样本集合分为第一训练集合和第一校验集合分别进行模型训练和模型校验,可以提高数据预测的准确率。
S103,对所述混合样本集合进行机器学习得到第二分类模型。
同样地,需要将混合样本集合分为第二训练集合和第二校验集合分别进行模型训练和模型校验,以便得到预测准确率高的第二分类模型,以提高数据预测的准确率。具体包括以下步骤:将所述混合样本集合分为第二训练集合和第二校验集合;将所述第二训练集合进行训练得到可用于预测待分类数据属于所述混合样本集合中的其中一个少数类样本集合对应的类型的第二分类模型;利用所述第二校验集合校验所述第二分类模型。
第二分类模型的训练过程与第一分类模型的训练过程一致,在此不赘述。
S104,利用所述第一分类模型对待分类数据进行预测分类,得到第一预测结果。
第一分类模型可预测待分类数据属于所述若干类多数类样本集合对应的其中一种类型或属于混合样本集合对应的新类型。
S105,根据所述第一预测结果判断是否需要利用所述第二分类模型对所述待分类数据进行二次预测分类。
S106,若是,则利用所述第二分类模型对所述待分类数据进行二次预测分类以得到分类结果。
具体地,利用所述第二分类模型对所述待分类数据进行二次预测分类,得到的分类结果为所述待分类数据属于所述若干类少数类样本集合对应的其中一种类型。
S107,若否,则确定所述第一预测结果为分类结果。
在本申请实施例中,所述根据所述第一预测结果判断是否需要利用所述第二分类模型对所述待分类数据进行二次预测分类具体包括:若所述第一预测结果为预测所述待分类数据属于所述若干类多数类样本集合对应的其中一种类型,则判定不需要利用所述第二分类模型对所述待分类数据进行二次预测分类;若所述第一预测结果为预测所述待分类数据属于所述新类型,则判定需要利用所述第二分类模型对所述待分类数据进行二次预测分类。
因为各多数类样本集合以及混合样本集合的样本数量是趋近均衡的,因此当第一分类模型预测待分类数据属于某一多数类样本对应的类型,则其预测结果则为最后准确的分类结果;当第一分类模型预测待分类数据属于混合样本集合对应的新类型,由于混合样本集合中包括了几种类型的少数类样本,于是还需要通过第二分类模型对所述待分类数据进行二次预测分类,将待分类数据定位到该新类型的混合样本集合中的哪一种少数类,以得到最终准确的分类结果。
本申请实施例的数据分类方法可应用于根据用户的行为数据对用户进行学历预测。当前社会的用户群体,具有本科学历和专科学历的用户比较普遍,硕士学历、博士学历、中学学历、小学学历的用户较少,分别获取各类学历的用户的行为数据,将具有硕士学历的用户、具有博士学历的用户、具有中学学历的用户、以及具有小学学历的用户的行为数据整合成为一个(具有其他学历的)混合样本集合,将具有本科学历的群体和具有专科学历的群体的行为数据分别作为一个多数类样本集合,同时使混合样本集合的样本数量与多数类样本集合 的数量相当,然后根据这三个样本集合建立第一分类模型,根据属于其他学历的混合样本集合建立第二分类模型;利用该第一分类模型,通过某用户的行为数据来预测该用户是本科学历、大专学历或其他学历,如果是其他学历,则还需要通过第二分类模型预测该用户是硕士学历、博士学历、中学学历或小学学历。
本申请提供了数据分类方法,通过将所有少数类样本集合混合形成一个新的样本集合与多数类样本集合一起作为训练样本进行机器学习得到第一分类模型,解决了少数类样本集合与多数类样本集合样本数量不均衡的问题,通过所有少数类样本集合作为新的样本重新训练得到第二分类模型,通过第一分类模型和第二分类模型的结合预测数据的类型,解决了对少数类数据预测不准确的问题。
图4为本申请实施例提供的一种数据分类装置100的示意性框图。该数据分类装置100包括获取单元101、第一学习单元102、第二学习单元103、第一预测单元104、判断单元105、第二预测单元106和确定单元107。
获取单元101用于获取训练样本集合,所述训练样本集合包括由若干类少数类样本集合混合而成的混合样本集合和若干类多数类样本集合,所述混合样本集合的样本数量与每一类多数类样本集合的样本数量趋近均衡。
第一学习单元102用于对所述训练样本集合进行机器学习得到第一分类模型。
第二学习单元103用于对所述混合样本集合进行机器学习得到第二分类模型。
第一预测单元104用于利用所述第一分类模型对待分类数据进行预测分类,得到第一预测结果。
判断单元105用于根据所述第一预测结果判断是否需要利用所述第二分类模型对所述待分类数据进行二次预测分类。
第二预测单元106用于若需要利用所述第二分类模型对所述待分类数据进行二次预测分类,则利用所述第二分类模型对所述待分类数据进行二次预测分类以得到分类结果。
确定单元107用于若不需要利用所述第二分类模型对所述待分类数据进行二次预测分类,则确定所述第一预测结果为分类结果。
在本申请实施例中,如图5所示,所述获取单元101包括以下子单元:
采集子单元1011,用于采集带有标签的数据。
分类子单元1012,用于将所述数据按标签进行分类,得到若干类多数类样本原始集合和若干类少数类样本原始集合。
第一计算子单元1013,用于分别计算每一类少数类样本原始集合的样本总数量。
获取子单元1014,用于获取最小样本总数量。
第二计算子单元1015,用于计算所述若干类少数类样本原始集合的平均样本数量。
第一形成子单元1016,用于从样本总数量大于所述平均样本数量的少数类样本原始集合中抽取所述平均样本数量的样本与剩余的少数类样本原始集合混合,形成所述混合样本集合。
第三计算子单元1017,用于计算所述混合样本集合的混合样本总数量。
第二形成子单元1018,用于分别从每一个多数类样本集合中随机抽取与所述混合样本总数量相当的样本分别形成对应类型的多数类样本集合,以使每一类多数类样本集合的样本数量与所述混合样本集合的混合样本总数量趋近均衡,以得到所述若干类多数类样本集合。
如图6所示,所述第一学习单元102包括以下子单元:
赋予子单元1021,用于将所述混合样本集合赋为一种新类型的样本集合。
第一划分子单元1022,用于将所述训练样本集合分为第一训练集合和第一校验集合。
第一训练子单元1023,用于将所述第一训练集合进行训练得到可用于预测待分类数据属于所述若干类多数类样本集合对应的其中一种类型或属于所述新类型的第一分类模型。
第一校验子单元1024,用于利用所述第一校验集合校验所述第一分类模型。
在本申请实施例中,所述第二学习单元103包括以下子单元:
第二划分子单元,用于将所述混合样本集合分为第二训练集合和第二校验集合。
第二训练子单元,用于将所述第二训练集合进行训练得到可用于预测待分类数据属于所述混合样本集合中的其中一个少数类样本集合对应的类型的第二 分类模型。
第二校验子单元,用于利用所述第二校验集合校验所述第二分类模型。
所述判断单元105具体用于:若所述第一预测结果为预测所述待分类数据属于所述若干类多数类样本集合对应的其中一种类型,则判定不需要利用所述第二分类模型对所述待分类数据进行二次预测分类;若所述第一预测结果为预测所述待分类数据属于所述新类型,则判定需要利用所述第二分类模型对所述待分类数据进行二次预测分类。
第二预测单元106具体用于:利用所述第二分类模型对所述待分类数据进行二次预测分类,得到所述待分类数据属于所述若干类少数类样本集合对应的其中一种类型的分类结果。
上述数据分类装置100的作用以及各个单元的具体描述,本申请实施例未详尽之处可参考上述方法实施例,此处不做赘述。
上述数据分类装置100可以实现为一种计算机程序的形式,计算机程序可以在如图7所示的计算机设备上运行。
图7为本申请实施例提供的一种计算机设备200的结构示意性框图。该计算机设备200,可以是终端,也可以是服务器,其中,终端可以是智能手机、平板电脑、笔记本电脑、台式电脑、个人数字助理和穿戴式设备等具有通信功能的电子设备。服务器可以是独立的服务器,也可以是多个服务器组成的服务器集群。
该计算机设备200,包括通过系统总线201连接的处理器202、存储器和网络接口205,其中,存储器可以包括非易失性存储介质203和内存储器204。
该计算机设备200的非易失性存储介质203可存储操作系统2031和计算机程序2032,该计算机程序2032被执行时,可使得处理器202执行一种数据分类方法。该内存储器204为非易失性存储介质203中的计算机程序2032的运行提供环境。该计算机设备200的处理器202用于提供计算和控制能力,支撑整个计算机设备200的运行。
计算机设备200的网络接口205用于进行网络通信,如发送分配的任务、接收数据等。
处理器202运行非易失性存储介质203中的计算机程序2032时,执行如下操作:
获取训练样本集合,所述训练样本集合包括由若干类少数类样本集合混合 而成的混合样本集合和若干类多数类样本集合,所述混合样本集合的样本数量与每一类多数类样本集合的样本数量趋近均衡;对所述训练样本集合进行机器学习得到第一分类模型;对所述混合样本集合进行机器学习得到第二分类模型;利用所述第一分类模型对待分类数据进行预测分类,得到第一预测结果;根据所述第一预测结果判断是否需要利用所述第二分类模型对所述待分类数据进行二次预测分类;若是,则利用所述第二分类模型对所述待分类数据进行二次预测分类以得到分类结果;若否,则确定所述第一预测结果为分类结果。
在一实施例中,所述处理器202在实现所述获取训练样本集合的步骤时具体执行如下操作:
采集带有标签的数据;将所述数据按标签进行分类,得到若干类多数类样本原始集合和若干类少数类样本原始集合;分别计算每一类少数类样本原始集合的样本总数量,获取最小样本总数量;计算所述若干类少数类样本原始集合的平均样本数量;从样本总数量大于所述平均样本数量的少数类样本原始集合中抽取所述平均样本数量的样本与剩余的少数类样本原始集合混合,形成所述混合样本集合;计算所述混合样本集合的混合样本总数量;分别从每一个多数类样本集合中随机抽取与所述混合样本总数量相当的样本分别形成对应类型的多数类样本集合,以使每一类多数类样本集合的样本数量与所述混合样本集合的混合样本总数量趋近均衡,以得到所述若干类多数类样本集合。
在一实施例中,所述处理器202在实现对所述混合样本集合进行机器学习得到第一分类模型的步骤时具体执行如下操作:
将所述混合样本集合赋为一种新类型的样本集合;将所述训练样本集合分为第一训练集合和第一校验集合;将所述第一训练集合进行训练得到可用于预测待分类数据属于所述若干类多数类样本集合对应的其中一种类型或属于所述新类型的第一分类模型;利用所述第一校验集合校验所述第一分类模型。
在一实施例中,所述处理器202在实现根据所述第一预测结果判断是否需要利用所述第二分类模型对所述待分类数据进行二次预测分类的步骤时具体执行如下操作:
若所述第一预测结果为预测所述待分类数据属于所述若干类多数类样本集合对应的其中一种类型,则判定不需要利用所述第二分类模型对所述待分类数据进行二次预测分类;若所述第一预测结果为预测所述待分类数据属于所述新类型,则判定需要利用所述第二分类模型对所述待分类数据进行二次预测分类。
在一实施例中,所述处理器202在实现利用所述第二分类模型对所述待分 类数据进行二次预测分类以得到分类结果的步骤时具体执行如下操作:
利用所述第二分类模型对所述待分类数据进行二次预测分类,得到所述待分类数据属于所述若干类少数类样本集合对应的其中一种类型的分类结果。
本领域技术人员可以理解,图7中示出的计算机设备的实施例并不构成对计算机设备具体构成的限定,在其他实施例中,计算机设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。例如,在一些实施例中,计算机设备可以仅包括存储器及处理器,在这样的实施例中,存储器及处理器的结构及功能与图7所示实施例一致,在此不再赘述。
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上计算机程序,所述一个或者一个以上计算机程序可被一个或者一个以上的处理器执行,当所述一个或者一个以上程序被一个或者一个以上的处理器执行,可实现上述数据分类方法的所有实施例。所述计算机可读存储介质可以是前述设备的内部存储单元,例如设备的硬盘或内存。所述计算机可读存储介质也可以是所述设备的外部存储设备,例如所述设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述计算机可读存储介质还可以既包括所述设备的内部存储单元也包括外部存储设备。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种数据分类方法,其特征在于,包括:
    获取训练样本集合,所述训练样本集合包括由若干类少数类样本集合混合而成的混合样本集合和若干类多数类样本集合,所述混合样本集合的样本数量与每一类多数类样本集合的样本数量趋近均衡;
    对所述训练样本集合进行机器学习得到第一分类模型;
    对所述混合样本集合进行机器学习得到第二分类模型;
    利用所述第一分类模型对待分类数据进行预测分类,得到第一预测结果;
    根据所述第一预测结果判断是否需要利用所述第二分类模型对所述待分类数据进行二次预测分类;
    若是,则利用所述第二分类模型对所述待分类数据进行二次预测分类以得到分类结果;
    若否,则确定所述第一预测结果为分类结果。
  2. 根据权利要求1所述的数据分类方法,其特征在于,所述获取训练样本集合,包括:
    采集带有标签的数据;
    将所述数据按标签进行分类,得到若干类多数类样本原始集合和若干类少数类样本原始集合;
    分别计算每一类少数类样本原始集合的样本总数量,获取最小样本总数量;
    计算所述若干类少数类样本原始集合的平均样本数量;
    从样本总数量大于所述平均样本数量的少数类样本原始集合中抽取所述平均样本数量的样本与剩余的少数类样本原始集合混合,形成所述混合样本集合;
    计算所述混合样本集合的混合样本总数量;
    分别从每一个多数类样本集合中随机抽取与所述混合样本总数量相当的样本分别形成对应类型的多数类样本集合,以使每一类多数类样本集合的样本数量与所述混合样本集合的混合样本总数量趋近均衡,以得到所述若干类多数类样本集合。
  3. 根据权利要求1所述的数据分类方法,其特征在于,所述对所述混合样本集合进行机器学习得到第一分类模型,包括:
    将所述混合样本集合赋为一种新类型的样本集合;
    将所述训练样本集合分为第一训练集合和第一校验集合;
    将所述第一训练集合进行训练得到可用于预测待分类数据属于所述若干类多数类样本集合对应的其中一种类型或属于所述新类型的第一分类模型;
    利用所述第一校验集合校验所述第一分类模型。
  4. 根据权利要求3所述的数据分类方法,其特征在于,所述根据所述第一预测结果判断是否需要利用所述第二分类模型对所述待分类数据进行二次预测分类,包括:
    若所述第一预测结果为预测所述待分类数据属于所述若干类多数类样本集合对应的其中一种类型,则判定不需要利用所述第二分类模型对所述待分类数据进行二次预测分类;
    若所述第一预测结果为预测所述待分类数据属于所述新类型,则判定需要利用所述第二分类模型对所述待分类数据进行二次预测分类。
  5. 根据权利要求1所述的数据分类方法,其特征在于,所述利用所述第二分类模型对所述待分类数据进行二次预测分类以得到分类结果,包括:
    利用所述第二分类模型对所述待分类数据进行二次预测分类,得到所述待分类数据属于所述若干类少数类样本集合对应的其中一种类型的分类结果。
  6. 一种数据分类装置,其特征在于,包括:
    获取单元,用于获取训练样本集合,所述训练样本集合包括由若干类少数类样本集合混合而成的混合样本集合和若干类多数类样本集合,所述混合样本集合的样本数量与每一类多数类样本集合的样本数量趋近均衡;
    第一学习单元,用于对所述训练样本集合进行机器学习得到第一分类模型;
    第二学习单元,用于对所述混合样本集合进行机器学习得到第二分类模型;
    第一预测单元,用于利用所述第一分类模型对待分类数据进行预测分类,得到第一预测结果;
    判断单元,用于根据所述第一预测结果判断是否需要利用所述第二分类模型对所述待分类数据进行二次预测分类;
    第二预测单元,用于若需要利用所述第二分类模型对所述待分类数据进行二次预测分类,则利用所述第二分类模型对所述待分类数据进行二次预测分类以得到分类结果;
    确定单元,用于若不需要利用所述第二分类模型对所述待分类数据进行二次预测分类,则确定所述第一预测结果为分类结果。
  7. 根据权利要求6所述的数据分类装置,其特征在于,所述获取单元包括:
    采集子单元,用于采集带有标签的数据;
    分类子单元,用于将所述数据按标签进行分类,得到若干类多数类样本原始集合和若干类少数类样本原始集合;
    第一计算子单元,用于分别计算每一类少数类样本原始集合的样本总数量;
    获取子单元,用于获取最小样本总数量;
    第二计算子单元,用于计算所述若干类少数类样本原始集合的平均样本数量;
    第一形成子单元,用于从样本总数量大于所述平均样本数量的少数类样本原始集合中抽取所述平均样本数量的样本与剩余的少数类样本原始集合混合,形成所述混合样本集合;
    第三计算子单元,用于计算所述混合样本集合的混合样本总数量;
    第二形成子单元,用于分别从每一个多数类样本集合中随机抽取与所述混合样本总数量相当的样本分别形成对应类型的多数类样本集合,以使每一类多数类样本集合的样本数量与所述混合样本集合的混合样本总数量趋近均衡,以得到所述若干类多数类样本集合。
  8. 根据权利要求6所述的数据分类装置,其特征在于,所述第一学习单元包括:
    赋予子单元,用于将所述混合样本集合赋为一种新类型的样本集合;
    第一划分子单元,用于将所述训练样本集合分为第一训练集合和第一校验集合;
    第一训练子单元,用于将所述第一训练集合进行训练得到可用于预测待分类数据属于所述若干类多数类样本集合对应的其中一种类型或属于所述新类型的第一分类模型;
    第一校验子单元,用于利用所述第一校验集合校验所述第一分类模型。
  9. 根据权利要求8所述的数据分类装置,其特征在于,所述判断单元具体用于:若所述第一预测结果为预测所述待分类数据属于所述若干类多数类样本集合对应的其中一种类型,则判定不需要利用所述第二分类模型对所述待分类数据进行二次预测分类;若所述第一预测结果为预测所述待分类数据属于所述新类型,则判定需要利用所述第二分类模型对所述待分类数据进行二次预测分类。
  10. 根据权利要求6所述的数据分类装置,其特征在于,所述第二预测单元具体用于:利用所述第二分类模型对所述待分类数据进行二次预测分类,得到所述待分类数据属于所述若干类少数类样本集合对应的其中一种类型的分类结 果。
  11. 一种计算机设备,其特征在于,包括存储器,以及与所述存储器相连的处理器;
    所述存储器用于存储实现数据分类方法的计算机程序;
    所述处理器用于运行所述存储器中存储的计算机程序,以执行以下步骤:
    获取训练样本集合,所述训练样本集合包括由若干类少数类样本集合混合而成的混合样本集合和若干类多数类样本集合,所述混合样本集合的样本数量与每一类多数类样本集合的样本数量趋近均衡;
    对所述训练样本集合进行机器学习得到第一分类模型;
    对所述混合样本集合进行机器学习得到第二分类模型;
    利用所述第一分类模型对待分类数据进行预测分类,得到第一预测结果;
    根据所述第一预测结果判断是否需要利用所述第二分类模型对所述待分类数据进行二次预测分类;
    若是,则利用所述第二分类模型对所述待分类数据进行二次预测分类以得到分类结果;
    若否,则确定所述第一预测结果为分类结果。
  12. 根据权利要求11所述的计算机设备,其特征在于,所述处理器在执行所述获取训练样本集合的步骤时,具体执行以下步骤:
    采集带有标签的数据;
    将所述数据按标签进行分类,得到若干类多数类样本原始集合和若干类少数类样本原始集合;
    分别计算每一类少数类样本原始集合的样本总数量,获取最小样本总数量;
    计算所述若干类少数类样本原始集合的平均样本数量;
    从样本总数量大于所述平均样本数量的少数类样本原始集合中抽取所述平均样本数量的样本与剩余的少数类样本原始集合混合,形成所述混合样本集合;
    计算所述混合样本集合的混合样本总数量;
    分别从每一个多数类样本集合中随机抽取与所述混合样本总数量相当的样本分别形成对应类型的多数类样本集合,以使每一类多数类样本集合的样本数量与所述混合样本集合的混合样本总数量趋近均衡,以得到所述若干类多数类样本集合。
  13. 根据权利要求11所述的计算机设备,其特征在于,所述处理器在执行所述对所述混合样本集合进行机器学习得到第一分类模型的步骤时,具体执行 以下步骤:
    将所述混合样本集合赋为一种新类型的样本集合;
    将所述训练样本集合分为第一训练集合和第一校验集合;
    将所述第一训练集合进行训练得到可用于预测待分类数据属于所述若干类多数类样本集合对应的其中一种类型或属于所述新类型的第一分类模型;
    利用所述第一校验集合校验所述第一分类模型。
  14. 根据权利要求13所述的计算机设备,其特征在于,所述处理器在执行所述根据所述第一预测结果判断是否需要利用所述第二分类模型对所述待分类数据进行二次预测分类的步骤时,具体执行以下:若所述第一预测结果为预测所述待分类数据属于所述若干类多数类样本集合对应的其中一种类型,则判定不需要利用所述第二分类模型对所述待分类数据进行二次预测分类;
    若所述第一预测结果为预测所述待分类数据属于所述新类型,则判定需要利用所述第二分类模型对所述待分类数据进行二次预测分类。
  15. 根据权利要求11所述的计算机设备,其特征在于,所述处理器在执行所述利用所述第二分类模型对所述待分类数据进行二次预测分类以得到分类结果的步骤时,具体执行以下:利用所述第二分类模型对所述待分类数据进行二次预测分类,得到所述待分类数据属于所述若干类少数类样本集合对应的其中一种类型的分类结果。
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有一个或者一个以上计算机程序,所述一个或者一个以上计算机程序可被一个或者一个以上的处理器执行,以实现以下步骤:
    获取训练样本集合,所述训练样本集合包括由若干类少数类样本集合混合而成的混合样本集合和若干类多数类样本集合,所述混合样本集合的样本数量与每一类多数类样本集合的样本数量趋近均衡;
    对所述训练样本集合进行机器学习得到第一分类模型;
    对所述混合样本集合进行机器学习得到第二分类模型;
    利用所述第一分类模型对待分类数据进行预测分类,得到第一预测结果;
    根据所述第一预测结果判断是否需要利用所述第二分类模型对所述待分类数据进行二次预测分类;
    若是,则利用所述第二分类模型对所述待分类数据进行二次预测分类以得到分类结果;
    若否,则确定所述第一预测结果为分类结果。
  17. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述获取训练样本集合的步骤包括:
    采集带有标签的数据;
    将所述数据按标签进行分类,得到若干类多数类样本原始集合和若干类少数类样本原始集合;
    分别计算每一类少数类样本原始集合的样本总数量,获取最小样本总数量;
    计算所述若干类少数类样本原始集合的平均样本数量;
    从样本总数量大于所述平均样本数量的少数类样本原始集合中抽取所述平均样本数量的样本与剩余的少数类样本原始集合混合,形成所述混合样本集合;
    计算所述混合样本集合的混合样本总数量;
    分别从每一个多数类样本集合中随机抽取与所述混合样本总数量相当的样本分别形成对应类型的多数类样本集合,以使每一类多数类样本集合的样本数量与所述混合样本集合的混合样本总数量趋近均衡,以得到所述若干类多数类样本集合。
  18. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述对所述混合样本集合进行机器学习得到第一分类模型的步骤包括:
    将所述混合样本集合赋为一种新类型的样本集合;
    将所述训练样本集合分为第一训练集合和第一校验集合;
    将所述第一训练集合进行训练得到可用于预测待分类数据属于所述若干类多数类样本集合对应的其中一种类型或属于所述新类型的第一分类模型;
    利用所述第一校验集合校验所述第一分类模型。
  19. 根据权利要求18所述的计算机可读存储介质,其特征在于,所述根据所述第一预测结果判断是否需要利用所述第二分类模型对所述待分类数据进行二次预测分类的步骤包括:若所述第一预测结果为预测所述待分类数据属于所述若干类多数类样本集合对应的其中一种类型,则判定不需要利用所述第二分类模型对所述待分类数据进行二次预测分类;若所述第一预测结果为预测所述待分类数据属于所述新类型,则判定需要利用所述第二分类模型对所述待分类数据进行二次预测分类。
  20. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述利用所述第二分类模型对所述待分类数据进行二次预测分类以得到分类结果的步骤包括:利用所述第二分类模型对所述待分类数据进行二次预测分类,得到所述待分类数据属于所述若干类少数类样本集合对应的其中一种类型的分类结果。
PCT/CN2018/083818 2018-03-08 2018-04-20 一种数据分类方法、装置、设备及计算机可读存储介质 WO2019169700A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810191039.4A CN108388924A (zh) 2018-03-08 2018-03-08 一种数据分类方法、装置、设备及计算机可读存储介质
CN201810191039.4 2018-03-08

Publications (1)

Publication Number Publication Date
WO2019169700A1 true WO2019169700A1 (zh) 2019-09-12

Family

ID=63067077

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/083818 WO2019169700A1 (zh) 2018-03-08 2018-04-20 一种数据分类方法、装置、设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN108388924A (zh)
WO (1) WO2019169700A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112132208A (zh) * 2020-09-18 2020-12-25 北京奇艺世纪科技有限公司 图像转换模型的生成方法、装置、电子设备及存储介质
CN112182269A (zh) * 2020-09-27 2021-01-05 北京达佳互联信息技术有限公司 图像分类模型的训练、图像分类方法、装置、设备及介质
WO2021103401A1 (zh) * 2019-11-25 2021-06-03 深圳壹账通智能科技有限公司 数据对象分类方法、装置、计算机设备和存储介质
CN113255748A (zh) * 2021-05-14 2021-08-13 广州织点智能科技有限公司 一种商品识别模型的特征底库更新方法及装置
CN114154578A (zh) * 2021-12-02 2022-03-08 内蒙古工业大学 面向非平衡数据基于半监督分布式训练的任务识别方法
CN115879587A (zh) * 2022-01-11 2023-03-31 北京中关村科金技术有限公司 样本不均衡条件下的投诉预测方法、装置及存储介质

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020034126A1 (zh) * 2018-08-15 2020-02-20 深圳先进技术研究院 样本训练方法、分类方法、识别方法、装置、介质及系统
CN109214431B (zh) * 2018-08-15 2022-02-01 深圳先进技术研究院 样本训练方法、分类方法、识别方法、装置、介质及系统
CN109325020A (zh) * 2018-08-20 2019-02-12 中国平安人寿保险股份有限公司 小样本使用方法、装置、计算机设备和存储介质
CN110874608B (zh) * 2018-09-03 2024-04-05 京东科技控股股份有限公司 分类方法、系统和电子设备
CN109325118B (zh) * 2018-09-03 2023-06-27 平安科技(深圳)有限公司 不平衡样本数据预处理方法、装置和计算机设备
CN109445662B (zh) * 2018-11-08 2022-02-22 腾讯科技(深圳)有限公司 虚拟对象的操作控制方法、装置、电子设备及存储介质
CN111275470B (zh) * 2018-12-04 2023-12-01 北京嘀嘀无限科技发展有限公司 服务发起概率预测方法及其模型的训练方法和装置
CN110309578B (zh) * 2019-06-27 2023-09-29 郑州铁路职业技术学院 一种基于计算机数据处理的经济数据拟合系统及方法
CN111832613B (zh) * 2020-06-03 2022-03-15 北京百度网讯科技有限公司 模型训练方法、装置、电子设备和存储介质
CN112149754B (zh) * 2020-09-30 2021-06-11 罗中岩 一种信息的分类方法、装置、设备及存储介质
CN113569929B (zh) * 2021-07-15 2024-03-01 北京淇瑀信息科技有限公司 基于小样本扩展的互联网服务提供方法、装置及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017017682A1 (en) * 2015-07-29 2017-02-02 Agt International Gmbh Data fusion and classification with imbalanced datasets background
CN106778853A (zh) * 2016-12-07 2017-05-31 中南大学 基于权重聚类和欠抽样的不平衡数据分类方法
CN107169518A (zh) * 2017-05-18 2017-09-15 北京京东金融科技控股有限公司 数据分类方法、装置、电子装置及计算机可读介质
CN107239789A (zh) * 2017-05-09 2017-10-10 浙江大学 一种基于k‑means的不平衡数据工业故障分类方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017017682A1 (en) * 2015-07-29 2017-02-02 Agt International Gmbh Data fusion and classification with imbalanced datasets background
CN106778853A (zh) * 2016-12-07 2017-05-31 中南大学 基于权重聚类和欠抽样的不平衡数据分类方法
CN107239789A (zh) * 2017-05-09 2017-10-10 浙江大学 一种基于k‑means的不平衡数据工业故障分类方法
CN107169518A (zh) * 2017-05-18 2017-09-15 北京京东金融科技控股有限公司 数据分类方法、装置、电子装置及计算机可读介质

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021103401A1 (zh) * 2019-11-25 2021-06-03 深圳壹账通智能科技有限公司 数据对象分类方法、装置、计算机设备和存储介质
CN112132208A (zh) * 2020-09-18 2020-12-25 北京奇艺世纪科技有限公司 图像转换模型的生成方法、装置、电子设备及存储介质
CN112132208B (zh) * 2020-09-18 2023-07-14 北京奇艺世纪科技有限公司 图像转换模型的生成方法、装置、电子设备及存储介质
CN112182269A (zh) * 2020-09-27 2021-01-05 北京达佳互联信息技术有限公司 图像分类模型的训练、图像分类方法、装置、设备及介质
CN112182269B (zh) * 2020-09-27 2023-11-28 北京达佳互联信息技术有限公司 图像分类模型的训练、图像分类方法、装置、设备及介质
CN113255748A (zh) * 2021-05-14 2021-08-13 广州织点智能科技有限公司 一种商品识别模型的特征底库更新方法及装置
CN114154578A (zh) * 2021-12-02 2022-03-08 内蒙古工业大学 面向非平衡数据基于半监督分布式训练的任务识别方法
CN114154578B (zh) * 2021-12-02 2023-10-31 内蒙古工业大学 面向非平衡数据基于半监督分布式训练的任务识别方法
CN115879587A (zh) * 2022-01-11 2023-03-31 北京中关村科金技术有限公司 样本不均衡条件下的投诉预测方法、装置及存储介质
CN115879587B (zh) * 2022-01-11 2024-01-26 北京中关村科金技术有限公司 样本不均衡条件下的投诉预测方法、装置及存储介质

Also Published As

Publication number Publication date
CN108388924A (zh) 2018-08-10

Similar Documents

Publication Publication Date Title
WO2019169700A1 (zh) 一种数据分类方法、装置、设备及计算机可读存储介质
CN110209764B (zh) 语料标注集的生成方法及装置、电子设备、存储介质
WO2018196798A1 (zh) 用户客群分类方法和装置
US8549478B2 (en) Graphical user interface input element identification
WO2022160449A1 (zh) 文本分类方法、装置、电子设备及存储介质
US11042581B2 (en) Unstructured data clustering of information technology service delivery actions
WO2022105179A1 (zh) 生物特征图像识别方法、装置、电子设备及可读存储介质
US11853908B2 (en) Data-analysis-based, noisy labeled and unlabeled datapoint detection and rectification for machine-learning
WO2019169704A1 (zh) 一种数据分类方法、装置、设备及计算机可读存储介质
KR102227593B1 (ko) 학습-기반 그룹 태깅을 위한 시스템 및 방법
CN104112084B (zh) 用于基于执行的许可发现和优化的方法和系统
JP2018509664A (ja) モデル生成方法、単語重み付け方法、装置、デバイス及びコンピュータ記憶媒体
CN112104662B (zh) 远端数据读写方法、装置、设备及计算机可读存储介质
CN110825873B (zh) 用于对日志异常分类规则进行扩充的方法及装置
US8918406B2 (en) Intelligent analysis queue construction
CN111738290A (zh) 图像检测方法、模型构建和训练方法、装置、设备和介质
US20230016044A1 (en) Techniques for creating and utilizing multidimensional embedding spaces
US10169418B2 (en) Deriving a multi-pass matching algorithm for data de-duplication
CN114780712B (zh) 一种基于质量评价的新闻专题生成方法及装置
US11928160B2 (en) Classification device, classification method, and classification program
CN113656354A (zh) 日志分类方法、系统、计算机设备和可读存储介质
CN110059180B (zh) 文章作者身份识别及评估模型训练方法、装置及存储介质
WO2020040312A1 (ja) 学習装置、学習方法および予測システム
JP2017084249A (ja) データ分類システム,方法,プログラムおよびその記録媒体
JP6496078B2 (ja) 分析支援装置、分析支援方法、および分析支援プログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18908761

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 09/12/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18908761

Country of ref document: EP

Kind code of ref document: A1