Learndata-mlTrain-a-Classifier Challenge

Lesson · 15 min

Train-a-Classifier Challenge

Hands-on: build a dataset and train a real text classifier right here.

Time to become a model trainer. In the lab below you’ll build a message classifier (for example: kind vs. rude messages) by writing training examples yourself, then watch a naive Bayes model learn your patterns live.

Your mission

  • Write at least 6 examples per category — variety beats repetition.
  • Train and check the accuracy and confusion matrix.
  • Test tricky messages and watch the confidence scores.
  • Reach 90% accuracy to unlock the Data Curator badge.
XP: 100 for completing the lab, plus the Data Curator badge at 90%+ accuracy. The classifier runs entirely in your browser — no data leaves your device.

Hands-on lab

Train-a-Classifier Lab

Everything runs in your browser — naive Bayes, live.

Need 90% test accuracy (now 0%)

1. Build your dataset

Add kind and rude messages. Variety beats repetition!

kind: 6rude: 612 examples total
kindYou did awesome on that test, congrats!
kindThanks so much for your help today
kindHope you feel better soon friend
kindGreat game yesterday, you played amazing
kindYou are always so kind and helpful
kindLove your presentation, super clear
rudeThat was a dumb thing to say
rudeNobody wants you in this group
rudeYou are so annoying sometimes
rudeYour ideas are always terrible
rudeStop being such a loser
rudeWhatever, nobody cares about you

2. Check the results

Train the model to see training vs. test accuracy and the confusion matrix.

3. Test it like a pro

Model Arena — your model vs a real LLM

checking…

Your naive Bayes counts words in your dataset. The LLM reads your dataset as a few-shot prompt — exactly what the prompting module taught. Same data, two very different machines.

Ask the model about your data

Knowledge check

1

In the lab, adding more varied examples usually…

2

The model labels a clear "rude" message as "kind". What is the FIRST thing to check?

Tip: finish the lab first — completing it auto-completes this lesson.