# Weighing each label in multi-label classification

If, in addition to predicting labels using a multi-label classifier, I'm interested in predicting the weight of each label, what approach should be taken? To give an example, let's say I'm trying to predict movie genres from their plot and for a movie like Terminator the classifier predicts ['Sci-Fi', 'Action'], then is it also possible to estimate the proportion of those genres in that movie, like it's 70% Action and 30% Sci-Fi?

Multi-label classifier does give the probability for each class; is it a good idea to just normalize those probabilities and use them as the weights?

## 1 Answer

Yes, of course, this technique exists. In XGBoost, for instance, you can change the objective function to the multi:softprob which in specifics does:

multi:softprob: same as softmax, but output a vector of ndata * nclass, which can be further reshaped to ndata * nclass matrix. The result contains predicted probability of each data point belonging to each class.

From my memory, if it answers your question I think it rounds up to 1.

• So, almost all the models can give probabilities as an output but what I'm rather interested in knowing is whether those probabilities can directly be used as the weights that I want to give to each class. For ex. if I get [.7, .3] probabilities for [Sci-Fi, Action] can I say that the movie is 70% Sci-Fi and 30% Action? Oct 15, 2019 at 10:01
• I am not sure I get your point. Yes, you can make this assumption that .7 is 70% etc under the condition that all add up to 1. I perceive that you may be confused whether this probability translates to the accuracy of detecting the label or the amount of the label contained in that specific instance. From the Classifier's point of view that's the same thing, a decision tree for instance, will make rules to detect whether an instance is a particular genre. Ticking the boxes that a movie is more prone to be one genre and less the other, means that contains more than the other. Oct 15, 2019 at 11:08
• Yes, that's exactly what I was confused about. It also depends on the problem that the model is trying to solve I think. Let's say we have a multi-label model that predicts whether an image contains people, car or both. Now if we look at these two images: Image_1 Image_2 Oct 15, 2019 at 12:58
• And our model may predict [.5,.5] for both the images but that doesn't give us any information on how many cars/people are there in each image. Oct 15, 2019 at 12:58
• My point is that the model won't necessarily be trained to predict that 10% of the image pixles belong to people and 90% to cars. Oct 15, 2019 at 13:06