9
$\begingroup$

There are several evaluation measures for multilabel classification. In the mlr package tutorial you can see some of them: http://mlr-org.github.io/mlr-tutorial/devel/html/measures/index.html and even more in this paper https://journal.r-project.org/archive/2015-2/charte-charte.pdf (e.g. AUC for multilabel) with implementations of them in R. In this paper there are also described some more measures: http://people.oregonstate.edu/~sorowerm/pdf/Qual-Multilabel-Shahed-CompleteVersion.pdf

Some take into account dependencies, others do not. What do you think is the best evaluation metrics (in which case)?

I heard that the hamming loss can be optimized best by using the binary relevance method...

$\endgroup$
10
  • $\begingroup$ I came across your question because I have the same question. I cannot confidently offer an answer, but I can offer my opinion as a comment. Thanks for your link to "journal.r-project.org/archive/2015-2/charte-charte.pdf (e.g. AUC for multilabel)". Based on this, I would think that the AUC, based on ranks of probability estimates, is inherentlly superior to all the other measures listed, which all assume some threshold (e.g., 0.5) for their calculation. So, I would go with the AUC measure from the R mlr package (or the updated mlr3 package, if it still has multilabel classification). $\endgroup$
    – Tripartio
    Commented Aug 23, 2023 at 12:46
  • 2
    $\begingroup$ As the bounty message says, I wonder if the usual strictly proper scoring rules apply here, such as log loss and Brier score. It sure seems like they would. // This question relates to my questions about multi-label robustness and the statistical model underlying it all. // @Tripartio AUC does not consider calibration, which limits the utility of AUC. $\endgroup$
    – Dave
    Commented Aug 23, 2023 at 12:55
  • $\begingroup$ @Dave, I doubt that proper scoring rules can be applied directly, since they are designed to process one observation/label at a time and not multiple. However, if we move to the power set of all possible labels, i.e. we transform the problem to a bigger multi-class classification, then proper scoring rules should work as always. $\endgroup$ Commented Aug 27, 2023 at 11:00
  • 1
    $\begingroup$ @picky_porpoise Brier score seems quite easy to calculate: take the predicted probability, subtract the indicator or whether or not the category was present, square that difference, add up over all categories for all observations, same as with a multi-class problem. The interpretation might be different (minimization in expectation by the true probabilities, decomposition into measures of calibration and discrimination), but the calculation seems straightforward enough. $\endgroup$
    – Dave
    Commented Aug 27, 2023 at 12:04
  • 1
    $\begingroup$ @Dave you are absolutely right, this seems reasonable. Then we have simply $k$ probability forecasting problems (where $k$ is the number of possible labels) which share one observation (the actual labels). Calibration and decompositions can be computed for every problem individually. Only their combination might require some care. $\endgroup$ Commented Aug 27, 2023 at 12:20

2 Answers 2

3
+50
$\begingroup$

Let me address various points of the discussions regarding the use of scoring rules. I think the argument for using (strictly) proper scoring rules in multi-label classification is the same as in binary or multi-class classification. They allow us to compare the quality of statistical information on the labeling provided by forecasters or models.

But how do strictly proper scoring rules apply to multi-label classification?

There are various ways of application, and to explain the two which I find most insightful I borrow the two major "problem transformation methods" for multi-label classification which are mentioned in the corresponding Wikipedia article.

1) Transformation into multi-class classification

This essentially means that we do classification on the label powerset, i.e. instead of looking at $k$ labels we consider $2^k$ categories which reflect all possible label combinations. For instance, if the labels can be ${a,b}$ we would use the categories $\{\emptyset, \{a\}, \{b\}, \{a,b\} \}$. We could then require multi-label classifications to come in the form of probability distributions on the label powerset. See also Ben's answer to What is the statistical model for a multi-label problem?. These probability distributions can be evaluated via proper scoring rules:

Let $m=2^k$ be the size of the label powerset and assume $p = (p_1, \ldots, p_m)$ are probabilities for the different label combinations. Let $l$ be a labelling and $i(l)$ the index of the label combination which corresponds to $l$ (so in our example above $i(\{a\}) = 2$). Two popular examples:

The multi-label log score / cross entropy loss is

$$ S_{\log} (p, l) = - \log ( p_{i(l)} ) $$

If we have $n$ datapoints $l_1, \ldots, l_n$, then using the average $S_{\log}$ of the data can be interpreted as the log-likelihood of a multinomial distribution with $n$ trials, $m=2^k$ possible events and probabilities $p_1, \ldots, p_m$.

Alternatively, the multi-label probability/quadratic score is $$ S_q (p, l) = \sum_{j=1}^{m} ( p_j - \mathbb{I} \{j = i(l) \} )^2 $$

Both are strictly proper scoring rules, since they are just known scoring rules applied to a certain discrete distribution.

2) Transformation into binary classifications

