Worldclass
  • Worldclass
  • Our Mission
  • How to Join?
  • Team
  • Frequently Asked Questions
  • 👨‍🎓Courses
    • Visual Trigonometry
    • Exploding Dots
    • Relearning Math
  • 💡Articles
    • How to introduce machine learning to middle-schoolers
    • Nothing in math is "easy" and that's good news
    • How to raise a "math person"
  • 🧩Puzzles
    • Divisibility as a walk on a graph
  • 📚Books & Games
    • Our Math Books & Games
Powered by GitBook
On this page
  1. Articles

How to introduce machine learning to middle-schoolers

Nilesh Trivedi

PreviousRelearning MathNextNothing in math is "easy" and that's good news

Last updated 6 months ago

I gave this online class ( - requires password) to teach machine-learning to 12 year olds. Not just at a high level, but actually teach them the nitty-gritty of basic gradient descent algorithm.

From the outside, "machine learning" sounds like advanced magic. But that is far from the truth. At its core, machine learning is curve-fitting with a few extra steps.

I first learned the basics of machine learning from . But this required knowledge of advanced math notation, linear algebra and programming.

But curve-fitting is far more accessible even to middle school kids. Here is how I prepared a sequence:

  • Show examples of machine learning applications around us:

    • Autocorrect while typing

    • ChatGPT

    • Recommendations at Amazon or Netflix

    • Object detection in images

    • Robots

    • Handwriting recognition

  • Talk about how these problems are all instances of number crunching. Input and output for these are just numbers.

  • Talk about the differences and connections between arithmetic, algebra, computation and learning. Use the idea of function guessing game.

  • Explain the difference between programming and machine learning.

  • Visualize function guessing for single variable functions on a 2D graph.

  • Make sure they understand the two parameters (slope and intercept) required to determine a line.

  • Take a concrete problem with one input and one noisy output.

  • Introduce the error function to measure the goodness of fit.

  • Use Microsoft Excel to visualize the error landscape. Have them start somewhere randomly and come up with strategies to minimize the error.

  • Use Data table and Surface plot to make their approach concrete.

  • Talk about overfitting.

  • Show them the corresponding code in a visual programming language that supports vectors.

💡
recording available here
Andrew Ng's famous MOOC on Coursera