Sitemap
Sinan Muştu

Sinan Muştu

Data Scientist

Introduction to Multilabel Classification

4 min readFeb 2, 2022

Multilabel Classification is the task of classifying where samples can assign to more than one class(label) instead of a single class. Let’s consider the binary(single) classification that most of us are familiar with. In binary classification, samples can belong to only one class. For example, a customer buys or does not buy the car, a mail is a spam or not spam, etc.

So how can we give an example for the multilabel? Let’s take the weather forecast as our first example. For example, the weather in Istanbul is sunny and windy, while in Utrecht it can be rainy, cloudy, and cold. As can be seen, a sample (city) can be assigned to more than one class (sunny, windy).

Press enter or click to view image in full size
source of image [https://s3.envato.com/files/225385878/prev%20im.jpg]

Another example can be given as follows: Let’s have a dataset of images that includes a penguin, panda, parrot, fox, and squirrel(why not?). Let’s try to find out which animals are in these images. In one image, a penguin and a parrot (the parrot that visits its friend despite the cold weather) maybe take part at the same time. In another image, a panda, fox, and squirrel are may be found at the same time. Well, a sample (image) can assign to more than one class (panda, fox, squirrel) simultaneously.

Binary classification can be considered as a subset of multi-label learning.

Up to this point, we have briefly looked at multi-label classification. We have also examined the difference between single classification and multilabel learning.

Remember, when you research multilabel learning, you will come across the concept of multiclass classifying, which is often confused with each other. Let’s take a quick look at Multiclass Classification.

In Multiclass Classification, there is more than one label, however, the example can belong to only one of them. Let’s remember the previous image example. Although there are panda, penguin, parrot, fox, and squirrel classes in the image, the result in multiclass classification is only one of them.

Press enter or click to view image in full size
source of image [https://i.stack.imgur.com/XghaO. png]

The following questions will better tell us the difference between these methods;

Binary Classification → Is — A relationship (Is this a blabla?)

Is this a panda or not? Is this a fox or not?

In this example, the total number of classes K = 2 and the number of classes an item may be assigned to C = 1.

There are two choices and the sample could belong to only one of them.

Press enter or click to view image in full size
Binary Classification — Single Label

Multilabel Classification →Which of these?

Get Sinan Muştu’s stories in your inbox

Join Medium for free to get updates from this writer.

· Penguin, parrot?

· Fox, panda?

· Panda, fox, squirrel?

· Squirrel, fox, parrot, panda?

In this example, the total number of classes K = 5 > 2, and the number of classes an item may be assigned to C >= 0.

There are more than two choices and samples could be assigned to some of them or non of them.

Press enter or click to view image in full size
Multi-Label Classification

Multiclass Classification → What is this?

· Penguin ? or Panda? maybe Parrot? well, Fox? perhaps Squirrel ?

A better example of this can be given with blood groups. There are four blood types (A, B, AB, 0) and a person’s blood type can only be one of them. In other words, a person cannot have both A and AB blood groups at the same time.

In this example, the total number or class K = 4 > 2, and the number of classes an item may be assigned to C = 1.

Again there are more than two choices and the sample could be assigned to only one of them.

Press enter or click to view image in full size
Multi-Class Classification

In this first article, we have introduced the multilabel classification method by also referring to binary and multiclass classification. I tried to deal with the subject in general terms without going into too much detail. I hope it has been an understandable and explanatory introduction to multilabel classification. In my next articles, we will examine the multilabel learning method with Python in practice and will touch on the evaluation metrics for multilabel problems. Then we can discuss the issue of correlation between labels.

See you in the next article!

--

--