In this case we have simply $k$ probability forecasting problems which share one observation. Hence, we can apply (strictly) proper scoring rules to each individual label forecast. Assume $p= (p_1, \ldots, p_k)$, where $p_i$ is the probability that label $i$ is present (The components of $p$ do not sum to 1!) Let $S: [0,1] \times {0,1} \to \mathbb{R}$ be a (strictly) proper scoring rule for probabilities and let $y(l)$ be the vector which indicates which label is present (so in our example above $y(\{a\}) = (1, 0)$ and $y(\{a,b\}) = (1,1)$.) Then $$ S_\mathrm{bin} (p, l) = \sum_{j=1}^{k} S(p_j, (y(l))_j ) $$ is a proper scoring rule. For $S$ we could for example use the log score or the Brier score.

Using this evaluation approach does not imply that we assume the labels occur independently. It means that we ignore the information on label dependence in the evaluation. Thinking about it in the sense of full probability distributions as discussed in 1) we only evaluate the marginals of the full distribution. As a result, a model which gets the marginals right, but dependence wrong, can achieve the same score as the best possible model which takes independence into account.

Ignoring dependence in the evaluation ignores information, but it has the advantage that it simplifies the evaluation. In particular, it allows for easy assessment of calibration and computation of score decompositions, since these are well-known for binary problems.

In comparison to a standard multi-class setting, I see no drawbacks or advantages of proper scoring rules. The only difference is the size of the possible observations ($k$ vs $2^k$), which can make the evaluation expensive to compute.

$\endgroup$
3
  • $\begingroup$ I need to think about this, and I suspect questions will remain on my end (the possible and possibly dynamic dependence has me hung up), but +60 for the interesting post! $\endgroup$
    – Dave
    Commented Aug 30, 2023 at 14:22
  • $\begingroup$ To me the major aspects laid out in this answer are also discussed in my answer and the discussion below: A) The multilabel problem can be casted either as a multiclass problem (by the label powerset representation) or as multiple binary classifications. B) It suggests to look at the expected log likelihood (either by looking at the deviance or cross entropy). $\endgroup$
    – Ggjj11
    Commented Aug 30, 2023 at 14:48
  • 1
    $\begingroup$ @Ggjj11 Agreed, I tried to summarize many scattered aspects of the question. Also I wanted to be more explicit on how scoring rules come into play. $\endgroup$ Commented Aug 30, 2023 at 20:02
1
$\begingroup$

What about comparing the cross entropy loss? In this case if a classifier achieves significantly lower cross entropy loss than another one on the test set, then it is better. For GLMs this is similar to having a look at the expected difference in deviances: https://en.m.wikipedia.org/wiki/Deviance_(statistics)

https://www.tandfonline.com/doi/abs/10.1080/00031305.1987.10475434

REFERENCE

Hastie, Trevor. "A closer look at the deviance." The American Statistician 41.1 (1987): 16-20.

$\endgroup$
6
  • 1
    $\begingroup$ Could you please point to the particular part of the article that addresses deviance in this context of multi-label predictions? Since cross-entropy loss is a proper scoring rule (at least in the multi-class case), I don’t think I can award the bounty to this post without it having more detail about how cross-entropy would be interpreted. Perhaps see my comment about Brier score to see where my head is, at least regarding another proper scoring rule. $\endgroup$
    – Dave
    Commented Aug 27, 2023 at 12:09
  • $\begingroup$ Would this information help stats.stackexchange.com/a/186907/298651 (not from the paper itself and just generally speaking about deviance and multi-class classification)? What questions are remaining exactly? $\endgroup$
    – Ggjj11
    Commented Aug 27, 2023 at 18:34
  • 1
    $\begingroup$ The whole point of my bounty is to discuss possible differences in the multi-class vs the multi-label setting, and that link discusses the multi-class setting that is more straightforward. It’s obvious what the likelihood is for a multi-class problem: multinomial, with corresponding deviance. For multi-label, there seem to be many more possibilities. $\endgroup$
    – Dave
    Commented Aug 27, 2023 at 18:38
  • $\begingroup$ Good clarification. In the case of Multi-Label classification the task can be boiled down to multiple binary classification tasks. In that case we can construct a likelihood function again, which then enables computation of deviance. It should read $L=\prod_{i=1}^n (\prod_k (\prod_{j_k}((p_{k,j_k}(x_i)^{\delta_{y_{i,k},j_k}}))))$, where $y_{i,k}$ is 1 if the sample i carries label k, else 0 (multiple hot encoded labels). j indexes the binary outcome, and k indexes the labels. $\delta$ is the Kronecker Delta. Assuming that labels are independent. If this helps, I can adapt my answer $\endgroup$
    – Ggjj11
    Commented Aug 27, 2023 at 20:59
  • 2
    $\begingroup$ The trouble is that there’s no reason to assume independence. In fact, one of the links I posted goes to a question about a multi-label problem where there is a strong relationship between label occurrence (CEOs usually get both types of severance package or neither, only occasionally just one type). $\endgroup$
    – Dave
    Commented Aug 27, 2023 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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