1. Home
  2. Data Science
  3. Scikit-learn
  4. In f1_score with average='macro', how are the per-class…

Added 30 Nov -0001

In f1_score with average='macro', how are the per-class scores combined into one number?

  1. As a mean weighted by each class's support, so large classes dominate
  2. As a mean weighted by each class's predicted count rather than support
  3. As the ratio of total true positives to total predicted positives
  4. As an unweighted mean, so every class counts equally whatever its size Correct answer

Correct answer

D. As an unweighted mean, so every class counts equally whatever its size

25 views

MCQSEXAM

Explanation

average='macro' computes the metric for each class independently and takes the unweighted mean, giving a rare class the same influence as a frequent one. The weighted option weights each class by its support, while micro pools all decisions into one global count, which equals accuracy in single-label classification. Macro scores expose poor performance on minority classes that accuracy hides.

Reference

Asked in: NTS, PPSC IT, Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is D? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Scikit-learn MCQs

Practise all Scikit-learn MCQs

Similar MCQs