Skip to content
  • Official
  • Beginner
  • English
  • About 60 min
  • 8 steps · 2 quizzes

Machine Learning from Scratch — How Computers Learn from Examples

A hands-on first look at machine learning — no maths, no code. Students compare hand-written rules with a filter that learns, turn examples into points…

  • Free
  • No account needed
  • Stop any time, pick up where you left off
Workshopy.io

WorkshopyOfficial

28 lessons · used by 2 teachers

For teachers

Teaching this? Run it live with your class.

  • Students join with a code — no accounts
  • See who’s done and who’s stuck, step by step
  • It’s your copy — change anything before class

Sign in to copy it to your workspace. It’s free.

Your path

8 steps · 2 quizzes · about 60 minutes · open any step

  1. Rules or examples?Start hereA spam filter must decide: Inbox or Spam? You could write the rules yourself — or show the computer emails people have already sorted and let it find the clues. That second way is machine learning.InteractiveHands-on · 6 min
  2. Examples become pointsTo learn, a computer needs examples it can measure. Each example becomes a few numbers — its features — plus the answer we want to predict, its label. Here: 40 made-up students — hours studied, hours slept, and whether they passed.InteractiveHands-on · 6 min
  3. Ask the neighboursThe simplest learner just remembers every example. To label a new student, it finds the k nearest students and lets them vote. This is called k-nearest neighbours. Try it: tap anywhere on the map to place a new student. Change k.InteractiveHands-on · 6 min
  4. Learning a lineAnother kind of model draws one straight line: on one side "passed", on the other "not yet". It starts with a bad line and learns from its mistakes: every point on the wrong side pulls the line a little towards it.InteractiveHands-on · 6 min
  5. Check: learning from examplesQuiz · 4 questions
  6. The real test: data it has never seenA model is only useful on new examples. So before training we hide some examples — the test set — and score the model on them afterwards. Try it: hold back 20 students, then train and test both models. Compare their scores on the two groups.InteractiveHands-on · 6 min
  7. Overfitting: memorising the noiseReal data is messy: some students study a lot and still don't pass. A model that bends around every odd example memorises the noise: it looks perfect in training and does worse on new data. That is overfitting.InteractiveHands-on · 6 min
  8. More data, better dataTry it: in "More data", slide from 5 to 600 students. Then open "Lopsided data" and flip the switch.InteractiveHands-on · 6 min
  9. From one line to a neural networkSome patterns can't be split by one line: these plants thrive only with medium water and medium sun. A neural network combines many simple units: each hidden unit draws one line, and the output combines them into a shape.InteractiveHands-on · 6 min
  10. Final checkQuiz · 6 questions

Comments 0

You’ll sign in with Google before it’s posted.Comments are public — don’t name your students.
0 / 1,500

No comments yet. Be the first to say how it went.

Using it

Workshopy shares this lesson under CC BY 4.0. Anyone may use and change it, with credit to you. Anyone can learn it here, free. A copy in your workspace is yours to change and run live; your students never need an account.

Versions

  1. 1

    Version 1Current

    · First published

Copies are made from the current version. A copy you already have doesn’t change.

More from Workshopy

All 28 lessons