Skip to main content
Machine Learning & Deep Learning

⏱ About 10 min10 XP

Sorting Challenge

You have learned so much about sorting! You know what labels are, how datasets are built, how machines find patterns, and how to fix mistakes. Now it is time to put all of that knowledge to work. This lesson is your Sorting Challenge — a series of puzzles that let you think like a machine-learning engineer. Have fun!

Puzzle 1: Pick the Right Label

A team is building a machine to sort library books into Fiction and Non-Fiction. They are labeling their first batch of examples. Here are five books. Think about which label each one gets before reading on. 1. A story about a dragon who goes to school — Fiction. 2. A book about how volcanoes form — Non-Fiction. 3. A picture book where talking animals go on a picnic — Fiction. 4. An atlas showing maps of every country — Non-Fiction. 5. A chapter book about a girl who travels back in time — Fiction. Did you agree with all five? Consistent labeling is the first step to a good dataset!

Puzzle 1 Key

Fiction means the story is made up. Non-Fiction means the information is real. Sorting by these two labels is a two-group sort.

Puzzle 2: Spot the Tricky Case

The library team finds a tricky book: a biography of a real scientist, told as an exciting adventure story with imagined conversations. Is it Fiction or Non-Fiction? This is a real in-between case. The events are real (Non-Fiction), but the conversations are invented (Fiction-style). The team decides to add a third label — Narrative Non-Fiction — for books like this. Good thinking! Creating a new group for in-between cases is better than forcing the wrong label.

A book tells the true story of the first moon landing, but written like a thrilling adventure. Which label fits best?

Puzzle 3: Grow the Dataset

The sorting machine is trained and tested. Its score is 75 out of 100 — not bad, but the team wants to do better. They check the mistakes. Every wrong answer is a Non-Fiction book that the machine labeled as Fiction. Why? Because the dataset had 80 Fiction examples but only 20 Non-Fiction examples! The machine saw so much Fiction that it started guessing Fiction for everything. The fix: collect and label 60 more Non-Fiction examples to balance the dataset.

The machine keeps guessing Fiction even for Non-Fiction books. What is most likely wrong?

Puzzle 4: Design the Whole System

Complete the steps a machine-learning team follows, in order.

First, collect examples. Second, each example. Third, let the machine learn. Fourth, test with hidden examples. Fifth, fix mistakes and again.
You Think Like an Engineer!

You just worked through labeling, tricky cases, dataset balance, and the fix-it loop. Those are the exact steps real machine-learning engineers use every day.

Design Your Own Sorting Machine

  1. Choose a sorting job you care about — books, songs, foods, animals, or anything else.
  2. Write down the groups your machine will sort into (two to four groups).
  3. List five examples for each group and write the label for each one.
  4. Circle one example that might be tricky and explain why.
  5. Describe how you would test your machine after training.
  6. Share your design with a friend or family member and explain each step.