How to introduce machine learning to middle-schoolers
Last updated
Last updated
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 Andrew Ng's famous MOOC on Coursera. 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.