internalsGet Pro

Module 07 · Lesson 9 of 12Pro

Multi-class and multi-label problems

Level
Intermediate
Topic
Classical ML: regression and classification
Reading time
17 min

When you finish this page you can

  1. Tell a multi-class problem from a multi-label one, and give each the right output layer, softmax or one sigmoid per label.
  2. Choose between one multinomial model and one-vs-rest models in scikit-learn, and say what would change the choice.
  3. Read a per-class report, and explain why accuracy and micro-averaged scores hide a weak small class that macro averaging shows.
  4. Pick a separate threshold for each label from a validation set, aiming at the precision each label needs.

Builds on 3 lessons

Start with lesson 213 min
  1. Logistic regression: predicting probabilities13 min
  2. Common losses: squared error to cross-entropy14 min
  3. Entropy and cross-entropy: measuring surprise17 min

Six chances that add up to 1.7

is our example online store, with 50,000 products in its notebook sample. When a seller lists a new product, Kartly suggests its top-level category: one of six, such as Fashion, Home or Toys. Kartly’s twenty categories sit under these six, and this lesson works at the top level. Joseph’s growth team wants the suggestion right, because a product in the wrong category is missing from the pages its buyers browse.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan