How many labels should a multi-label classifier output per instance: top-k or per-label thresholds?

Quick Overview

Decide how a multi-label classifier should turn per-label scores into a set of predicted labels, comparing top-k, per-label thresholds, hybrid rules and cardinality prediction. Tests how well you match the decision rule to label-count spread, calibration and the evaluation metric.

How many labels should a multi-label classifier output per instance: top-k or per-label thresholds?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

How do you decide how many labels to output per instance in multi-label classification, for example top-k versus per-label thresholds? The model gives a score for every label on every instance. The question is the decision rule that turns those scores into a set of predicted labels. ```hint Start from the data and the metric Look at how much the number of true labels per instance varies, and ask which metric and which UI the output feeds. ``` ### What a Strong Answer Covers - How per-label thresholds behave, including their dependence on calibration and the empty-set case - How top-k behaves, and the errors it forces when the true label count differs from k - At least one hybrid rule or a way to predict the label count per instance - A practical procedure for choosing among the rules, tied to the evaluation metric and validated on held-out data ### Follow-up Questions - How would you tune per-label thresholds when some labels have only a handful of positive examples? - Does the choice change if the target metric is micro-F1 instead of macro-F1? - What would you do if the model's scores are poorly calibrated but you still need thresholds? - How do correlations between labels affect the decision rule?

Overview: Decide how a multi-label classifier should turn per-label scores into a set of predicted labels, comparing top-k, per-label thresholds, hybrid rules and cardinality prediction. Tests how well you match the decision rule to label-count spread, calibration and the evaluation metric.

General logo
General
Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

How do you decide how many labels to output per instance in multi-label classification, for example top-k versus per-label thresholds?

The model gives a score for every label on every instance. The question is the decision rule that turns those scores into a set of predicted labels.

What a Strong Answer Covers Guidance

  • How per-label thresholds behave, including their dependence on calibration and the empty-set case
  • How top-k behaves, and the errors it forces when the true label count differs from k
  • At least one hybrid rule or a way to predict the label count per instance
  • A practical procedure for choosing among the rules, tied to the evaluation metric and validated on held-out data

Follow-up Questions Guidance

  • How would you tune per-label thresholds when some labels have only a handful of positive examples?
  • Does the choice change if the target metric is micro-F1 instead of macro-F1?
  • What would you do if the model's scores are poorly calibrated but you still need thresholds?
  • How do correlations between labels affect the decision rule?