69
$\begingroup$

What is the difference between a multiclass problem and a multilabel problem?

$\endgroup$
  • $\begingroup$ Both tasks can be accomplished with Vowpal Wabbit software package (command-line, python bindings are available). $\endgroup$ – Vladislavs Dovgalecs Aug 26 '15 at 20:40
  • $\begingroup$ I learned this concept and build my understanding with this post, they explained multi-label classification in a very elegant way. $\endgroup$ – user235077 Jan 23 '19 at 14:47
57
$\begingroup$

I suspect the difference is that in multi-class problems the classes are mutually exclusive, whereas for multi-label problems each label represents a different classification task, but the tasks are somehow related (so there is a benefit in tackling them together rather than separately). For example, in the famous leptograspus crabs dataset there are examples of males and females of two colour forms of crab. You could approach this as a multi-class problem with four classes (male-blue, female-blue, male-orange, female-orange) or as a multi-label problem, where one label would be male/female and the other blue/orange. Essentially in multi-label problems a pattern can belong to more than one class.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ @Dirkran Thanks for your explanation. Do you know any other source where i can get multilabel dataset other than csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multilabel.html and mulan.sourceforge.net/datasets.html $\endgroup$ – Learner Jun 13 '11 at 10:42
  • $\begingroup$ @Learner sorry it isn't something I have worked on much. You might want to have a look at multi-task learning, which has some similarities to multi-label learning. Perhaps some of the datasets used for that might also be useful as benchmarks for mult-label learning. $\endgroup$ – Dikran Marsupial Jun 13 '11 at 11:10
44
$\begingroup$

Multiclass classification means a classification task with more than two classes; e.g., classify a set of images of fruits which may be oranges, apples, or pears. Multiclass classification makes the assumption that each sample is assigned to one and only one label: a fruit can be either an apple or a pear but not both at the same time.

Multilabel classification assigns to each sample a set of target labels. This can be thought of as predicting properties of a data-point that are not mutually exclusive, such as topics that are relevant for a document. A text might be about any of religion, politics, finance or education at the same time or none of these.

Taken from http://scikit-learn.org/stable/modules/multiclass.html


Edit1 (Sept 2020): For those who prefer contrasts of these terms for a better understanding.

Look at these contrasts:

  • Multi-class vs Binary-class is the question of the number of classes your classifier is modeling. In theory, a binary classifier is much simpler than multi-class, so it's important to make this distinction. For example, the Support vector machine (SVM) can trivially learn a hyperplane to separate two classes, but 3 or more classes makes it complex. In the neural networks, we commonly use Sigmoid for binary, but Softmax for multi-class as the last layer of the model.

  • Multi-label vs Single-Label is the question of how many classes any object or example can belong to. In the neural networks, if single label is needed we use a single Softmax layer as the last layer, thus learning a single probability distribution that spans across all classes. If the multi-label classification is needed, we use multiple Sigmoids on the last layer, thus learning separate distribution for each class.

Remarks: we combine multilabel with multiclass, in fact, it is safe to assume that all multi-label are multi-class classifiers. It's very very rare that you'd have two classes and want to assign both labels at the same time. On the other side, not all Multi-class classifiers are multi-label classifiers and you shouldn't assume it unless explicitly stated.

| cite | improve this answer | |
$\endgroup$
21
$\begingroup$

To complement the other answers, here are some figures. One row = the expected output for one sample.

Multiclass

One column = one class (one-hot encoding)

enter image description here

Multilabel

One column = one class

enter image description here


You see that:

  • in the multilabel case, one sample might be assigned more than one class.
  • in the multiclass case, there are more than 2 classes in total.

As a side note, nothing prevents you from having a multioutput-multiclass classification problem, e.g.:

enter image description here

| cite | improve this answer | |
$\endgroup$
9
$\begingroup$

A multi-class problem has the assignment of instances to one of a finite, mutually-exclusive collection of classes. As in the example already given of crabs (from @Dikran): male-blue, female-blue, male-orange, female-orange. Each of these is exclusive of the others and taken together they are comprehensive.

One form of a multi-label problem is to divide these into two labels, sex and color; where sex can be male or female, and color can be blue or orange. But note that this is a special case of the multi-label problem as every instance will get every label (that is every crab has both a sex and a color).

Multi-label problems also include other cases that allow for a variable number of labels to be assigned to each instance. For instance, an article in a newspaper or wire service may be assigned to the categories NEWS, POLITICS, SPORTS, MEDICINE, etc. One story about an important sporting event would get an assignment of the label SPORTS; while another, involving political tensions that are revealed by a particular sporting event, might get both the labels SPORTS and POLITICS. Where I am, in the US, the results of the Superbowl are labeled both SPORTS and NEWS given the societal impact of the event.

Note that this form of labeling, with variable numbers of labels, can be recast into a form similar to the example with the crabs; except that every label is treated as LABEL-X or not-LABEL-X. But not all methods require this recasting.

| cite | improve this answer | |
$\endgroup$
2
$\begingroup$

And one more difference lies in that the multi-label problem requires the model to learn the correlation between the different classes, but in multiclass problems different classes are independent of each other.

| cite | improve this answer | |
$\endgroup$
0
$\begingroup$

Multi Class classification Problem One right answer and Mutually exclusive outputs(eg iris, numbers) Multi Label Classification more than one right answer and appropriate output or Non exclusive eg(sugar test, eye test)

In multi class we user softmax In multi label we use sigmoid

| cite | improve this answer | |
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.