Machine learning based classification segmentation for large class sets
A classification system is provided for efficient machine-learning-based classification using a large set of possible classes (e.g., millions or hundreds of millions of distinct classes). A two-step process may be used whereby the large set of classes is segmented into reasonably-sized segments, and a separate classification model is generated for each of the different segments of classes.
1 . A computer-implemented method comprising:
under control of a computing system comprising one or more computing devices configured to execute specific instructions,
obtaining a plurality of data entities, wherein a data entity of the plurality of data entities comprises a set of values for a set of features;
determining a degree of intra-class variability in values for a feature of the set of features among only data entities labeled with a class of a set of classes, wherein the set of classes comprises at least one hundred thousand classes;
identifying, prior to segmenting the set of classes and based on the degree of intra-class variability being below a predetermined threshold, the feature as a segmentation candidate feature to segment the set of classes;
segmenting the set of classes into a plurality of class segments based at least partly on the segmentation candidate feature, wherein each class segment of the plurality of class segments comprises at least two orders of magnitude fewer classes than the set of classes, and wherein each class segment is associated with a different data entity subset of the plurality of data entities; and
training a plurality of machine-learning-based classification models comprising a separate machine learning based classification model for each class segment of the plurality of class segments, wherein a first machine-learning-based classification model is trained for a first class segment of the plurality of class segments using a first data entity subset associated with the first class segment, and wherein a second machine-learning-based classification model is trained for a second class segment of the plurality of class segments using a second data entity subset associated with the second class segment.
2 . The computer-implemented method of claim 1 , further comprising identifying a second segmentation candidate feature to segment the set of classes, wherein segmenting the set of classes into to the plurality of class segments is based at least partly on the segmentation candidate feature and the second segmentation candidate feature.
3 . The computer-implemented method of claim 1 , further comprising:
identifying a second segmentation candidate feature to segment the set of classes;
segmenting the set of classes into to a second plurality of class segments based at least partly on the second segmentation candidate feature; and
determining that the second plurality of class segments fails to satisfy a segmentation criterion, wherein segmenting the set of classes into the plurality of class segments based at least partly on the segmentation candidate feature is performed in response to determining that the second plurality of class segments fails to satisfy the segmentation criterion.
4 . The computer-implemented method of claim 1 , wherein segmenting the set of classes into the plurality of class segments comprises generating a tree data structure, wherein a first leaf node of the tree data structure is associated with a first class segment, and wherein a second leaf node of the tree data structure is associated with a second class segment.
5 . The computer-implemented method of claim 1 , wherein segmenting the set of classes into the plurality of class segments comprises executing a clustering algorithm using the segmentation candidate feature and a different representative data entity of each class of the set of classes.
6 . The computer-implemented method of claim 1 , wherein training the plurality of machine-learning-based classification models comprises training at least one of: a naïve Bayes classifier, a random forest model, or a Bayes network.
7 . The computer-implemented method of claim 1 , wherein training the plurality of machine-learning-based classification models comprises:
training the first machine-learning-based classification model using a first computing device of a plurality of computing devices; and
training the second machine-learning-based classification model using a second computing device of the plurality of computing devices, wherein at least a portion of training the second machine-learning-based classification model is performed in parallel with at least a portion of training the first machine-learning-based classification model.
8 . The computer-implemented method of claim 1 , further comprising generating a table comprising:
first data associating a first class segment with the first machine-learning-based classification model trained to generate classification output data associated with one or more classes of the first class segment; and
second data associating a second class segment with the second machine-learning-based classification model trained to generate classification output data associated with one or more classes of the second class segment.
9 . The computer-implemented method of claim 8 , further comprising:
receiving a data entity to be classified;
determining that the data entity is associated with the first class segment;
determining, using the table, to classify the data entity using the first machine-learning-based classification model; and
classifying the data entity using the first machine-learning-based classification model.
10 . The computer-implemented method of claim 8 , wherein generating the table further comprises generating third data associating a third class segment with a single class, wherein the third class segment comprises only the single class.
11 . The computer-implemented method of claim 1 , wherein segmenting the set of classes into the plurality of class segments comprises generating a graph data structure, wherein a first vertex of the graph data structure is associated with a first class segment, and wherein a second vertex of the graph data structure is associated with a second class segment.
12 . A system comprising:
computer-readable memory storing executable instructions; and
one or more computer processors in communication with the computer-readable memory and programmed by the executable instructions to at least:
obtain a plurality of data entities, wherein a data entity of the plurality of data entities comprises a set of values for a set of features;
determine a degree of intra-class variability in values for a feature of the set of features among only data entities labeled with a class of a set of classes, wherein the set of classes comprises at least one hundred thousand classes;
identify, prior to segmenting the set of classes and based on the degree of intra-class variability being below a predetermined threshold, the feature as a segmentation candidate feature to segment the set of classes;
segment the set of classes into a plurality of class segments based at least partly on the segmentation candidate feature, wherein each class segment of the plurality of class segments comprises at least two orders of magnitude fewer classes than the set of classes, and wherein each class segment is associated with a different data entity subset of the plurality of data entities; and
train a plurality of machine-learning-based classification models comprising a separate machine learning based classification model for each class segment of the plurality of class segments, wherein a first machine-learning-based classification model is trained for a first class segment of the plurality of class segments using a first data entity subset associated with the first class segment, and wherein a second machine-learning-based classification model is trained for a second class segment of the plurality of class segments using a second data entity subset associated with the second class segment.
13 . The system of claim 12 , wherein the one or more computer processors are programmed by further executable instructions to determine a degree of variability in values for the segmentation candidate feature among data entities associated with a particular class of the set of classes, wherein the segmentation candidate feature is identified based on the degree of variability.
14 . The system of claim 12 , wherein the one or more computer processors are programmed by further executable instructions to:
receive a data entity to be classified;
determine, using one of a graph data structure or a tree data structure, that the data entity is associated with a first class segment; and
classify the data entity using a first machine-learning-based classification model trained to classify data entities as one or more classes of the first class segment.
15 . The system of claim 12 , wherein the first machine-learning-based classification model is trained using a first processor, and wherein the second machine-learning-based classification model is trained using a second processor.
16 . The system of claim 15 , wherein at least a portion of training the second machine-learning-based classification model is performed in parallel with at least a portion of training the first machine-learning-based classification model.
17 . The system of claim 12 , wherein the first machine-learning-based classification model is trained to consider a first subset of the set of features, wherein the second machine-learning-based classification model is trained to consider a second subset of the set of features, and wherein the second subset is different from the first subset.
18 . The system of claim 12 , wherein to segment the set of classes into the plurality of class segments, the one or more computer processors are programmed by further executable instructions to generate a tree data structure, wherein a first leaf node of the tree data structure is associated with a first class segment, and wherein a second leaf node of the tree data structure is associated with a second class segment.
19 . The system of claim 12 , wherein to segment the set of classes into the plurality of class segments, the one or more computer processors are programmed by further executable instructions to generate a graph data structure, wherein a first vertex of the graph data structure is associated with a first class segment, and wherein a second vertex of the graph data structure is associated with a second class segment.
20 . The system of claim 12 , wherein the set of classes comprises 1,000,000 distinct classes.